diff options
Diffstat (limited to 'lib/kotext/KoTextParag.cpp')
-rw-r--r-- | lib/kotext/KoTextParag.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/lib/kotext/KoTextParag.cpp b/lib/kotext/KoTextParag.cpp index 23754c28..cc1aecb9 100644 --- a/lib/kotext/KoTextParag.cpp +++ b/lib/kotext/KoTextParag.cpp @@ -154,7 +154,7 @@ void KoTextParag::setPrev( KoTextParag *s ) doc->setFirstParag( this ); } -void KoTextParag::tqinvalidate( int /*chr, ignored*/ ) +void KoTextParag::invalidate( int /*chr, ignored*/ ) { m_invalid = true; #if 0 @@ -186,7 +186,7 @@ void KoTextParag::setLineChanged( short int line ) void KoTextParag::insert( int index, const TQString &s ) { str->insert( index, s, formatCollection()->defaultFormat() ); - tqinvalidate( index ); + invalidate( index ); //needPreProcess = TRUE; } @@ -209,7 +209,7 @@ void KoTextParag::remove( int index, int len ) } } str->remove( index, len ); - tqinvalidate( 0 ); + invalidate( 0 ); //needPreProcess = TRUE; } @@ -252,7 +252,7 @@ void KoTextParag::join( KoTextParag *s ) extraData()->join( s->extraData() ); }*/ delete s; - tqinvalidate( 0 ); + invalidate( 0 ); //// kotext invalidateCounters(); //// @@ -403,14 +403,14 @@ void KoTextParag::format( int start, bool doMove ) bool makeInvalid = false; //p && p->lastInFrame; //kdDebug(32500) << "might move of dy=" << dy << ". previous's lastInFrame (=makeInvalid): " << makeInvalid << endl; while ( s && dy ) { - if ( s->movedDown ) { // (not in TQRT) : moved down -> tqinvalidate and stop moving down - s->tqinvalidate( 0 ); // (there is no point in moving down a parag that has a frame break...) + if ( s->movedDown ) { // (not in TQRT) : moved down -> invalidate and stop moving down + s->invalidate( 0 ); // (there is no point in moving down a parag that has a frame break...) break; } if ( !s->isFullWidth() ) makeInvalid = TRUE; if ( makeInvalid ) - s->tqinvalidate( 0 ); + s->invalidate( 0 ); s->move( dy ); //if ( s->lastInFrame ) // makeInvalid = TRUE; @@ -600,7 +600,7 @@ void KoTextParag::setFormat( int index, int len, const KoTextFormat *_f, bool us _f->shadowDistanceX() != of->shadowDistanceX() || _f->shadowDistanceY() != of->shadowDistanceY() ) ) { - tqinvalidate( 0 ); + invalidate( 0 ); } if ( flags == -1 || flags == KoTextFormat::Format || !fc ) { #ifdef DEBUG_COLLECTION @@ -690,7 +690,7 @@ void KoTextParag::setDirection( TQChar::Direction d ) { if ( str && str->direction() != d ) { str->setDirection( d ); - tqinvalidate( 0 ); + invalidate( 0 ); //// kotext m_layout.direction = d; invalidateCounters(); // #47178 @@ -837,7 +837,7 @@ void KoTextParag::lineInfo( int l, int &y, int &h, int &bl ) const bl = ( *it )->baseLine; } -uint KoTextParag::tqalignment() const +uint KoTextParag::alignment() const { return align; } @@ -946,66 +946,66 @@ void KoTextParag::setMargin( TQStyleSheetItem::Margin m, double _i ) //kdDebug(32500) << "KoTextParag::setMargin " << m << " margin " << _i << endl; m_layout.margins[m] = _i; if ( m == TQStyleSheetItem::MarginTop && prev() ) - prev()->tqinvalidate(0); // for top margin (post-1.1: remove this, not necessary anymore) - tqinvalidate(0); + prev()->invalidate(0); // for top margin (post-1.1: remove this, not necessary anymore) + invalidate(0); } void KoTextParag::setMargins( const double * margins ) { for ( int i = 0 ; i < 5 ; ++i ) m_layout.margins[i] = margins[i]; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setAlign( int align ) { Q_ASSERT( align <= TQt::AlignJustify ); align &= TQt::AlignHorizontal_Mask; - tqsetAlignment( align ); - m_layout.tqalignment = align; + setAlignment( align ); + m_layout.alignment = align; } int KoTextParag::resolveAlignment() const { - if ( (int)m_layout.tqalignment == TQt::AlignAuto ) + if ( (int)m_layout.alignment == TQt::AlignAuto ) return str->isRightToLeft() ? TQt::AlignRight : TQt::AlignLeft; - return m_layout.tqalignment; + return m_layout.alignment; } void KoTextParag::setLineSpacing( double _i ) { m_layout.setLineSpacingValue(_i); - tqinvalidate(0); + invalidate(0); } void KoTextParag::setLineSpacingType( KoParagLayout::SpacingType _type ) { m_layout.lineSpacingType = _type; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setTopBorder( const KoBorder & _brd ) { m_layout.topBorder = _brd; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setBottomBorder( const KoBorder & _brd ) { m_layout.bottomBorder = _brd; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setJoinBorder( bool join ) { m_layout.joinBorder = join; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setBackgroundColor ( const TQColor& color ) { m_layout.backgroundColor = color; - tqinvalidate(0); + invalidate(0); } void KoTextParag::setNoCounter() @@ -1060,17 +1060,17 @@ void KoTextParag::invalidateCounters() { // Invalidate this paragraph and all the following ones // (Numbering may have changed) - tqinvalidate( 0 ); + invalidate( 0 ); if ( m_layout.counter ) - m_layout.counter->tqinvalidate(); + m_layout.counter->invalidate(); KoTextParag *s = next(); // #### Possible optimization: since any invalidation propagates down, // it's enough to stop at the first paragraph with an already-invalidated counter, isn't it? - // This is only true if nobody else calls counter->tqinvalidate... + // This is only true if nobody else calls counter->invalidate... while ( s ) { if ( s->m_layout.counter ) - s->m_layout.counter->tqinvalidate(); - s->tqinvalidate( 0 ); + s->m_layout.counter->invalidate(); + s->invalidate( 0 ); s = s->next(); } } @@ -1290,13 +1290,13 @@ int KoTextParag::rightMargin() const KoTextZoomHandler * zh = textDocument()->formattingZoomHandler(); int cw=0; if( m_layout.counter && str->isRightToLeft() && - (( m_layout.counter->tqalignment() == TQt::AlignRight ) || ( m_layout.counter->tqalignment() == TQt::AlignAuto ))) + (( m_layout.counter->alignment() == TQt::AlignRight ) || ( m_layout.counter->alignment() == TQt::AlignAuto ))) cw = counterWidth(); return zh->ptToLayoutUnitPixX( m_layout.margins[ TQStyleSheetItem::MarginRight ] + m_layout.rightBorder.width() ) - + cw; /* in tqlayout units already */ + + cw; /* in layout units already */ } int KoTextParag::firstLineMargin() const @@ -1597,13 +1597,13 @@ void KoTextParag::paintLines( TQPainter &painter, const TQColorGroup &cg, KoText // we flush before and after tabs flush = flush || ( chr->c == '\t' || nextchr->c == '\t' ); // we flush on soft hypens - flush = flush || ( chr->c.tqunicode() == 0xad ); + flush = flush || ( chr->c.unicode() == 0xad ); // we flush on custom items flush = flush || chr->isCustom(); // we flush before custom items flush = flush || nextchr->isCustom(); // when painting justified we flush on spaces - if ((tqalignment() & TQt::AlignJustify) == TQt::AlignJustify ) + if ((alignment() & TQt::AlignJustify) == TQt::AlignJustify ) //flush = flush || TQTextFormatter::isBreakable( str, i ); flush = flush || chr->whiteSpace; // when underlining or striking "word by word" we flush before/after spaces @@ -1847,7 +1847,7 @@ void KoTextParag::drawParagStringInternal( TQPainter &painter, const TQString &s // 3) Paint TQString str( s ); - if ( str[ (int)str.length() - 1 ].tqunicode() == 0xad ) + if ( str[ (int)str.length() - 1 ].unicode() == 0xad ) str.remove( str.length() - 1, 1 ); painter.setPen( TQPen( textColor ) ); painter.setFont( font ); @@ -1877,7 +1877,7 @@ void KoTextParag::drawParagStringInternal( TQPainter &painter, const TQString &s } KoTextParag::drawFontEffects( &painter, format, zh, font, textColor, startX, baseLine, bw, lastY, h, str[start] ); - if ( str[ start ] != '\t' && str[ start ].tqunicode() != 0xad ) { + if ( str[ start ] != '\t' && str[ start ].unicode() != 0xad ) { str = format->displayedString( str ); // #### This converts the whole string, instead of from start to start+len! if ( format->vAlign() == KoTextFormat::AlignNormal ) { int posY = lastY + baseLine; @@ -1965,7 +1965,7 @@ void KoTextParag::drawParagStringInternal( TQPainter &painter, const TQString &s #ifdef DEBUG_PAINT //kdDebug(32500) << "we are drawing the end of line " << line << ". Auto-hyphenated: " << lineHyphenated( line ) << endl; #endif - bool drawHyphen = at( start+len-1 )->c.tqunicode() == 0xad; + bool drawHyphen = at( start+len-1 )->c.unicode() == 0xad; drawHyphen = drawHyphen || lineHyphenated( line ); if ( drawHyphen ) { #ifdef DEBUG_PAINT @@ -2059,7 +2059,7 @@ void KoTextParag::copyParagData( KoTextParag *parag ) //else // kdWarning() << "Paragraph has no style " << paragId() << endl; - // No "following style" setting, or same style -> copy tqlayout & format of previous paragraph + // No "following style" setting, or same style -> copy layout & format of previous paragraph if (!styleApplied) { setParagLayout( parag->paragLayout() ); @@ -2082,7 +2082,7 @@ void KoTextParag::copyParagData( KoTextParag *parag ) // Note: we don't call the original KoTextParag::copyParagData on purpose. // We don't want setListStyle to get called - it ruins our stylesheetitems // And we don't care about copying the stylesheetitems directly, - // applying the parag tqlayout will create them + // applying the parag layout will create them } void KoTextParag::setTabList( const KoTabulatorList &tabList ) @@ -2104,7 +2104,7 @@ void KoTextParag::setTabList( const KoTabulatorList &tabList ) { setTabArray( 0 ); } - tqinvalidate( 0 ); + invalidate( 0 ); } /** "Reimplemented" (compared to nextTabDefault) to implement non-left-aligned tabs */ @@ -2240,43 +2240,43 @@ void KoTextParag::applyStyle( KoParagStyle *style ) setFormat( newFormat ); } -void KoTextParag::setParagLayout( const KoParagLayout & tqlayout, int flags, int marginIndex ) +void KoTextParag::setParagLayout( const KoParagLayout & layout, int flags, int marginIndex ) { //kdDebug(32500) << "KoTextParag::setParagLayout flags=" << flags << endl; if ( flags & KoParagLayout::Alignment ) - setAlign( tqlayout.tqalignment ); + setAlign( layout.alignment ); if ( flags & KoParagLayout::Margins ) { if ( marginIndex == -1 ) - setMargins( tqlayout.margins ); + setMargins( layout.margins ); else - setMargin( (TQStyleSheetItem::Margin)marginIndex, tqlayout.margins[marginIndex] ); + setMargin( (TQStyleSheetItem::Margin)marginIndex, layout.margins[marginIndex] ); } if ( flags & KoParagLayout::LineSpacing ) { - setLineSpacingType( tqlayout.lineSpacingType ); - setLineSpacing( tqlayout.lineSpacingValue() ); + setLineSpacingType( layout.lineSpacingType ); + setLineSpacing( layout.lineSpacingValue() ); } if ( flags & KoParagLayout::Borders ) { - setLeftBorder( tqlayout.leftBorder ); - setRightBorder( tqlayout.rightBorder ); - setTopBorder( tqlayout.topBorder ); - setBottomBorder( tqlayout.bottomBorder ); - setJoinBorder( tqlayout.joinBorder ); + setLeftBorder( layout.leftBorder ); + setRightBorder( layout.rightBorder ); + setTopBorder( layout.topBorder ); + setBottomBorder( layout.bottomBorder ); + setJoinBorder( layout.joinBorder ); } if ( flags & KoParagLayout::BackgroundColor ) { - setBackgroundColor( tqlayout.backgroundColor ); + setBackgroundColor( layout.backgroundColor ); } if ( flags & KoParagLayout::BulletNumber ) - setCounter( tqlayout.counter ); + setCounter( layout.counter ); if ( flags & KoParagLayout::Tabulator ) - setTabList( tqlayout.tabList() ); + setTabList( layout.tabList() ); if ( flags == KoParagLayout::All ) { - setDirection( static_cast<TQChar::Direction>(tqlayout.direction) ); + setDirection( static_cast<TQChar::Direction>(layout.direction) ); // Don't call applyStyle from here, it would overwrite any paragraph-specific settings - setStyle( tqlayout.style ); + setStyle( layout.style ); } } @@ -2290,7 +2290,7 @@ void KoTextParag::setCustomItem( int index, KoTextCustomItem * custom, KoTextFor //addCustomItem(); document()->registerCustomItem( custom, this ); custom->recalc(); // calc value (e.g. for variables) and set initial size - tqinvalidate( 0 ); + invalidate( 0 ); setChanged( true ); } @@ -2349,7 +2349,7 @@ void KoTextParag::printRTDebug( int info ) static const char * const s_align[] = { "Auto", "Left", "Right", "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", }; static const char * const s_linespacing[] = { "Single", "1.5", "2", "custom", "atLeast", "Multiple", "Fixed" }; static const char * const s_dir[] = { "DirL", "DirR", "DirEN", "DirES", "DirET", "DirAN", "DirCS", "DirB", "DirS", "DirWS", "DirON", "DirLRE", "DirLRO", "DirAL", "DirRLE", "DirRLO", "DirPDF", "DirNSM", "DirBN" }; - kdDebug(32500) << " align: " << s_align[tqalignment()] << " resolveAlignment: " << s_align[resolveAlignment()] + kdDebug(32500) << " align: " << s_align[alignment()] << " resolveAlignment: " << s_align[resolveAlignment()] << " isRTL:" << str->isRightToLeft() << " dir: " << s_dir[direction()] << endl; TQRect pixr = pixelRect( textDocument()->paintingZoomHandler() ); @@ -2421,7 +2421,7 @@ void KoTextParag::printRTDebug( int info ) attrs.truncate( attrs.length() - 1 ); kdDebug(32500) << i << ": '" << TQString(ch.c).rightJustify(2) - << "' (" << TQString::number( ch.c.tqunicode() ).rightJustify(3) << ")" + << "' (" << TQString::number( ch.c.unicode() ).rightJustify(3) << ")" << " x(LU)=" << ch.x << " w(LU)=" << ch.width//s->width(i) << " x(PIX)=" << pixelx @@ -2849,7 +2849,7 @@ void KoTextParag::loadOasisSpan( const TQDomElement& parent, KoOasisContext& con KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleCollection *styleCollection, bool findStyle ) { - KoParagLayout tqlayout; + KoParagLayout layout; // Only when loading paragraphs, not when loading styles if ( findStyle ) @@ -2877,17 +2877,17 @@ KoParagLayout KoTextParag::loadParagLayout( KoOasisContext& context, KoStyleColl style = styleCollection->findStyle( "Standard" ); } Q_ASSERT(style); - tqlayout.style = style; + layout.style = style; } - KoParagLayout::loadOasisParagLayout( tqlayout, context ); + KoParagLayout::loadOasisParagLayout( layout, context ); - return tqlayout; + return layout; } void KoTextParag::loadOasis( const TQDomElement& parent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ) { - // First load tqlayout from style + // First load layout from style KoParagLayout paragLayout = loadParagLayout( context, styleCollection, true ); setParagLayout( paragLayout ); @@ -2906,7 +2906,7 @@ void KoTextParag::loadOasis( const TQDomElement& parent, KoOasisContext& context setFormat( len - 1, 1, paragFormat(), TRUE ); setChanged( true ); - tqinvalidate( 0 ); + invalidate( 0 ); } void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context, @@ -2915,7 +2915,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context, { KoGenStyles& mainStyles = context.mainStyles(); - // Write paragtqlayout to styles (with parent == the parag's style) + // Write paraglayout to styles (with parent == the parag's style) TQString parentStyleName; if ( m_layout.style ) parentStyleName = m_layout.style->name(); @@ -2924,11 +2924,11 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context, paragFormat()->save( autoStyle, context ); m_layout.saveOasis( autoStyle, context, false ); - // First paragraph is special, it includes page-tqlayout info (for word-processing at least) + // First paragraph is special, it includes page-layout info (for word-processing at least) if ( !prev() ) { if ( context.variableSettings() ) autoStyle.addProperty( "style:page-number", context.variableSettings()->startingPageNumber() ); - // Well we support only one page tqlayout, so the first parag always points to "Standard". + // Well we support only one page layout, so the first parag always points to "Standard". autoStyle.addAttribute( "style:master-page-name", "Standard" ); } @@ -3212,7 +3212,7 @@ void KoTextParag::drawFormattingChars( TQPainter &painter, int start, int len, #endif if ( ch.isCustom() ) continue; - if ( (ch.c == ' ' || ch.c.tqunicode() == 0x00a0U) + if ( (ch.c == ' ' || ch.c.unicode() == 0x00a0U) && (whichFormattingChars & FormattingSpace)) { // Don't use ch.pixelwidth here. We want a square with |