summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qrichtext_p.cpp
authorleseb <leseb>2002-07-14 21:21:35 (UTC)
committer leseb <leseb>2002-07-14 21:21:35 (UTC)
commit4feeec8b5b41cfd3d13274411f515524f687da09 (patch) (unidiff)
tree002bbfb9997713e5d5975855d3cfbba7a71b9104 /noncore/apps/opie-write/qrichtext_p.cpp
parentbdef9cf23ced569a9bc80c1d4f25d85861273b4a (diff)
downloadopie-4feeec8b5b41cfd3d13274411f515524f687da09.zip
opie-4feeec8b5b41cfd3d13274411f515524f687da09.tar.gz
opie-4feeec8b5b41cfd3d13274411f515524f687da09.tar.bz2
opie-write first draft
Diffstat (limited to 'noncore/apps/opie-write/qrichtext_p.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext_p.cpp706
1 files changed, 706 insertions, 0 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp
new file mode 100644
index 0000000..fb20730
--- a/dev/null
+++ b/noncore/apps/opie-write/qrichtext_p.cpp
@@ -0,0 +1,706 @@
1/****************************************************************************
2** $Id$
3**
4** Implementation of the internal Qt classes dealing with rich text
5**
6** Created : 990101
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#include "qrichtext_p.h"
39
40using namespace Qt3;
41
42QTextCommand::~QTextCommand() {}
43QTextCommand::Commands QTextCommand::type() const { return Invalid; }
44
45
46QTextCustomItem::~QTextCustomItem() {}
47void QTextCustomItem::adjustToPainter( QPainter* p){ if ( p ) width = 0; }
48QTextCustomItem::Placement QTextCustomItem::placement() const { return PlaceInline; }
49
50bool QTextCustomItem::ownLine() const { return FALSE; }
51void QTextCustomItem::resize( int nwidth ){ width = nwidth; }
52void QTextCustomItem::invalidate() {}
53
54bool QTextCustomItem::isNested() const { return FALSE; }
55int QTextCustomItem::minimumWidth() const { return 0; }
56
57QString QTextCustomItem::richText() const { return QString::null; }
58
59bool QTextCustomItem::enter( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy, bool atEnd )
60{
61 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; Q_UNUSED( atEnd ) return TRUE;
62
63}
64bool QTextCustomItem::enterAt( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy, const QPoint & )
65{
66 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
67}
68bool QTextCustomItem::next( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy )
69{
70 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
71}
72bool QTextCustomItem::prev( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy )
73{
74 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
75}
76bool QTextCustomItem::down( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy )
77{
78 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
79}
80bool QTextCustomItem::up( QTextCursor *, QTextDocument *&doc, QTextParag *&parag, int &idx, int &ox, int &oy )
81{
82 doc = doc; parag = parag; idx = idx; ox = ox; oy = oy; return TRUE;
83}
84
85void QTextFlow::setPageSize( int ps ) { pagesize = ps; }
86bool QTextFlow::isEmpty() { return leftItems.isEmpty() && rightItems.isEmpty(); }
87
88void QTextTableCell::invalidate() { cached_width = -1; cached_sizehint = -1; }
89
90void QTextTable::invalidate() { cachewidth = -1; }
91
92QTextParagData::~QTextParagData() {}
93void QTextParagData::join( QTextParagData * ) {}
94
95QTextFormatter::~QTextFormatter() {}
96void QTextFormatter::setWrapEnabled( bool b ) { wrapEnabled = b; }
97void QTextFormatter::setWrapAtColumn( int c ) { wrapColumn = c; }
98
99
100
101int QTextCursor::x() const
102{
103 QTextStringChar *c = string->at( idx );
104 int curx = c->x;
105 if ( !c->rightToLeft &&
106 c->c.isSpace() &&
107 idx > 0 &&
108 ( string->alignment() & Qt3::AlignJustify ) == Qt3::AlignJustify )
109 curx = string->at( idx - 1 )->x + string->string()->width( idx - 1 );
110 if ( c->rightToLeft )
111 curx += string->string()->width( idx );
112 return curx;
113}
114
115int QTextCursor::y() const
116{
117 int dummy, line;
118 string->lineStartOfChar( idx, &dummy, &line );
119 return string->lineY( line );
120}
121
122bool QTextDocument::hasSelection( int id, bool visible ) const
123{
124 return ( selections.find( id ) != selections.end() &&
125 ( !visible ||
126 ( (QTextDocument*)this )->selectionStartCursor( id ) !=
127 ( (QTextDocument*)this )->selectionEndCursor( id ) ) );
128}
129
130void QTextDocument::setSelectionStart( int id, QTextCursor *cursor )
131{
132 QTextDocumentSelection sel;
133 sel.startCursor = *cursor;
134 sel.endCursor = *cursor;
135 sel.swapped = FALSE;
136 selections[ id ] = sel;
137}
138
139QTextParag *QTextDocument::paragAt( int i ) const
140{
141 QTextParag* p = curParag;
142 if ( !p || p->paragId() > i )
143 p = fParag;
144 while ( p && p->paragId() != i )
145 p = p->next();
146 ((QTextDocument*)this)->curParag = p;
147 return p;
148}
149
150
151QTextFormat::~QTextFormat()
152{
153}
154
155QTextFormat::QTextFormat()
156 : fm( QFontMetrics( fn ) ), linkColor( TRUE ), logicalFontSize( 3 ), stdSize( qApp->font().pointSize() ),
157 different( NoFlags )
158{
159 ref = 0;
160
161 usePixelSizes = FALSE;
162 if ( stdSize == -1 ) {
163 stdSize = qApp->font().pixelSize();
164 usePixelSizes = TRUE;
165 }
166
167 missp = FALSE;
168 ha = AlignNormal;
169 collection = 0;
170}
171
172QTextFormat::QTextFormat( const QStyleSheetItem *style )
173 : fm( QFontMetrics( fn ) ), linkColor( TRUE ), logicalFontSize( 3 ), stdSize( qApp->font().pointSize() ),
174 different( NoFlags )
175{
176 ref = 0;
177
178 usePixelSizes = FALSE;
179 if ( stdSize == -1 ) {
180 stdSize = qApp->font().pixelSize();
181 usePixelSizes = TRUE;
182 }
183
184 this->style = style->name();
185 missp = FALSE;
186 ha = AlignNormal;
187 collection = 0;
188 fn = QFont( style->fontFamily(),
189 style->fontSize(),
190 style->fontWeight(),
191 style->fontItalic() );
192 fn.setUnderline( style->fontUnderline() );
193 col = style->color();
194 fm = QFontMetrics( fn );
195 leftBearing = fm.minLeftBearing();
196 rightBearing = fm.minRightBearing();
197 hei = fm.lineSpacing();
198 asc = fm.ascent() + (fm.leading()+1)/2;
199 dsc = fm.descent();
200 missp = FALSE;
201 ha = AlignNormal;
202 memset( widths, 0, 256 );
203 generateKey();
204 addRef();
205 updateStyleFlags();
206}
207
208QTextFormat::QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent )
209 : fn( f ), col( c ), fm( QFontMetrics( f ) ), linkColor( TRUE ),
210 logicalFontSize( 3 ), stdSize( f.pointSize() ), different( NoFlags )
211{
212 ref = 0;
213 usePixelSizes = FALSE;
214 if ( stdSize == -1 ) {
215 stdSize = f.pixelSize();
216 usePixelSizes = TRUE;
217 }
218 collection = parent;
219 leftBearing = fm.minLeftBearing();
220 rightBearing = fm.minRightBearing();
221 hei = fm.lineSpacing();
222 asc = fm.ascent() + (fm.leading()+1)/2;
223 dsc = fm.descent();
224 missp = FALSE;
225 ha = AlignNormal;
226 memset( widths, 0, 256 );
227 generateKey();
228 addRef();
229 updateStyleFlags();
230}
231
232QTextFormat::QTextFormat( const QTextFormat &f )
233 : fm( f.fm )
234{
235 ref = 0;
236 collection = 0;
237 fn = f.fn;
238 col = f.col;
239 leftBearing = f.leftBearing;
240 rightBearing = f.rightBearing;
241 memset( widths, 0, 256 );
242 hei = f.hei;
243 asc = f.asc;
244 dsc = f.dsc;
245 stdSize = f.stdSize;
246 usePixelSizes = f.usePixelSizes;
247 logicalFontSize = f.logicalFontSize;
248 missp = f.missp;
249 ha = f.ha;
250 k = f.k;
251 linkColor = f.linkColor;
252 style = f.style;
253 different = f.different;
254 addRef();
255}
256
257QTextFormat& QTextFormat::operator=( const QTextFormat &f )
258{
259 ref = 0;
260 collection = f.collection;
261 fn = f.fn;
262 col = f.col;
263 fm = f.fm;
264 leftBearing = f.leftBearing;
265 rightBearing = f.rightBearing;
266 memset( widths, 0, 256 );
267 hei = f.hei;
268 asc = f.asc;
269 dsc = f.dsc;
270 stdSize = f.stdSize;
271 usePixelSizes = f.usePixelSizes;
272 logicalFontSize = f.logicalFontSize;
273 missp = f.missp;
274 ha = f.ha;
275 k = f.k;
276 linkColor = f.linkColor;
277 style = f.style;
278 different = f.different;
279 addRef();
280 return *this;
281}
282
283void QTextFormat::update()
284{
285 fm = QFontMetrics( fn );
286 leftBearing = fm.minLeftBearing();
287 rightBearing = fm.minRightBearing();
288 hei = fm.lineSpacing();
289 asc = fm.ascent() + (fm.leading()+1)/2;
290 dsc = fm.descent();
291 memset( widths, 0, 256 );
292 generateKey();
293 updateStyleFlags();
294}
295
296
297QPainter* QTextFormat::pntr = 0;
298
299void QTextFormat::setPainter( QPainter *p )
300{
301 pntr = p;
302}
303
304QPainter* QTextFormat::painter()
305{
306 return pntr;
307}
308
309
310int QTextFormat::minLeftBearing() const
311{
312 if ( !pntr || !pntr->isActive() )
313 return leftBearing;
314 pntr->setFont( fn );
315 return pntr->fontMetrics().minLeftBearing();
316}
317
318int QTextFormat::minRightBearing() const
319{
320 if ( !pntr || !pntr->isActive() )
321 return rightBearing;
322 pntr->setFont( fn );
323 return pntr->fontMetrics().minRightBearing();
324}
325
326int QTextFormat::height() const
327{
328 if ( !pntr || !pntr->isActive() )
329 return hei;
330 pntr->setFont( fn );
331 return pntr->fontMetrics().lineSpacing();
332}
333
334int QTextFormat::ascent() const
335{
336 if ( !pntr || !pntr->isActive() )
337 return asc;
338 pntr->setFont( fn );
339 return pntr->fontMetrics().ascent() + (pntr->fontMetrics().leading()+1)/2;
340}
341
342int QTextFormat::descent() const
343{
344 if ( !pntr || !pntr->isActive() )
345 return dsc;
346 pntr->setFont( fn );
347 return pntr->fontMetrics().descent();
348}
349
350int QTextFormat::leading() const
351{
352 if ( !pntr || !pntr->isActive() )
353 return fm.leading();
354 pntr->setFont( fn );
355 return pntr->fontMetrics().leading();
356}
357
358void QTextFormat::generateKey()
359{
360 k = getKey( fn, col, isMisspelled(), vAlign() );
361}
362
363QString QTextFormat::getKey( const QFont &fn, const QColor &col, bool misspelled, VerticalAlignment a )
364{
365 QString k = fn.key();
366 k += '/';
367 k += QString::number( (uint)col.rgb() );
368 k += '/';
369 k += QString::number( (int)misspelled );
370 k += '/';
371 k += QString::number( (int)a );
372 return k;
373}
374
375void QTextFormat::updateStyle()
376{
377 if ( !collection || !collection->styleSheet() )
378 return;
379 QStyleSheetItem *item = collection->styleSheet()->item( style );
380 if ( !item )
381 return;
382 if ( !( different & Color ) && item->color().isValid() )
383 col = item->color();
384 if ( !( different & Size ) && item->fontSize() != -1 )
385 fn.setPointSize( item->fontSize() );
386 if ( !( different & Family ) && !item->fontFamily().isEmpty() )
387 fn.setFamily( item->fontFamily() );
388 if ( !( different & Bold ) && item->fontWeight() != -1 )
389 fn.setWeight( item->fontWeight() );
390 if ( !( different & Italic ) && item->definesFontItalic() )
391 fn.setItalic( item->fontItalic() );
392 if ( !( different & Underline ) && item->definesFontUnderline() )
393 fn.setUnderline( item->fontUnderline() );
394 generateKey();
395 update();
396
397}
398
399void QTextFormat::updateStyleFlags()
400{
401 different = NoFlags;
402 if ( !collection || !collection->styleSheet() )
403 return;
404 QStyleSheetItem *item = collection->styleSheet()->item( style );
405 if ( !item )
406 return;
407 if ( item->color() != col )
408 different |= Color;
409 if ( item->fontSize() != fn.pointSize() )
410 different |= Size;
411 if ( item->fontFamily() != fn.family() )
412 different |= Family;
413 if ( item->fontItalic() != fn.italic() )
414 different |= Italic;
415 if ( item->fontUnderline() != fn.underline() )
416 different |= Underline;
417 if ( item->fontWeight() != fn.weight() )
418 different |= Bold;
419}
420
421QString QTextString::toString( const QMemArray<QTextStringChar> &data )
422{
423 QString s;
424 int l = data.size();
425 s.setUnicode( 0, l );
426 QTextStringChar *c = data.data();
427 QChar *uc = (QChar *)s.unicode();
428 while ( l-- ) {
429 *uc = c->c;
430 // ### workaround so that non-breaking whitespaces are drawn
431 // properly, actually this should be fixed in QFont somewhere
432 if ( *uc == (char)0xa0 )
433 *uc = 0x20;
434 uc++;
435 c++;
436 }
437
438 return s;
439}
440
441QString QTextString::toString() const
442{
443 return toString( data );
444}
445
446void QTextParag::setSelection( int id, int start, int end )
447{
448 QMap<int, QTextParagSelection>::ConstIterator it = selections().find( id );
449 if ( it != mSelections->end() ) {
450 if ( start == ( *it ).start && end == ( *it ).end )
451 return;
452 }
453
454 QTextParagSelection sel;
455 sel.start = start;
456 sel.end = end;
457 (*mSelections)[ id ] = sel;
458 setChanged( TRUE, TRUE );
459}
460
461void QTextParag::removeSelection( int id )
462{
463 if ( !hasSelection( id ) )
464 return;
465 if ( mSelections )
466 mSelections->remove( id );
467 setChanged( TRUE, TRUE );
468}
469
470int QTextParag::selectionStart( int id ) const
471{
472 if ( !mSelections )
473 return -1;
474 QMap<int, QTextParagSelection>::ConstIterator it = mSelections->find( id );
475 if ( it == mSelections->end() )
476 return -1;
477 return ( *it ).start;
478}
479
480int QTextParag::selectionEnd( int id ) const
481{
482 if ( !mSelections )
483 return -1;
484 QMap<int, QTextParagSelection>::ConstIterator it = mSelections->find( id );
485 if ( it == mSelections->end() )
486 return -1;
487 return ( *it ).end;
488}
489
490bool QTextParag::hasSelection( int id ) const
491{
492 if ( !mSelections )
493 return FALSE;
494 QMap<int, QTextParagSelection>::ConstIterator it = mSelections->find( id );
495 if ( it == mSelections->end() )
496 return FALSE;
497 return ( *it ).start != ( *it ).end || length() == 1;
498}
499
500bool QTextParag::fullSelected( int id ) const
501{
502 if ( !mSelections )
503 return FALSE;
504 QMap<int, QTextParagSelection>::ConstIterator it = mSelections->find( id );
505 if ( it == mSelections->end() )
506 return FALSE;
507 return ( *it ).start == 0 && ( *it ).end == str->length() - 1;
508}
509
510int QTextParag::lineY( int l ) const
511{
512 if ( l > (int)lineStarts.count() - 1 ) {
513 qWarning( "QTextParag::lineY: line %d out of range!", l );
514 return 0;
515 }
516
517 if ( !isValid() )
518 ( (QTextParag*)this )->format();
519
520 QMap<int, QTextParagLineStart*>::ConstIterator it = lineStarts.begin();
521 while ( l-- > 0 )
522 ++it;
523 return ( *it )->y;
524}
525
526int QTextParag::lineBaseLine( int l ) const
527{
528 if ( l > (int)lineStarts.count() - 1 ) {
529 qWarning( "QTextParag::lineBaseLine: line %d out of range!", l );
530 return 10;
531 }
532
533 if ( !isValid() )
534 ( (QTextParag*)this )->format();
535
536 QMap<int, QTextParagLineStart*>::ConstIterator it = lineStarts.begin();
537 while ( l-- > 0 )
538 ++it;
539 return ( *it )->baseLine;
540}
541
542int QTextParag::lineHeight( int l ) const
543{
544 if ( l > (int)lineStarts.count() - 1 ) {
545 qWarning( "QTextParag::lineHeight: line %d out of range!", l );
546 return 15;
547 }
548
549 if ( !isValid() )
550 ( (QTextParag*)this )->format();
551
552 QMap<int, QTextParagLineStart*>::ConstIterator it = lineStarts.begin();
553 while ( l-- > 0 )
554 ++it;
555 return ( *it )->h;
556}
557
558void QTextParag::lineInfo( int l, int &y, int &h, int &bl ) const
559{
560 if ( l > (int)lineStarts.count() - 1 ) {
561 qWarning( "QTextParag::lineInfo: line %d out of range!", l );
562 qDebug( "%d %d", (int)lineStarts.count() - 1, l );
563 y = 0;
564 h = 15;
565 bl = 10;
566 return;
567 }
568
569 if ( !isValid() )
570 ( (QTextParag*)this )->format();
571
572 QMap<int, QTextParagLineStart*>::ConstIterator it = lineStarts.begin();
573 while ( l-- > 0 )
574 ++it;
575 y = ( *it )->y;
576 h = ( *it )->h;
577 bl = ( *it )->baseLine;
578}
579
580int QTextParag::alignment() const
581{
582 if ( align != -1 )
583 return align;
584 QStyleSheetItem *item = style();
585 if ( !item )
586 return Qt3::AlignAuto;
587 if ( mStyleSheetItemsVec ) {
588 for ( int i = 0; i < (int)mStyleSheetItemsVec->size(); ++i ) {
589 item = (*mStyleSheetItemsVec)[ i ];
590 if ( item->alignment() != QStyleSheetItem::Undefined )
591 return item->alignment();
592 }
593 }
594 return Qt3::AlignAuto;
595}
596
597QPtrVector<QStyleSheetItem> QTextParag::styleSheetItems() const
598{
599 QPtrVector<QStyleSheetItem> vec;
600 if ( mStyleSheetItemsVec ) {
601 vec.resize( mStyleSheetItemsVec->size() );
602 for ( int i = 0; i < (int)vec.size(); ++i )
603 vec.insert( i, (*mStyleSheetItemsVec)[ i ] );
604 }
605 return vec;
606}
607
608QStyleSheetItem *QTextParag::style() const
609{
610 if ( !mStyleSheetItemsVec || mStyleSheetItemsVec->size() == 0 )
611 return 0;
612 return (*mStyleSheetItemsVec)[ mStyleSheetItemsVec->size() - 1 ];
613}
614
615int QTextParag::numberOfSubParagraph() const
616{
617 if ( list_val != -1 )
618 return list_val;
619 if ( numSubParag != -1 )
620 return numSubParag;
621 int n = 0;
622 QTextParag *p = (QTextParag*)this;
623 while ( p && ( styleSheetItemsVec().size() >= p->styleSheetItemsVec().size() &&
624 styleSheetItemsVec()[ (int)p->styleSheetItemsVec().size() - 1 ] == p->style() ||
625 p->styleSheetItemsVec().size() >= styleSheetItemsVec().size() &&
626 p->styleSheetItemsVec()[ (int)styleSheetItemsVec().size() - 1 ] == style() ) ) {
627 if ( p->style() == style() && listStyle() != p->listStyle()
628 && p->styleSheetItemsVec().size() == styleSheetItemsVec().size() )
629 break;
630 if ( p->style()->displayMode() == QStyleSheetItem::DisplayListItem
631 && p->style() != style() || styleSheetItemsVec().size() == p->styleSheetItemsVec().size() )
632 ++n;
633 p = p->prev();
634 }
635 ( (QTextParag*)this )->numSubParag = n;
636 return n;
637}
638
639void QTextParag::setFormat( QTextFormat *fm )
640{
641 bool doUpdate = FALSE;
642 if (defFormat && (defFormat != formatCollection()->defaultFormat()))
643 doUpdate = TRUE;
644 defFormat = formatCollection()->format( fm );
645 if ( !doUpdate )
646 return;
647 for ( int i = 0; i < length(); ++i ) {
648 if ( at( i )->format()->styleName() == defFormat->styleName() )
649 at( i )->format()->updateStyle();
650 }
651}
652
653QTextFormatter *QTextParag::formatter() const
654{
655 if ( hasdoc )
656 return document()->formatter();
657 if ( pseudoDocument()->pFormatter )
658 return pseudoDocument()->pFormatter;
659 return ( ( (QTextParag*)this )->pseudoDocument()->pFormatter = new QTextFormatterBreakWords );
660}
661
662void QTextParag::setTabArray( int *a )
663{
664 delete [] tArray;
665 tArray = a;
666}
667
668void QTextParag::setTabStops( int tw )
669{
670 if ( hasdoc )
671 document()->setTabStops( tw );
672 else
673 tabStopWidth = tw;
674}
675
676QMap<int, QTextParagSelection> &QTextParag::selections() const
677{
678 if ( !mSelections )
679 ((QTextParag *)this)->mSelections = new QMap<int, QTextParagSelection>;
680 return *mSelections;
681}
682
683QPtrVector<QStyleSheetItem> &QTextParag::styleSheetItemsVec() const
684{
685 if ( !mStyleSheetItemsVec )
686 ((QTextParag *)this)->mStyleSheetItemsVec = new QPtrVector<QStyleSheetItem>;
687 return *mStyleSheetItemsVec;
688}
689
690QPtrList<QTextCustomItem> &QTextParag::floatingItems() const
691{
692 if ( !mFloatingItems )
693 ((QTextParag *)this)->mFloatingItems = new QPtrList<QTextCustomItem>;
694 return *mFloatingItems;
695}
696
697QTextStringChar::~QTextStringChar()
698{
699 if ( format() )
700 format()->removeRef();
701 if ( type ) // not Regular
702 delete d.custom;
703}
704
705QTextParagPseudoDocument::QTextParagPseudoDocument():pFormatter(0),commandHistory(0), minw(0),wused(0){}
706QTextParagPseudoDocument::~QTextParagPseudoDocument(){ delete pFormatter; delete commandHistory; }