From c9cb4f487428aad5d8cda5e3a4b9ad87390d7e54 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 16 Dec 2011 09:56:31 -0600 Subject: Revert "Rename a number of old tq methods that are no longer tq specific" This reverts commit 94844816550ad672ccfcdc25659c625546239998. --- lib/kotext/KoParagLayout.cpp | 366 +++++++++++++++++++++---------------------- 1 file changed, 183 insertions(+), 183 deletions(-) (limited to 'lib/kotext/KoParagLayout.cpp') diff --git a/lib/kotext/KoParagLayout.cpp b/lib/kotext/KoParagLayout.cpp index 37fbbfb5..fd1a9453 100644 --- a/lib/kotext/KoParagLayout.cpp +++ b/lib/kotext/KoParagLayout.cpp @@ -44,72 +44,72 @@ KoParagLayout::KoParagLayout() initialise(); } -void KoParagLayout::operator=( const KoParagLayout &layout ) +void KoParagLayout::operator=( const KoParagLayout &tqlayout ) { - alignment = layout.alignment; + tqalignment = tqlayout.tqalignment; for ( int i = 0 ; i < 5 ; ++i ) - margins[i] = layout.margins[i]; - pageBreaking = layout.pageBreaking; - leftBorder = layout.leftBorder; - rightBorder = layout.rightBorder; - topBorder = layout.topBorder; - bottomBorder = layout.bottomBorder; - joinBorder = layout.joinBorder; - backgroundColor = layout.backgroundColor; - if ( layout.counter ) - counter = new KoParagCounter( *layout.counter ); + margins[i] = tqlayout.margins[i]; + pageBreaking = tqlayout.pageBreaking; + leftBorder = tqlayout.leftBorder; + rightBorder = tqlayout.rightBorder; + topBorder = tqlayout.topBorder; + bottomBorder = tqlayout.bottomBorder; + joinBorder = tqlayout.joinBorder; + backgroundColor = tqlayout.backgroundColor; + if ( tqlayout.counter ) + counter = new KoParagCounter( *tqlayout.counter ); else counter = 0L; - lineSpacing = layout.lineSpacing; - lineSpacingType = layout.lineSpacingType; - style = layout.style; - direction = layout.direction; - setTabList( layout.tabList() ); + lineSpacing = tqlayout.lineSpacing; + lineSpacingType = tqlayout.lineSpacingType; + style = tqlayout.style; + direction = tqlayout.direction; + setTabList( tqlayout.tabList() ); } -int KoParagLayout::compare( const KoParagLayout & layout ) const +int KoParagLayout::compare( const KoParagLayout & tqlayout ) const { int flags = 0; - if ( alignment != layout.alignment ) + if ( tqalignment != tqlayout.tqalignment ) flags |= Alignment; for ( int i = 0 ; i < 5 ; ++i ) - if ( margins[i] != layout.margins[i] ) + if ( margins[i] != tqlayout.margins[i] ) { flags |= Margins; break; } - if ( pageBreaking != layout.pageBreaking ) + if ( pageBreaking != tqlayout.pageBreaking ) flags |= PageBreaking; - if ( leftBorder != layout.leftBorder - || rightBorder != layout.rightBorder - || topBorder != layout.topBorder - || bottomBorder != layout.bottomBorder - || joinBorder != layout.joinBorder ) + if ( leftBorder != tqlayout.leftBorder + || rightBorder != tqlayout.rightBorder + || topBorder != tqlayout.topBorder + || bottomBorder != tqlayout.bottomBorder + || joinBorder != tqlayout.joinBorder ) flags |= Borders; - if ( layout.counter ) + if ( tqlayout.counter ) { if ( counter ) { - if ( ! ( *layout.counter == *counter ) ) + if ( ! ( *tqlayout.counter == *counter ) ) flags |= BulletNumber; } else - if ( layout.counter->numbering() != KoParagCounter::NUM_NONE ) + if ( tqlayout.counter->numbering() != KoParagCounter::NUM_NONE ) flags |= BulletNumber; } else if ( counter && counter->numbering() != KoParagCounter::NUM_NONE ) flags |= BulletNumber; - if ( lineSpacing != layout.lineSpacing - || lineSpacingType != layout.lineSpacingType ) + if ( lineSpacing != tqlayout.lineSpacing + || lineSpacingType != tqlayout.lineSpacingType ) flags |= LineSpacing; - //if ( style != layout.style ) + //if ( style != tqlayout.style ) // flags |= Style; - if ( m_tabList != layout.m_tabList ) + if ( m_tabList != tqlayout.m_tabList ) flags |= Tabulator; - if ( backgroundColor != layout.backgroundColor) + if ( backgroundColor != tqlayout.backgroundColor) flags |= BackgroundColor; // This method is used for the GUI stuff only, so we don't have a flag @@ -119,7 +119,7 @@ int KoParagLayout::compare( const KoParagLayout & layout ) const void KoParagLayout::initialise() { - alignment = TQt::AlignAuto; + tqalignment = TQt::AlignAuto; for ( int i = 0 ; i < 5 ; ++i ) // use memset ? margins[i] = 0; lineSpacingType = LS_SINGLE; @@ -141,13 +141,13 @@ KoParagLayout::~KoParagLayout() delete counter; } -void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& parentElem, int docVersion ) +void KoParagLayout::loadParagLayout( KoParagLayout& tqlayout, const TQDomElement& parentElem, int docVersion ) { - // layout is an input and output parameter + // tqlayout is an input and output parameter // It can have been initialized already, e.g. by copying from a style // (we don't do that anymore though). - // Load the paragraph tabs - we load into a clean list, not mixing with those already in "layout" + // Load the paragraph tabs - we load into a clean list, not mixing with those already in "tqlayout" // We can't apply the 'default comes from the style' in this case, because // there is no way to differentiate between "I want no tabs in the parag" // and "use default from style". @@ -171,15 +171,15 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& } } qHeapSort( tabList ); - layout.setTabList( tabList ); - layout.alignment = TQt::AlignAuto; - element = parentElem.namedItem( "FLOW" ).toElement(); // Flow is what is now called alignment internally + tqlayout.setTabList( tabList ); + tqlayout.tqalignment = TQt::AlignAuto; + element = parentElem.namedItem( "FLOW" ).toElement(); // Flow is what is now called tqalignment internally if ( !element.isNull() ) { TQString flow = element.attribute( "align" ); // KWord-1.0 DTD if ( !flow.isEmpty() ) { - layout.alignment = flow=="right" ? TQt::AlignRight : + tqlayout.tqalignment = flow=="right" ? TQt::AlignRight : flow=="center" ? TQt::AlignHCenter : flow=="justify" ? TQt::AlignJustify : flow=="left" ? TQt::AlignLeft : TQt::AlignAuto; @@ -187,9 +187,9 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& TQString dir = element.attribute( "dir" ); // KWord-1.2 if ( !dir.isEmpty() ) { if ( dir == "L" ) - layout.direction = TQChar::DirL; + tqlayout.direction = TQChar::DirL; else if ( dir == "R" ) - layout.direction = TQChar::DirR; + tqlayout.direction = TQChar::DirR; else kdWarning() << "Unexpected value for paragraph direction: " << dir << endl; } @@ -197,7 +197,7 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& flow = element.attribute( "value" ); // KWord-0.8 static const int flow2align[] = { TQt::AlignAuto, TQt::AlignRight, TQt::AlignHCenter, TQt::AlignJustify }; if ( !flow.isEmpty() && flow.toInt() < 4 ) - layout.alignment = flow2align[flow.toInt()]; + tqlayout.tqalignment = flow2align[flow.toInt()]; } } @@ -205,34 +205,34 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& { element = parentElem.namedItem( "OHEAD" ).toElement(); // used by KWord-0.8 if ( !element.isNull() ) - layout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "pt", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "pt", 0.0 ); element = parentElem.namedItem( "OFOOT" ).toElement(); // used by KWord-0.8 if ( !element.isNull() ) - layout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "pt", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "pt", 0.0 ); element = parentElem.namedItem( "IFIRST" ).toElement(); // used by KWord-0.8 if ( !element.isNull() ) - layout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "pt", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "pt", 0.0 ); element = parentElem.namedItem( "ILEFT" ).toElement(); // used by KWord-0.8 if ( !element.isNull() ) - layout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "pt", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "pt", 0.0 ); } // KWord-1.0 DTD element = parentElem.namedItem( "INDENTS" ).toElement(); if ( !element.isNull() ) { - layout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "first", 0.0 ); - layout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "left", 0.0 ); - layout.margins[TQStyleSheetItem::MarginRight] = getAttribute( element, "right", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = getAttribute( element, "first", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginLeft] = getAttribute( element, "left", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginRight] = getAttribute( element, "right", 0.0 ); } element = parentElem.namedItem( "OFFSETS" ).toElement(); if ( !element.isNull() ) { - layout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "before", 0.0 ); - layout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "after", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginTop] = getAttribute( element, "before", 0.0 ); + tqlayout.margins[TQStyleSheetItem::MarginBottom] = getAttribute( element, "after", 0.0 ); } if ( docVersion < 2 ) @@ -240,8 +240,8 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& element = parentElem.namedItem( "LINESPACE" ).toElement(); // used by KWord-0.8 if ( !element.isNull() ) { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.lineSpacing = getAttribute( element, "pt", 0.0 ); + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.lineSpacing = getAttribute( element, "pt", 0.0 ); } } @@ -254,18 +254,18 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& TQString value = element.attribute( "value" ); if ( value == "oneandhalf" ) { - layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - layout.lineSpacing = 0; + tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + tqlayout.lineSpacing = 0; } else if ( value == "double" ) { - layout.lineSpacingType = KoParagLayout::LS_DOUBLE; - layout.lineSpacing = 0; + tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; + tqlayout.lineSpacing = 0; } else { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.lineSpacing = value.toDouble(); + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.lineSpacing = value.toDouble(); } } else @@ -273,36 +273,36 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& TQString type = element.attribute( "type" ); if ( type == "oneandhalf" ) { - layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; - layout.lineSpacing = 0; + tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + tqlayout.lineSpacing = 0; } else if ( type == "double" ) { - layout.lineSpacingType = KoParagLayout::LS_DOUBLE; - layout.lineSpacing = 0; + tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; + tqlayout.lineSpacing = 0; } else if ( type == "custom" ) { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); } else if ( type == "atleast" ) { - layout.lineSpacingType = KoParagLayout::LS_AT_LEAST; - layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); + tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST; + tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); } else if ( type == "multiple" ) { - layout.lineSpacingType = KoParagLayout::LS_MULTIPLE; - layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); + tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE; + tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); } else if ( type == "fixed" ) { - layout.lineSpacingType = KoParagLayout::LS_FIXED; - layout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); + tqlayout.lineSpacingType = KoParagLayout::LS_FIXED; + tqlayout.lineSpacing = element.attribute( "spacingvalue" ).toDouble(); } else if ( type == "single" ) // not used; just in case future versions use it. - layout.lineSpacingType = KoParagLayout::LS_SINGLE; + tqlayout.lineSpacingType = KoParagLayout::LS_SINGLE; } } @@ -323,37 +323,37 @@ void KoParagLayout::loadParagLayout( KoParagLayout& layout, const TQDomElement& if ( !element.isNull() ) pageBreaking |= KoParagLayout::HardFrameBreakBefore; } - layout.pageBreaking = pageBreaking; + tqlayout.pageBreaking = pageBreaking; element = parentElem.namedItem( "LEFTBORDER" ).toElement(); if ( !element.isNull() ) - layout.leftBorder = KoBorder::loadBorder( element ); + tqlayout.leftBorder = KoBorder::loadBorder( element ); else - layout.leftBorder.setPenWidth(0); + tqlayout.leftBorder.setPenWidth(0); element = parentElem.namedItem( "RIGHTBORDER" ).toElement(); if ( !element.isNull() ) - layout.rightBorder = KoBorder::loadBorder( element ); + tqlayout.rightBorder = KoBorder::loadBorder( element ); else - layout.rightBorder.setPenWidth(0); + tqlayout.rightBorder.setPenWidth(0); element = parentElem.namedItem( "TOPBORDER" ).toElement(); if ( !element.isNull() ) - layout.topBorder = KoBorder::loadBorder( element ); + tqlayout.topBorder = KoBorder::loadBorder( element ); else - layout.topBorder.setPenWidth(0); + tqlayout.topBorder.setPenWidth(0); element = parentElem.namedItem( "BOTTOMBORDER" ).toElement(); if ( !element.isNull() ) - layout.bottomBorder = KoBorder::loadBorder( element ); + tqlayout.bottomBorder = KoBorder::loadBorder( element ); else - layout.bottomBorder.setPenWidth(0); + tqlayout.bottomBorder.setPenWidth(0); element = parentElem.namedItem( "COUNTER" ).toElement(); if ( !element.isNull() ) { - layout.counter = new KoParagCounter; - layout.counter->load( element ); + tqlayout.counter = new KoParagCounter; + tqlayout.counter->load( element ); } // Compatibility with KOffice-1.2 @@ -425,38 +425,38 @@ TQt::AlignmentFlags KoParagLayout::loadOasisAlignment( const TQCString& str ) } //static -TQCString KoParagLayout::saveOasisAlignment( TQt::AlignmentFlags alignment ) +TQCString KoParagLayout::saveOasisAlignment( TQt::AlignmentFlags tqalignment ) { - return alignment == TQt::AlignLeft ? "left" : - alignment == TQt::AlignRight ? "right" : - alignment == TQt::AlignHCenter ? "center" : - alignment == TQt::AlignJustify ? "justify" : + return tqalignment == TQt::AlignLeft ? "left" : + tqalignment == TQt::AlignRight ? "right" : + tqalignment == TQt::AlignHCenter ? "center" : + tqalignment == TQt::AlignJustify ? "justify" : "start"; // i.e. direction-dependent } -void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& context ) +void KoParagLayout::loadOasisParagLayout( KoParagLayout& tqlayout, KoOasisContext& context ) { context.styleStack().setTypeProperties( "paragraph" ); - // layout is an input and output parameter + // tqlayout is an input and output parameter // It can have been initialized already, e.g. by copying from a style // code from OoWriterImport::writeLayout if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "text-align" ) ) { TQCString align = context.styleStack().attributeNS( KoXmlNS::fo, "text-align" ).latin1(); - layout.alignment = loadOasisAlignment( align ); + tqlayout.tqalignment = loadOasisAlignment( align ); } if ( context.styleStack().hasAttributeNS( KoXmlNS::style, "writing-mode" ) ) { // http://web4.w3.org/TR/xsl/slice7.html#writing-mode // LTR is lr-tb. RTL is rl-tb TQString writingMode = context.styleStack().attributeNS( KoXmlNS::style, "writing-mode" ); - layout.direction = ( writingMode=="rl-tb" || writingMode=="rl" ) ? TQChar::DirR : TQChar::DirL; + tqlayout.direction = ( writingMode=="rl-tb" || writingMode=="rl" ) ? TQChar::DirR : TQChar::DirL; } // Indentation (margins) if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-left" ) || // 3.11.19 context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-right" ) ) { - layout.margins[TQStyleSheetItem::MarginLeft] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-left" ) ); - layout.margins[TQStyleSheetItem::MarginRight] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-right" ) ); + tqlayout.margins[TQStyleSheetItem::MarginLeft] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-left" ) ); + tqlayout.margins[TQStyleSheetItem::MarginRight] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-right" ) ); // *text-indent must always be bound to either margin-left or margin-right double first = 0; if ( context.styleStack().attributeNS( KoXmlNS::style, "auto-text-indent") == "true" ) // style:auto-text-indent takes precedence @@ -467,14 +467,14 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& else if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "text-indent") ) first = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "text-indent") ); - layout.margins[TQStyleSheetItem::MarginFirstLine] = first; + tqlayout.margins[TQStyleSheetItem::MarginFirstLine] = first; } // Offset before and after paragraph if( context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-top") || // 3.11.22 context.styleStack().hasAttributeNS( KoXmlNS::fo, "margin-bottom")) { - layout.margins[TQStyleSheetItem::MarginTop] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-top" ) ); - layout.margins[TQStyleSheetItem::MarginBottom] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-bottom" ) ); + tqlayout.margins[TQStyleSheetItem::MarginTop] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-top" ) ); + tqlayout.margins[TQStyleSheetItem::MarginBottom] = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::fo, "margin-bottom" ) ); } // Line spacing @@ -483,23 +483,23 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& TQString value = context.styleStack().attributeNS( KoXmlNS::fo, "line-height" ); if ( value != "normal" ) { if ( value == "100%" ) - layout.lineSpacingType = KoParagLayout::LS_SINGLE; + tqlayout.lineSpacingType = KoParagLayout::LS_SINGLE; else if( value=="150%") - layout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; + tqlayout.lineSpacingType = KoParagLayout::LS_ONEANDHALF; else if( value=="200%") - layout.lineSpacingType = KoParagLayout::LS_DOUBLE; + tqlayout.lineSpacingType = KoParagLayout::LS_DOUBLE; else if ( value.find('%') > -1 ) { value = value.remove( '%' ); double percent = value.toDouble(); - layout.lineSpacingType = KoParagLayout::LS_MULTIPLE; - layout.lineSpacing = percent / 100.0; - kdDebug(33001) << "line-height =" << percent << ", " << layout.lineSpacing << ", " << percent/100 << endl; + tqlayout.lineSpacingType = KoParagLayout::LS_MULTIPLE; + tqlayout.lineSpacing = percent / 100.0; + kdDebug(33001) << "line-height =" << percent << ", " << tqlayout.lineSpacing << ", " << percent/100 << endl; } else // fixed value { - layout.lineSpacingType = KoParagLayout::LS_FIXED; - layout.lineSpacing = KoUnit::parseValue( value ); + tqlayout.lineSpacingType = KoParagLayout::LS_FIXED; + tqlayout.lineSpacing = KoUnit::parseValue( value ); } } } @@ -512,8 +512,8 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& // Did we make the wrong choice in kotext? //kdWarning() << "Unimplemented support for style:line-height-at-least: " << value << endl; // Well let's see if this makes a big difference. - layout.lineSpacingType = KoParagLayout::LS_AT_LEAST; - layout.lineSpacing = KoUnit::parseValue( value ); + tqlayout.lineSpacingType = KoParagLayout::LS_AT_LEAST; + tqlayout.lineSpacing = KoUnit::parseValue( value ); } // Line-spacing is mutually exclusive with line-height and line-height-at-least else if ( context.styleStack().hasAttributeNS( KoXmlNS::style, "line-spacing") ) // 3.11.3 @@ -521,8 +521,8 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& double value = KoUnit::parseValue( context.styleStack().attributeNS( KoXmlNS::style, "line-spacing" ) ); if ( value != 0.0 ) { - layout.lineSpacingType = KoParagLayout::LS_CUSTOM; - layout.lineSpacing = value; + tqlayout.lineSpacingType = KoParagLayout::LS_CUSTOM; + tqlayout.lineSpacing = value; } } @@ -530,7 +530,7 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& KoTabulatorList tabList; if ( context.styleStack().hasChildNodeNS( KoXmlNS::style, "tab-stops" ) ) { // 3.11.10 TQDomElement tabStops = context.styleStack().childNodeNS( KoXmlNS::style, "tab-stops" ); - //kdDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in layout." << endl; + //kdDebug(30519) << k_funcinfo << tabStops.childNodes().count() << " tab stops in tqlayout." << endl; TQDomElement tabStop; forEachElement( tabStop, tabStops ) { @@ -540,7 +540,7 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& KoTabulator tab; tab.ptPos = KoUnit::parseValue( tabStop.attributeNS( KoXmlNS::style, "position", TQString() ) ); // Tab stop positions in the XML are relative to the left-margin - tab.ptPos += layout.margins[TQStyleSheetItem::MarginLeft]; + tab.ptPos += tqlayout.margins[TQStyleSheetItem::MarginLeft]; if ( type == "center" ) tab.type = T_CENTER; else if ( type == "right" ) @@ -549,7 +549,7 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& TQString delimiterChar = tabStop.attributeNS( KoXmlNS::style, "char", TQString() ); // single character if ( !delimiterChar.isEmpty() ) tab.alignChar = delimiterChar[0]; - tab.type = T_DEC_PNT; // "alignment on decimal point" + tab.type = T_DEC_PNT; // "tqalignment on decimal point" } else //if ( type == "left" ) tab.type = T_LEFT; @@ -573,7 +573,7 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& } else { - // Fallback: convert leaderChar's unicode value + // Fallback: convert leaderChar's tqunicode value TQString leaderChar = tabStop.attributeNS( KoXmlNS::style, "leader-text", TQString() ); if ( !leaderChar.isEmpty() ) { @@ -594,27 +594,27 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& } //for } qHeapSort( tabList ); - layout.setTabList( tabList ); + tqlayout.setTabList( tabList ); - layout.joinBorder = !( context.styleStack().attributeNS( KoXmlNS::style, "join-border") == "false" ); + tqlayout.joinBorder = !( context.styleStack().attributeNS( KoXmlNS::style, "join-border") == "false" ); // Borders if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","left") ) - layout.leftBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","left") ); + tqlayout.leftBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","left") ); else - layout.leftBorder.setPenWidth(0); + tqlayout.leftBorder.setPenWidth(0); if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","right") ) - layout.rightBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","right") ); + tqlayout.rightBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","right") ); else - layout.rightBorder.setPenWidth(0); + tqlayout.rightBorder.setPenWidth(0); if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","top") ) - layout.topBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","top") ); + tqlayout.topBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","top") ); else - layout.topBorder.setPenWidth(0); + tqlayout.topBorder.setPenWidth(0); if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "border","bottom") ) - layout.bottomBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","bottom") ); + tqlayout.bottomBorder.loadFoBorder( context.styleStack().attributeNS( KoXmlNS::fo, "border","bottom") ); else - layout.bottomBorder.setPenWidth(0); + tqlayout.bottomBorder.setPenWidth(0); // Page breaking @@ -647,148 +647,148 @@ void KoParagLayout::loadOasisParagLayout( KoParagLayout& layout, KoOasisContext& pageBreaking |= KoParagLayout::KeepWithNext; } } - layout.pageBreaking = pageBreaking; + tqlayout.pageBreaking = pageBreaking; // Paragraph background color - fo:background-color // The background color for parts of a paragraph that have no text underneath if ( context.styleStack().hasAttributeNS( KoXmlNS::fo, "background-color" ) ) { TQString bgColor = context.styleStack().attributeNS( KoXmlNS::fo, "background-color"); if (bgColor != "transparent") - layout.backgroundColor.setNamedColor( bgColor ); + tqlayout.backgroundColor.setNamedColor( bgColor ); } } -void KoParagLayout::saveParagLayout( TQDomElement & parentElem, int alignment ) const +void KoParagLayout::saveParagLayout( TQDomElement & parentElem, int tqalignment ) const { - const KoParagLayout& layout = *this; // code moved from somewhere else;) + const KoParagLayout& tqlayout = *this; // code moved from somewhere else;) TQDomDocument doc = parentElem.ownerDocument(); TQDomElement element = doc.createElement( "NAME" ); parentElem.appendChild( element ); - if ( layout.style ) - element.setAttribute( "value", layout.style->displayName() ); + if ( tqlayout.style ) + element.setAttribute( "value", tqlayout.style->displayName() ); //else // kdWarning() << "KoParagLayout::saveParagLayout: style==0!" << endl; element = doc.createElement( "FLOW" ); parentElem.appendChild( element ); - element.setAttribute( "align", alignment==TQt::AlignRight ? "right" : - alignment==TQt::AlignHCenter ? "center" : - alignment==TQt::AlignJustify ? "justify" : - alignment==TQt::AlignAuto ? "auto" : "left" ); // Note: styles can have AlignAuto. Not paragraphs. + element.setAttribute( "align", tqalignment==TQt::AlignRight ? "right" : + tqalignment==TQt::AlignHCenter ? "center" : + tqalignment==TQt::AlignJustify ? "justify" : + tqalignment==TQt::AlignAuto ? "auto" : "left" ); // Note: styles can have AlignAuto. Not paragraphs. - if ( static_cast(layout.direction) == TQChar::DirR ) + if ( static_cast(tqlayout.direction) == TQChar::DirR ) element.setAttribute( "dir", "R" ); else - if ( static_cast(layout.direction) == TQChar::DirL ) + if ( static_cast(tqlayout.direction) == TQChar::DirL ) element.setAttribute( "dir", "L" ); - if ( layout.margins[TQStyleSheetItem::MarginFirstLine] != 0 || - layout.margins[TQStyleSheetItem::MarginLeft] != 0 || - layout.margins[TQStyleSheetItem::MarginRight] != 0 ) + if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 ) { element = doc.createElement( "INDENTS" ); parentElem.appendChild( element ); - if ( layout.margins[TQStyleSheetItem::MarginFirstLine] != 0 ) - element.setAttribute( "first", layout.margins[TQStyleSheetItem::MarginFirstLine] ); - if ( layout.margins[TQStyleSheetItem::MarginLeft] != 0 ) - element.setAttribute( "left", layout.margins[TQStyleSheetItem::MarginLeft] ); - if ( layout.margins[TQStyleSheetItem::MarginRight] != 0 ) - element.setAttribute( "right", layout.margins[TQStyleSheetItem::MarginRight] ); + if ( tqlayout.margins[TQStyleSheetItem::MarginFirstLine] != 0 ) + element.setAttribute( "first", tqlayout.margins[TQStyleSheetItem::MarginFirstLine] ); + if ( tqlayout.margins[TQStyleSheetItem::MarginLeft] != 0 ) + element.setAttribute( "left", tqlayout.margins[TQStyleSheetItem::MarginLeft] ); + if ( tqlayout.margins[TQStyleSheetItem::MarginRight] != 0 ) + element.setAttribute( "right", tqlayout.margins[TQStyleSheetItem::MarginRight] ); } - if ( layout.margins[TQStyleSheetItem::MarginTop] != 0 || - layout.margins[TQStyleSheetItem::MarginBottom] != 0 ) + if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 || + tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 ) { element = doc.createElement( "OFFSETS" ); parentElem.appendChild( element ); - if ( layout.margins[TQStyleSheetItem::MarginTop] != 0 ) - element.setAttribute( "before", layout.margins[TQStyleSheetItem::MarginTop] ); - if ( layout.margins[TQStyleSheetItem::MarginBottom] != 0 ) - element.setAttribute( "after", layout.margins[TQStyleSheetItem::MarginBottom] ); + if ( tqlayout.margins[TQStyleSheetItem::MarginTop] != 0 ) + element.setAttribute( "before", tqlayout.margins[TQStyleSheetItem::MarginTop] ); + if ( tqlayout.margins[TQStyleSheetItem::MarginBottom] != 0 ) + element.setAttribute( "after", tqlayout.margins[TQStyleSheetItem::MarginBottom] ); } - if ( layout.lineSpacingType != LS_SINGLE ) + if ( tqlayout.lineSpacingType != LS_SINGLE ) { element = doc.createElement( "LINESPACING" ); parentElem.appendChild( element ); - if ( layout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) { + if ( tqlayout.lineSpacingType == KoParagLayout::LS_ONEANDHALF ) { element.setAttribute( "type", "oneandhalf" ); element.setAttribute( "value", "oneandhalf" ); //compatibility with koffice 1.2 } - else if ( layout.lineSpacingType == KoParagLayout::LS_DOUBLE ) { + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_DOUBLE ) { element.setAttribute( "type", "double" ); element.setAttribute( "value", "double" ); //compatibility with koffice 1.2 } - else if ( layout.lineSpacingType == KoParagLayout::LS_CUSTOM ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_CUSTOM ) { element.setAttribute( "type", "custom" ); - element.setAttribute( "spacingvalue", layout.lineSpacing); - element.setAttribute( "value", layout.lineSpacing ); //compatibility with koffice 1.2 + element.setAttribute( "spacingvalue", tqlayout.lineSpacing); + element.setAttribute( "value", tqlayout.lineSpacing ); //compatibility with koffice 1.2 } - else if ( layout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_AT_LEAST ) { element.setAttribute( "type", "atleast" ); - element.setAttribute( "spacingvalue", layout.lineSpacing); + element.setAttribute( "spacingvalue", tqlayout.lineSpacing); } - else if ( layout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_MULTIPLE ) { element.setAttribute( "type", "multiple" ); - element.setAttribute( "spacingvalue", layout.lineSpacing); + element.setAttribute( "spacingvalue", tqlayout.lineSpacing); } - else if ( layout.lineSpacingType == KoParagLayout::LS_FIXED ) + else if ( tqlayout.lineSpacingType == KoParagLayout::LS_FIXED ) { element.setAttribute( "type", "fixed" ); - element.setAttribute( "spacingvalue", layout.lineSpacing); + element.setAttribute( "spacingvalue", tqlayout.lineSpacing); } else kdDebug()<<" error in lineSpacing Type\n"; } - if ( layout.pageBreaking != 0 ) + if ( tqlayout.pageBreaking != 0 ) { element = doc.createElement( "PAGEBREAKING" ); parentElem.appendChild( element ); - if ( layout.pageBreaking & KoParagLayout::KeepLinesTogether ) + if ( tqlayout.pageBreaking & KoParagLayout::KeepLinesTogether ) element.setAttribute( "linesTogether", "true" ); - if ( layout.pageBreaking & KoParagLayout::HardFrameBreakBefore ) + if ( tqlayout.pageBreaking & KoParagLayout::HardFrameBreakBefore ) element.setAttribute( "hardFrameBreak", "true" ); - if ( layout.pageBreaking & KoParagLayout::HardFrameBreakAfter ) + if ( tqlayout.pageBreaking & KoParagLayout::HardFrameBreakAfter ) element.setAttribute( "hardFrameBreakAfter", "true" ); } - if ( layout.leftBorder.penWidth() > 0 ) + if ( tqlayout.leftBorder.penWidth() > 0 ) { element = doc.createElement( "LEFTBORDER" ); parentElem.appendChild( element ); - layout.leftBorder.save( element ); + tqlayout.leftBorder.save( element ); } - if ( layout.rightBorder.penWidth() > 0 ) + if ( tqlayout.rightBorder.penWidth() > 0 ) { element = doc.createElement( "RIGHTBORDER" ); parentElem.appendChild( element ); - layout.rightBorder.save( element ); + tqlayout.rightBorder.save( element ); } - if ( layout.topBorder.penWidth() > 0 ) + if ( tqlayout.topBorder.penWidth() > 0 ) { element = doc.createElement( "TOPBORDER" ); parentElem.appendChild( element ); - layout.topBorder.save( element ); + tqlayout.topBorder.save( element ); } - if ( layout.bottomBorder.penWidth() > 0 ) + if ( tqlayout.bottomBorder.penWidth() > 0 ) { element = doc.createElement( "BOTTOMBORDER" ); parentElem.appendChild( element ); - layout.bottomBorder.save( element ); + tqlayout.bottomBorder.save( element ); } - if ( layout.counter && layout.counter->numbering() != KoParagCounter::NUM_NONE ) + if ( tqlayout.counter && tqlayout.counter->numbering() != KoParagCounter::NUM_NONE ) { element = doc.createElement( "COUNTER" ); parentElem.appendChild( element ); - if ( layout.counter ) - layout.counter->save( element ); + if ( tqlayout.counter ) + tqlayout.counter->save( element ); } - KoTabulatorList tabList = layout.tabList(); + KoTabulatorList tabList = tqlayout.tabList(); KoTabulatorList::ConstIterator it = tabList.begin(); for ( ; it != tabList.end() ; it++ ) { @@ -806,7 +806,7 @@ void KoParagLayout::saveParagLayout( TQDomElement & parentElem, int alignment ) void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool savingStyle ) const { - gs.addProperty( "fo:text-align", saveOasisAlignment( (TQt::AlignmentFlags)alignment ).data() ); + gs.addProperty( "fo:text-align", saveOasisAlignment( (TQt::AlignmentFlags)tqalignment ).data() ); // Don't save the direction for a style, if "auto", so that the // auto-determination of direction based on first char, works. if ( !savingStyle || (TQChar::Direction) direction != TQChar::DirON ) @@ -863,7 +863,7 @@ void KoParagLayout::saveOasis( KoGenStyle& gs, KoSavingContext& context, bool sa case T_RIGHT: tabsWriter.addAttribute( "style:type", "right" ); break; - case T_DEC_PNT: // "alignment on decimal point" + case T_DEC_PNT: // "tqalignment on decimal point" tabsWriter.addAttribute( "style:type", "char" ); if ( !(*it).alignChar.isNull() ) tabsWriter.addAttribute( "style:char", TQString( (*it).alignChar ) ); -- cgit v1.2.1