diff options
author | Timothy Pearson <[email protected]> | 2011-12-16 09:56:31 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-16 09:56:31 -0600 |
commit | c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54 (patch) | |
tree | 1ee1912ac4bb966475f0db0f2a78678661b4b4a5 /lib/kotext/KoTextParag.cpp | |
parent | 94844816550ad672ccfcdc25659c625546239998 (diff) | |
download | koffice-c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54.tar.gz koffice-c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 94844816550ad672ccfcdc25659c625546239998.
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 cc1aecb9..23754c28 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::invalidate( int /*chr, ignored*/ ) +void KoTextParag::tqinvalidate( 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() ); - invalidate( index ); + tqinvalidate( index ); //needPreProcess = TRUE; } @@ -209,7 +209,7 @@ void KoTextParag::remove( int index, int len ) } } str->remove( index, len ); - invalidate( 0 ); + tqinvalidate( 0 ); //needPreProcess = TRUE; } @@ -252,7 +252,7 @@ void KoTextParag::join( KoTextParag *s ) extraData()->join( s->extraData() ); }*/ delete s; - invalidate( 0 ); + tqinvalidate( 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 -> invalidate and stop moving down - s->invalidate( 0 ); // (there is no point in moving down a parag that has a frame break...) + 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...) break; } if ( !s->isFullWidth() ) makeInvalid = TRUE; if ( makeInvalid ) - s->invalidate( 0 ); + s->tqinvalidate( 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() ) ) { - invalidate( 0 ); + tqinvalidate( 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 ); - invalidate( 0 ); + tqinvalidate( 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::alignment() const +uint KoTextParag::tqalignment() 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()->invalidate(0); // for top margin (post-1.1: remove this, not necessary anymore) - invalidate(0); + prev()->tqinvalidate(0); // for top margin (post-1.1: remove this, not necessary anymore) + tqinvalidate(0); } void KoTextParag::setMargins( const double * margins ) { for ( int i = 0 ; i < 5 ; ++i ) m_layout.margins[i] = margins[i]; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setAlign( int align ) { Q_ASSERT( align <= TQt::AlignJustify ); align &= TQt::AlignHorizontal_Mask; - setAlignment( align ); - m_layout.alignment = align; + tqsetAlignment( align ); + m_layout.tqalignment = align; } int KoTextParag::resolveAlignment() const { - if ( (int)m_layout.alignment == TQt::AlignAuto ) + if ( (int)m_layout.tqalignment == TQt::AlignAuto ) return str->isRightToLeft() ? TQt::AlignRight : TQt::AlignLeft; - return m_layout.alignment; + return m_layout.tqalignment; } void KoTextParag::setLineSpacing( double _i ) { m_layout.setLineSpacingValue(_i); - invalidate(0); + tqinvalidate(0); } void KoTextParag::setLineSpacingType( KoParagLayout::SpacingType _type ) { m_layout.lineSpacingType = _type; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setTopBorder( const KoBorder & _brd ) { m_layout.topBorder = _brd; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setBottomBorder( const KoBorder & _brd ) { m_layout.bottomBorder = _brd; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setJoinBorder( bool join ) { m_layout.joinBorder = join; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setBackgroundColor ( const TQColor& color ) { m_layout.backgroundColor = color; - invalidate(0); + tqinvalidate(0); } void KoTextParag::setNoCounter() @@ -1060,17 +1060,17 @@ void KoTextParag::invalidateCounters() { // Invalidate this paragraph and all the following ones // (Numbering may have changed) - invalidate( 0 ); + tqinvalidate( 0 ); if ( m_layout.counter ) - m_layout.counter->invalidate(); + m_layout.counter->tqinvalidate(); 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->invalidate... + // This is only true if nobody else calls counter->tqinvalidate... while ( s ) { if ( s->m_layout.counter ) - s->m_layout.counter->invalidate(); - s->invalidate( 0 ); + s->m_layout.counter->tqinvalidate(); + s->tqinvalidate( 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->alignment() == TQt::AlignRight ) || ( m_layout.counter->alignment() == TQt::AlignAuto ))) + (( m_layout.counter->tqalignment() == TQt::AlignRight ) || ( m_layout.counter->tqalignment() == TQt::AlignAuto ))) cw = counterWidth(); return zh->ptToLayoutUnitPixX( m_layout.margins[ TQStyleSheetItem::MarginRight ] + m_layout.rightBorder.width() ) - + cw; /* in layout units already */ + + cw; /* in tqlayout 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.unicode() == 0xad ); + flush = flush || ( chr->c.tqunicode() == 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 ((alignment() & TQt::AlignJustify) == TQt::AlignJustify ) + if ((tqalignment() & 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 ].unicode() == 0xad ) + if ( str[ (int)str.length() - 1 ].tqunicode() == 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 ].unicode() != 0xad ) { + if ( str[ start ] != '\t' && str[ start ].tqunicode() != 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.unicode() == 0xad; + bool drawHyphen = at( start+len-1 )->c.tqunicode() == 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 layout & format of previous paragraph + // No "following style" setting, or same style -> copy tqlayout & 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 layout will create them + // applying the parag tqlayout will create them } void KoTextParag::setTabList( const KoTabulatorList &tabList ) @@ -2104,7 +2104,7 @@ void KoTextParag::setTabList( const KoTabulatorList &tabList ) { setTabArray( 0 ); } - invalidate( 0 ); + tqinvalidate( 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 & layout, int flags, int marginIndex ) +void KoTextParag::setParagLayout( const KoParagLayout & tqlayout, int flags, int marginIndex ) { //kdDebug(32500) << "KoTextParag::setParagLayout flags=" << flags << endl; if ( flags & KoParagLayout::Alignment ) - setAlign( layout.alignment ); + setAlign( tqlayout.tqalignment ); if ( flags & KoParagLayout::Margins ) { if ( marginIndex == -1 ) - setMargins( layout.margins ); + setMargins( tqlayout.margins ); else - setMargin( (TQStyleSheetItem::Margin)marginIndex, layout.margins[marginIndex] ); + setMargin( (TQStyleSheetItem::Margin)marginIndex, tqlayout.margins[marginIndex] ); } if ( flags & KoParagLayout::LineSpacing ) { - setLineSpacingType( layout.lineSpacingType ); - setLineSpacing( layout.lineSpacingValue() ); + setLineSpacingType( tqlayout.lineSpacingType ); + setLineSpacing( tqlayout.lineSpacingValue() ); } if ( flags & KoParagLayout::Borders ) { - setLeftBorder( layout.leftBorder ); - setRightBorder( layout.rightBorder ); - setTopBorder( layout.topBorder ); - setBottomBorder( layout.bottomBorder ); - setJoinBorder( layout.joinBorder ); + setLeftBorder( tqlayout.leftBorder ); + setRightBorder( tqlayout.rightBorder ); + setTopBorder( tqlayout.topBorder ); + setBottomBorder( tqlayout.bottomBorder ); + setJoinBorder( tqlayout.joinBorder ); } if ( flags & KoParagLayout::BackgroundColor ) { - setBackgroundColor( layout.backgroundColor ); + setBackgroundColor( tqlayout.backgroundColor ); } if ( flags & KoParagLayout::BulletNumber ) - setCounter( layout.counter ); + setCounter( tqlayout.counter ); if ( flags & KoParagLayout::Tabulator ) - setTabList( layout.tabList() ); + setTabList( tqlayout.tabList() ); if ( flags == KoParagLayout::All ) { - setDirection( static_cast<TQChar::Direction>(layout.direction) ); + setDirection( static_cast<TQChar::Direction>(tqlayout.direction) ); // Don't call applyStyle from here, it would overwrite any paragraph-specific settings - setStyle( layout.style ); + setStyle( tqlayout.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 - invalidate( 0 ); + tqinvalidate( 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[alignment()] << " resolveAlignment: " << s_align[resolveAlignment()] + kdDebug(32500) << " align: " << s_align[tqalignment()] << " 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.unicode() ).rightJustify(3) << ")" + << "' (" << TQString::number( ch.c.tqunicode() ).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 layout; + KoParagLayout tqlayout; // 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); - layout.style = style; + tqlayout.style = style; } - KoParagLayout::loadOasisParagLayout( layout, context ); + KoParagLayout::loadOasisParagLayout( tqlayout, context ); - return layout; + return tqlayout; } void KoTextParag::loadOasis( const TQDomElement& parent, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ) { - // First load layout from style + // First load tqlayout 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 ); - invalidate( 0 ); + tqinvalidate( 0 ); } void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context, @@ -2915,7 +2915,7 @@ void KoTextParag::saveOasis( KoXmlWriter& writer, KoSavingContext& context, { KoGenStyles& mainStyles = context.mainStyles(); - // Write paraglayout to styles (with parent == the parag's style) + // Write paragtqlayout 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-layout info (for word-processing at least) + // First paragraph is special, it includes page-tqlayout 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 layout, so the first parag always points to "Standard". + // Well we support only one page tqlayout, 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.unicode() == 0x00a0U) + if ( (ch.c == ' ' || ch.c.tqunicode() == 0x00a0U) && (whichFormattingChars & FormattingSpace)) { // Don't use ch.pixelwidth here. We want a square with |