diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kword/KWTextParag.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kword/KWTextParag.cpp')
-rw-r--r-- | kword/KWTextParag.cpp | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/kword/KWTextParag.cpp b/kword/KWTextParag.cpp index 152e2f70..f715298d 100644 --- a/kword/KWTextParag.cpp +++ b/kword/KWTextParag.cpp @@ -40,11 +40,11 @@ #undef S_NONE // Solaris defines it in sys/signal.h // Called by KoTextParag::drawParagString - all params are in pixel coordinates -void KWTextParag::drawFormattingChars( QPainter &painter, int start, int len, +void KWTextParag::drawFormattingChars( TQPainter &painter, int start, int len, int lastY_pix, int baseLine_pix, int h_pix, // in pixels bool drawSelections, - KoTextFormat *lastFormat, const QMemArray<int> &selectionStarts, - const QMemArray<int> &selectionEnds, const QColorGroup &cg, + KoTextFormat *lastFormat, const TQMemArray<int> &selectionStarts, + const TQMemArray<int> &selectionEnds, const TQColorGroup &cg, bool rightToLeft, int line, KoTextZoomHandler* zh, int whichFormattingChars ) { @@ -70,27 +70,27 @@ void KWTextParag::drawFormattingChars( QPainter &painter, int start, int len, if ( start + len == length() && (whichFormattingChars & FormattingBreak) && hardFrameBreakAfter() ) { painter.save(); - QPen pen( KGlobalSettings::linkColor() ); // #101820 + TQPen pen( KGlobalSettings::linkColor() ); // #101820 painter.setPen( pen ); //kdDebug() << "KWTextParag::drawFormattingChars start=" << start << " len=" << len << " length=" << length() << endl; // keep in sync with KWTextFrameSet::formatVertically - QString str = i18n( "--- Frame Break ---" ); + TQString str = i18n( "--- Frame Break ---" ); int width = 0; //width = lastFormat->screenStringWidth( zh, str ); width = lastFormat->screenFontMetrics( zh ).width( str ); - QColorGroup cg2( cg ); - //cg2.setColor( QColorGroup::Base, Qt::green ); // for debug + TQColorGroup cg2( cg ); + //cg2.setColor( TQColorGroup::Base, TQt::green ); // for debug int last = length() - 1; KoTextStringChar &ch = string()->at( last ); - int x = zh->layoutUnitToPixelX( ch.x );// + ch.pixelxadj; + int x = zh->tqlayoutUnitToPixelX( ch.x );// + ch.pixelxadj; KoTextFormat format( *lastFormat ); format.setColor( pen.color() ); // ### A bit slow, maybe pass the color to drawParagStringInternal ? KoTextParag::drawParagStringInternal( painter, str, 0, str.length(), x, lastY_pix, // startX and lastY - zh->layoutUnitToPixelY( ch.ascent() ), // baseline - width, zh->layoutUnitToPixelY( ch.height() ), // bw and h + zh->tqlayoutUnitToPixelY( ch.ascent() ), // baseline + width, zh->tqlayoutUnitToPixelY( ch.height() ), // bw and h drawSelections, &format, selectionStarts, selectionEnds, cg2, rightToLeft, line, zh, false ); // Clear 'paint end of line' flag, we don't want it overwriting the above @@ -109,9 +109,9 @@ void KWTextParag::drawFormattingChars( QPainter &painter, int start, int len, void KWTextParag::setPageBreaking( int pb ) { m_layout.pageBreaking = pb; - invalidate(0); + tqinvalidate(0); if ( next() && ( pb & KoParagLayout::HardFrameBreakAfter ) ) - next()->invalidate(0); + next()->tqinvalidate(0); } KWTextDocument * KWTextParag::kwTextDocument() const @@ -120,19 +120,19 @@ KWTextDocument * KWTextParag::kwTextDocument() const } //static -QDomElement KWTextParag::saveFormat( QDomDocument & doc, KoTextFormat * curFormat, KoTextFormat * refFormat, int pos, int len ) +TQDomElement KWTextParag::saveFormat( TQDomDocument & doc, KoTextFormat * curFormat, KoTextFormat * refFormat, int pos, int len ) { //kdDebug() << "KWTextParag::saveFormat refFormat=" << ( refFormat ? refFormat->key() : "none" ) // << " curFormat=" << curFormat->key() // << " pos=" << pos << " len=" << len << endl; - QDomElement formatElem = doc.createElement( "FORMAT" ); + TQDomElement formatElem = doc.createElement( "FORMAT" ); formatElem.setAttribute( "id", 1 ); // text format if ( len ) // 0 when saving the format of a style { formatElem.setAttribute( "pos", pos ); formatElem.setAttribute( "len", len ); } - QDomElement elem; + TQDomElement elem; if( !refFormat || curFormat->font().weight() != refFormat->font().weight() ) { elem = doc.createElement( "WEIGHT" ); @@ -195,7 +195,7 @@ QDomElement KWTextParag::saveFormat( QDomDocument & doc, KoTextFormat * curForma elem.setAttribute( "value", "wave" ); else elem.setAttribute( "value", static_cast<int>(curFormat->underline()) ); - QString strLineType=KoTextFormat::underlineStyleToString( curFormat->underlineStyle() ); + TQString strLineType=KoTextFormat::underlineStyleToString( curFormat->underlineStyle() ); elem.setAttribute( "styleline", strLineType ); if ( curFormat->textUnderlineColor().isValid() ) elem.setAttribute( "underlinecolor", curFormat->textUnderlineColor().name() ); @@ -215,7 +215,7 @@ QDomElement KWTextParag::saveFormat( QDomDocument & doc, KoTextFormat * curForma elem.setAttribute( "value", "single-bold" ); else elem.setAttribute( "value", static_cast<int>(curFormat->strikeOut()) ); - QString strLineType=KoTextFormat::strikeOutStyleToString( curFormat->strikeOutStyle() ); + TQString strLineType=KoTextFormat::strikeOutStyleToString( curFormat->strikeOutStyle() ); elem.setAttribute( "styleline", strLineType ); elem.setAttribute( "wordbyword" , static_cast<int>(curFormat->wordByWord())); } @@ -280,30 +280,30 @@ QDomElement KWTextParag::saveFormat( QDomDocument & doc, KoTextFormat * curForma return formatElem; } -void KWTextParag::save( QDomElement &parentElem, bool saveAnchorsFramesets ) +void KWTextParag::save( TQDomElement &tqparentElem, bool saveAnchorsFramesets ) { - // The QMAX below ensures that although we don't save the trailing space + // The TQMAX below ensures that although we don't save the trailing space // in the normal case, we do save it for empty paragraphs (#30336) - save( parentElem, 0, QMAX( 0, length()-2 ), saveAnchorsFramesets ); + save( tqparentElem, 0, TQMAX( 0, length()-2 ), saveAnchorsFramesets ); } -void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, +void KWTextParag::save( TQDomElement &tqparentElem, int from /* default 0 */, int to /* default length()-2 */, bool saveAnchorsFramesets /* default false */ ) { - QDomDocument doc = parentElem.ownerDocument(); - QDomElement paragElem = doc.createElement( "PARAGRAPH" ); - parentElem.appendChild( paragElem ); - QDomElement textElem = doc.createElement( "TEXT" ); + TQDomDocument doc = tqparentElem.ownerDocument(); + TQDomElement paragElem = doc.createElement( "PARAGRAPH" ); + tqparentElem.appendChild( paragElem ); + TQDomElement textElem = doc.createElement( "TEXT" ); textElem.setAttribute("xml:space", "preserve"); paragElem.appendChild( textElem ); if ( partOfTableOfContents() ) paragElem.setAttribute( "toc", "true" ); - QString text = string()->toString(); + TQString text = string()->toString(); Q_ASSERT( text.right(1)[0] == ' ' ); textElem.appendChild( doc.createTextNode( text.mid( from, to - from + 1 ) ) ); - QDomElement formatsElem = doc.createElement( "FORMATS" ); + TQDomElement formatsElem = doc.createElement( "FORMATS" ); int startPos = -1; int index = 0; // Usually same as 'i' but if from>0, 'i' indexes the parag's text and this one indexes the output KoTextFormat *curFormat = paragraphFormat(); @@ -314,13 +314,13 @@ void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, if ( ch.isCustom() ) { if ( startPos > -1 && curFormat) { // Save former format - QDomElement formatElem = saveFormat( doc, curFormat, + TQDomElement formatElem = saveFormat( doc, curFormat, paragraphFormat(), startPos, index-startPos ); if ( !formatElem.firstChild().isNull() ) // Don't save an empty format tag formatsElem.appendChild( formatElem ); } - QDomElement formatElem = saveFormat( doc, newFormat, paragraphFormat(), index, 1 ); + TQDomElement formatElem = saveFormat( doc, newFormat, paragraphFormat(), index, 1 ); formatsElem.appendChild( formatElem ); KoTextCustomItem* customItem = ch.customItem(); formatElem.setAttribute( "id", customItem->typeId() ); @@ -341,7 +341,7 @@ void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, { // Save inline framesets at the toplevel. Necessary when copying a textframeset that // itself includes an inline frameset - we want all frameset tags at the toplevel. - QDomElement elem = doc.documentElement(); + TQDomElement elem = doc.documentElement(); kdDebug() << " saving into " << elem.tagName() << endl; inlineFs->toXML( elem ); } @@ -353,7 +353,7 @@ void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, { // Format changed. if ( startPos > -1 && curFormat) { // Save former format - QDomElement formatElem = saveFormat( doc, curFormat, paragraphFormat(), startPos, index-startPos ); + TQDomElement formatElem = saveFormat( doc, curFormat, paragraphFormat(), startPos, index-startPos ); if ( !formatElem.firstChild().isNull() ) // Don't save an empty format tag formatsElem.appendChild( formatElem ); } @@ -373,7 +373,7 @@ void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, } } if ( startPos > -1 && index > startPos && curFormat) { // Save last format - QDomElement formatElem = saveFormat( doc, curFormat, paragraphFormat(), startPos, index-startPos ); + TQDomElement formatElem = saveFormat( doc, curFormat, paragraphFormat(), startPos, index-startPos ); if ( !formatElem.firstChild().isNull() ) // Don't save an empty format tag formatsElem.appendChild( formatElem ); } @@ -382,27 +382,27 @@ void KWTextParag::save( QDomElement &parentElem, int from /* default 0 */, paragElem.appendChild( formatsElem ); - QDomElement layoutElem = doc.createElement( "LAYOUT" ); - paragElem.appendChild( layoutElem ); + TQDomElement tqlayoutElem = doc.createElement( "LAYOUT" ); + paragElem.appendChild( tqlayoutElem ); - // save with the real alignment (left or right, not auto) - m_layout.saveParagLayout( layoutElem, resolveAlignment() ); + // save with the real tqalignment (left or right, not auto) + m_layout.saveParagLayout( tqlayoutElem, resolveAlignment() ); // Paragraph's format // ## Maybe we should have a "default format" somewhere and // pass it instead of 0L, to only save the non-default attributes // But this would break all export filters again. - QDomElement paragFormatElement = saveFormat( doc, paragraphFormat(), 0L, 0, to - from + 1 ); - layoutElem.appendChild( paragFormatElement ); + TQDomElement paragFormatElement = saveFormat( doc, paragraphFormat(), 0L, 0, to - from + 1 ); + tqlayoutElem.appendChild( paragFormatElement ); } //static -KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * refFormat, const QFont & defaultFont, const QString & defaultLanguage, bool hyphanation ) +KoTextFormat KWTextParag::loadFormat( TQDomElement &formatElem, KoTextFormat * refFormat, const TQFont & defaultFont, const TQString & defaultLanguage, bool hyphanation ) { KoTextFormat format; //todo fixme !!!!!!!!!!!! format.setHyphenation( hyphanation ); - QFont font; + TQFont font; if ( refFormat ) { format = *refFormat; @@ -414,7 +414,7 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re font = defaultFont; } - QDomElement elem; + TQDomElement elem; elem = formatElem.namedItem( "FONT" ).toElement(); if ( !elem.isNull() ) { @@ -435,7 +435,7 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re font.setItalic( elem.attribute("value").toInt() == 1 ); elem = formatElem.namedItem( "UNDERLINE" ).toElement(); if ( !elem.isNull() ) { - QString value = elem.attribute("value"); + TQString value = elem.attribute("value"); if ( value == "0" || value == "1" ) format.setUnderlineType( (value.toInt() == 1)?KoTextFormat::U_SIMPLE: KoTextFormat::U_NONE ); else if ( value == "single" ) // value never used when saving, but why not support it? ;) @@ -448,12 +448,12 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re format.setUnderlineType ( KoTextFormat::U_WAVE); if ( elem.hasAttribute("styleline" )) { - QString strLineType = elem.attribute("styleline"); + TQString strLineType = elem.attribute("styleline"); format.setUnderlineStyle( KoTextFormat::stringToUnderlineStyle( strLineType )); } if ( elem.hasAttribute("underlinecolor")) { - QColor col( QColor(elem.attribute("underlinecolor"))); + TQColor col( TQColor(elem.attribute("underlinecolor"))); format.setTextUnderlineColor( col ); } if ( elem.hasAttribute( "wordbyword" )) @@ -462,7 +462,7 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re elem = formatElem.namedItem( "STRIKEOUT" ).toElement(); if ( !elem.isNull() ) { - QString value = elem.attribute("value"); + TQString value = elem.attribute("value"); if ( value == "0" || value == "1" ) format.setStrikeOutType( (value.toInt() == 1)?KoTextFormat::S_SIMPLE: KoTextFormat::S_NONE ); else if ( value == "single" ) // value never used when saving, but why not support it? ;) @@ -474,7 +474,7 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re if ( elem.hasAttribute("styleline" )) { - QString strLineType = elem.attribute("styleline"); + TQString strLineType = elem.attribute("styleline"); format.setStrikeOutStyle( KoTextFormat::stringToStrikeOutStyle( strLineType )); } if ( elem.hasAttribute( "wordbyword" )) @@ -484,7 +484,7 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re /* elem = formatElem.namedItem( "CHARSET" ).toElement(); if ( !elem.isNull() ) - font.setCharSet( (QFont::CharSet) elem.attribute("value").toInt() ); + font.setCharSet( (TQFont::CharSet) elem.attribute("value").toInt() ); */ format.setFont( font ); @@ -502,9 +502,9 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re int green = elem.attribute("green").toInt(); int blue = elem.attribute("blue").toInt(); if ( red == -1 && blue == -1 && green == -1 ) - format.setColor( QColor() ); + format.setColor( TQColor() ); else - format.setColor( QColor(red,green,blue) ); + format.setColor( TQColor(red,green,blue) ); } elem = formatElem.namedItem( "TEXTBACKGROUNDCOLOR" ).toElement(); if ( !elem.isNull() ) @@ -513,9 +513,9 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re int green = elem.attribute("green").toInt(); int blue = elem.attribute("blue").toInt(); if ( red == -1 && blue == -1 && green == -1 ) - format.setTextBackgroundColor( QColor() ); + format.setTextBackgroundColor( TQColor() ); else - format.setTextBackgroundColor( QColor(red,green,blue) ); + format.setTextBackgroundColor( TQColor(red,green,blue) ); } elem = formatElem.namedItem( "SHADOW" ).toElement(); if ( !elem.isNull() ) @@ -550,18 +550,18 @@ KoTextFormat KWTextParag::loadFormat( QDomElement &formatElem, KoTextFormat * re return format; } -void KWTextParag::loadLayout( QDomElement & attributes ) +void KWTextParag::loadLayout( TQDomElement & attributes ) { - QDomElement layout = attributes.namedItem( "LAYOUT" ).toElement(); - if ( !layout.isNull() ) + TQDomElement tqlayout = attributes.namedItem( "LAYOUT" ).toElement(); + if ( !tqlayout.isNull() ) { KWDocument * doc = kwTextDocument()->textFrameSet()->kWordDocument(); - KoParagLayout paragLayout = loadParagLayout( layout, doc, true ); + KoParagLayout paragLayout = loadParagLayout( tqlayout, doc, true ); setParagLayout( paragLayout ); // Load default format from style. KoTextFormat *defaultFormat = style() ? &style()->format() : 0L; - QDomElement formatElem = layout.namedItem( "FORMAT" ).toElement(); + TQDomElement formatElem = tqlayout.namedItem( "FORMAT" ).toElement(); if ( !formatElem.isNull() ) { // Load paragraph format @@ -577,16 +577,16 @@ void KWTextParag::loadLayout( QDomElement & attributes ) else { // Even the simplest import filter should do <LAYOUT><NAME value="Standard"/></LAYOUT> - kdWarning(32001) << "No LAYOUT tag in PARAGRAPH, dunno what layout to apply" << endl; + kdWarning(32001) << "No LAYOUT tag in PARAGRAPH, dunno what tqlayout to apply" << endl; } } -void KWTextParag::load( QDomElement &attributes ) +void KWTextParag::load( TQDomElement &attributes ) { loadLayout( attributes ); // Set the text after setting the paragraph format - so that the format applies - QDomElement element = attributes.namedItem( "TEXT" ).toElement(); + TQDomElement element = attributes.namedItem( "TEXT" ).toElement(); if ( !element.isNull() ) { //kdDebug() << "KWTextParag::load '" << element.text() << "'" << endl; @@ -601,20 +601,20 @@ void KWTextParag::load( QDomElement &attributes ) loadFormatting( attributes ); setChanged( true ); - invalidate( 0 ); + tqinvalidate( 0 ); } -void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool loadFootNote ) +void KWTextParag::loadFormatting( TQDomElement &attributes, int offset, bool loadFootNote ) { - QValueList<int> removeLenList; - QValueList<int> removePosList; + TQValueList<int> removeLenList; + TQValueList<int> removePosList; KWDocument * doc = kwTextDocument()->textFrameSet()->kWordDocument(); - QDomElement formatsElem = attributes.namedItem( "FORMATS" ).toElement(); + TQDomElement formatsElem = attributes.namedItem( "FORMATS" ).toElement(); if ( !formatsElem.isNull() ) { - QDomElement formatElem = formatsElem.firstChild().toElement(); + TQDomElement formatElem = formatsElem.firstChild().toElement(); for ( ; !formatElem.isNull() ; formatElem = formatElem.nextSibling().toElement() ) { if ( formatElem.tagName() == "FORMAT" ) @@ -635,17 +635,17 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load { len = 1; // it was missing from old 1.0 files - // The character matching this format is probably a QChar(1) + // The character matching this format is probably a TQChar(1) // However, as it is an invalid XML character, we must replace it // or it will be written out while save the file. KoTextStringChar& ch = string()->at(index); - if (ch.c.unicode()==1) + if (ch.c.tqunicode()==1) { - kdDebug() << "Replacing QChar(1) (in KWTextParag::loadFormatting)" << endl; + kdDebug() << "Replacing TQChar(1) (in KWTextParag::loadFormatting)" << endl; ch.c='#'; } - KWTextImage * custom = new KWTextImage( kwTextDocument(), QString::null ); + KWTextImage * custom = new KWTextImage( kwTextDocument(), TQString() ); kdDebug() << "KWTextParag::loadFormatting insertCustomItem" << endl; paragFormat()->addRef(); setCustomItem( index, custom, paragFormat() ); @@ -656,7 +656,7 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load { len = 1; // it was missing from old 1.0 files - // We have to replace the # or QChar(1) by a tabulator + // We have to replace the # or TQChar(1) by a tabulator KoTextStringChar& ch = string()->at(index); ch.c='\t'; @@ -668,7 +668,7 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load } case 4: // Variable { - QDomElement varElem = formatElem.namedItem( "VARIABLE" ).toElement(); + TQDomElement varElem = formatElem.namedItem( "VARIABLE" ).toElement(); bool oldDoc = false; if ( varElem.isNull() ) { @@ -677,7 +677,7 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load varElem = formatElem; oldDoc = true; } - QDomElement typeElem = varElem.namedItem( "TYPE" ).toElement(); + TQDomElement typeElem = varElem.namedItem( "TYPE" ).toElement(); if ( typeElem.isNull() ) kdWarning(32001) << ( oldDoc ? "No <TYPE> in <FORMAT> with id=4, for a variable [old document assumed] !" @@ -685,7 +685,7 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load else { int type = typeElem.attribute( "type" ).toInt(); - QString key = typeElem.attribute( "key" ); + TQString key = typeElem.attribute( "key" ); kdDebug() << "KWTextParag::loadFormatting variable type=" << type << " key=" << key << endl; KoVariableFormat * varFormat = key.isEmpty() ? 0 : doc->variableFormatCollection()->format( key.latin1() ); // If varFormat is 0 (no key specified), the default format will be used. @@ -709,12 +709,12 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load case 6: // Anchor { Q_ASSERT( len == 1 ); - QDomElement anchorElem = formatElem.namedItem( "ANCHOR" ).toElement(); + TQDomElement anchorElem = formatElem.namedItem( "ANCHOR" ).toElement(); if ( !anchorElem.isNull() ) { - QString type = anchorElem.attribute( "type" ); + TQString type = anchorElem.attribute( "type" ); if ( type == "grpMgr" /* old syntax */ || type == "frameset" ) { - QString framesetName = anchorElem.attribute( "instance" ); + TQString framesetName = anchorElem.attribute( "instance" ); KWAnchorPosition pos; pos.textfs = kwTextDocument()->textFrameSet(); pos.paragId = paragId(); @@ -740,20 +740,20 @@ void KWTextParag::loadFormatting( QDomElement &attributes, int offset, bool load } } -void KWTextParag::setParagLayout( const KoParagLayout & layout, int flags, int marginIndex ) +void KWTextParag::setParagLayout( const KoParagLayout & tqlayout, int flags, int marginIndex ) { - KoTextParag::setParagLayout( layout, flags, marginIndex ); + KoTextParag::setParagLayout( tqlayout, flags, marginIndex ); if ( flags & KoParagLayout::PageBreaking ) - setPageBreaking( layout.pageBreaking ); + setPageBreaking( tqlayout.pageBreaking ); } ////////// // Create a KoParagLayout from XML. -KoParagLayout KWTextParag::loadParagLayout( QDomElement & parentElem, KWDocument *doc, bool findStyle ) +KoParagLayout KWTextParag::loadParagLayout( TQDomElement & tqparentElem, KWDocument *doc, bool findStyle ) { - KoParagLayout layout; + KoParagLayout tqlayout; // Only when loading paragraphs, not when loading styles if ( findStyle ) @@ -761,10 +761,10 @@ KoParagLayout KWTextParag::loadParagLayout( QDomElement & parentElem, KWDocument KoParagStyle *style; // Name of the style. If there is no style, then we do not supply // any default! - QDomElement element = parentElem.namedItem( "NAME" ).toElement(); + TQDomElement element = tqparentElem.namedItem( "NAME" ).toElement(); if ( !element.isNull() ) { - QString styleName = element.attribute( "value" ); + TQString styleName = element.attribute( "value" ); style = doc->styleCollection()->findStyle( styleName ); if (!style) { @@ -779,12 +779,12 @@ KoParagLayout KWTextParag::loadParagLayout( QDomElement & parentElem, KWDocument style = doc->styleCollection()->findStyle( "Standard" ); } Q_ASSERT(style); - layout.style = style; + tqlayout.style = style; } - KoParagLayout::loadParagLayout( layout, parentElem, doc->syntaxVersion() ); + KoParagLayout::loadParagLayout( tqlayout, tqparentElem, doc->syntaxVersion() ); - return layout; + return tqlayout; } void KWTextParag::join( KoTextParag *parag ) @@ -793,7 +793,7 @@ void KWTextParag::join( KoTextParag *parag ) KoTextParag::join( parag ); } -void KWTextParag::loadOasis( const QDomElement& paragElement, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ) +void KWTextParag::loadOasis( const TQDomElement& paragElement, KoOasisContext& context, KoStyleCollection *styleCollection, uint& pos ) { KoTextParag::loadOasis( paragElement, context, styleCollection, pos ); @@ -801,39 +801,39 @@ void KWTextParag::loadOasis( const QDomElement& paragElement, KoOasisContext& co if ( textfs->isMainFrameset() && textfs->kWordDocument()->isLoading() /*not during copy/paste*/ ) { KWDocument * doc = textfs->kWordDocument(); - QString& currentMasterPageRef = doc->loadingInfo()->m_currentMasterPage; - const QString styleName = paragElement.attributeNS( KoXmlNS::text, "style-name", QString::null ); + TQString& currentMasterPageRef = doc->loadingInfo()->m_currentMasterPage; + const TQString styleName = paragElement.attributeNS( KoXmlNS::text, "style-name", TQString() ); if ( !styleName.isEmpty() ) { - const QDomElement* paragraphStyle = context.oasisStyles().findStyle( styleName, "paragraph" ); - QString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", QString::null ) : QString::null; + const TQDomElement* paragraphStyle = context.oasisStyles().findStyle( styleName, "paragraph" ); + TQString masterPageName = paragraphStyle ? paragraphStyle->attributeNS( KoXmlNS::style, "master-page-name", TQString() ) : TQString(); - // In KWord we don't support sections so the first paragraph is the one that determines the page layout. + // In KWord we don't support sections so the first paragraph is the one that determines the page tqlayout. if ( prev() == 0 ) { if ( masterPageName.isEmpty() ) - masterPageName = "Standard"; // Seems to be a builtin name for the default layout... + masterPageName = "Standard"; // Seems to be a builtin name for the default tqlayout... currentMasterPageRef = masterPageName; // do this first to avoid recursion context.styleStack().save(); context.styleStack().setTypeProperties( "paragraph" ); context.addStyles( paragraphStyle, "paragraph" ); // This is quite ugly... OOo stores the starting page-number in the first paragraph style... - QString pageNumber = context.styleStack().attributeNS( KoXmlNS::style, "page-number" ); + TQString pageNumber = context.styleStack().attributeNS( KoXmlNS::style, "page-number" ); if ( !pageNumber.isEmpty() ) doc->variableCollection()->variableSetting()->setStartingPageNumber( pageNumber.toInt() ); context.styleStack().restore(); - doc->loadOasisPageLayout( masterPageName, context ); // page layout + doc->loadOasisPageLayout( masterPageName, context ); // page tqlayout } else if ( !masterPageName.isEmpty() // empty means no change && masterPageName != currentMasterPageRef ) { - // Detected a change in the master page -> this means we have to use a new page layout + // Detected a change in the master page -> this means we have to use a new page tqlayout // and insert a frame break if not on the first paragraph. kdDebug(32001) << "KWTextParag::loadOasis: change of master page detected: from " << currentMasterPageRef << " to " << masterPageName << " -> inserting page break" << endl; currentMasterPageRef = masterPageName; // [see also KoParagLayout for the 'normal' way to insert page breaks] m_layout.pageBreaking |= KoParagLayout::HardFrameBreakBefore; - // We have no way to load/use the new page layout, KWord doesn't have "sections". + // We have no way to load/use the new page tqlayout, KWord doesn't have "sections". } } } |