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/KWTextDocument.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/KWTextDocument.cpp')
-rw-r--r-- | kword/KWTextDocument.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kword/KWTextDocument.cpp b/kword/KWTextDocument.cpp index ddfb5304..580e378d 100644 --- a/kword/KWTextDocument.cpp +++ b/kword/KWTextDocument.cpp @@ -43,7 +43,7 @@ KWTextDocument::KWTextDocument( KWTextFrameSet * textfs, KoTextFormatCollection } KWTextDocument::KWTextDocument( KoTextZoomHandler * zoomHandler ) - : KoTextDocument( zoomHandler, new KoTextFormatCollection( KGlobalSettings::generalFont() /*unused*/, QColor(), KGlobal::locale()->language(), false), 0L, false ), + : KoTextDocument( zoomHandler, new KoTextFormatCollection( KGlobalSettings::generalFont() /*unused*/, TQColor(), KGlobal::locale()->language(), false), 0L, false ), m_textfs( 0 ) { init(); @@ -64,30 +64,30 @@ KoTextParag * KWTextDocument::createParag( KoTextDocument *d, KoTextParag *pr, K return new KWTextParag( static_cast<KoTextDocument *>(d), static_cast<KoTextParag *>(pr), static_cast<KoTextParag *>(nx), updateIds ); } -KoTextDocCommand *KWTextDocument::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const QMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const QValueList<KoParagLayout> & oldParagLayouts ) +KoTextDocCommand *KWTextDocument::deleteTextCommand( KoTextDocument *textdoc, int id, int index, const TQMemArray<KoTextStringChar> & str, const CustomItemsMap & customItemsMap, const TQValueList<KoParagLayout> & oldParagLayouts ) { //kdDebug(32500)<<" KoTextDocument::deleteTextCommand************\n"; return new KWTextDeleteCommand( textdoc, id, index, str, customItemsMap, oldParagLayouts ); } -void KWTextDocument::loadOasisTOC( const QDomElement& tag, KoOasisContext& context, KoTextParag* & lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph ) +void KWTextDocument::loadOasisTOC( const TQDomElement& tag, KoOasisContext& context, KoTextParag* & lastParagraph, KoStyleCollection * styleColl, KoTextParag* nextParagraph ) { // table-of-content OOo SPEC 7.5 p452 //fillStyleStack( tag, "text:style-name" ); that's the section style - //QDomElement tocSource = KoDom::namedItemNS( toc, KoXmlNS::text, "table-of-content-source" ); + //TQDomElement tocSource = KoDom::namedItemNS( toc, KoXmlNS::text, "table-of-content-source" ); // TODO parse templates and generate "Contents ..." styles from it - //for ( QDomNode n(tocSource.firstChild()); !text.isNull(); text = text.nextSibling() ) + //for ( TQDomNode n(tocSource.firstChild()); !text.isNull(); text = text.nextSibling() ) //{ //} - QDomElement tocIndexBody = KoDom::namedItemNS( tag, KoXmlNS::text, "index-body" ); - QDomElement t; + TQDomElement tocIndexBody = KoDom::namedItemNS( tag, KoXmlNS::text, "index-body" ); + TQDomElement t; forEachElement( t, tocIndexBody ) { context.styleStack().save(); - const QString localName = t.localName(); - QDomElement e; + const TQString localName = t.localName(); + TQDomElement e; bool isTextNS = tag.namespaceURI() == KoXmlNS::text; if ( isTextNS && localName == "index-title" ) { lastParagraph = loadOasisText( t, context, lastParagraph, styleColl, nextParagraph ); // recurse again @@ -106,11 +106,11 @@ void KWTextDocument::loadOasisTOC( const QDomElement& tag, KoOasisContext& conte m_textfs->kWordDocument()->setTocPresent( true ); } -bool KWTextDocument::loadOasisBodyTag( const QDomElement& tag, KoOasisContext& context, +bool KWTextDocument::loadOasisBodyTag( const TQDomElement& tag, KoOasisContext& context, KoTextParag* & lastParagraph, KoStyleCollection* styleColl, KoTextParag* nextParagraph ) { - const QString localName( tag.localName() ); + const TQString localName( tag.localName() ); // Non-inline frame (i.e. anchored to page) if ( localName == "frame" && tag.namespaceURI() == KoXmlNS::draw ) { @@ -148,23 +148,23 @@ bool KWTextDocument::loadOasisBodyTag( const QDomElement& tag, KoOasisContext& c return false; } -void KWTextDocument::appendBookmark( KoTextParag* parag, int pos, KoTextParag* endParag, int endPos, const QString& name ) +void KWTextDocument::appendBookmark( KoTextParag* parag, int pos, KoTextParag* endParag, int endPos, const TQString& name ) { // The OASIS format is cool. No need to store the bookmarks until end of loading (e.g. KWLoadingInfo) // We can "resolve" them right away. m_textfs->kWordDocument()->insertBookmark( name, parag, endParag, pos, endPos ); } -void KWTextDocument::loadOasisFootnote( const QDomElement& tag, KoOasisContext& context, +void KWTextDocument::loadOasisFootnote( const TQDomElement& tag, KoOasisContext& context, KoTextCustomItem* & customItem ) { - const QString frameName( tag.attributeNS( KoXmlNS::text, "id", QString::null) ); - const QString localName( tag.localName() ); - const QDomElement citationElem = tag.namedItem( localName + "-citation" ).toElement(); + const TQString frameName( tag.attributeNS( KoXmlNS::text, "id", TQString()) ); + const TQString localName( tag.localName() ); + const TQDomElement citationElem = tag.namedItem( localName + "-citation" ).toElement(); bool endnote = localName == "endnote" && tag.namespaceURI() == KoXmlNS::text; - QString label = citationElem.attributeNS( KoXmlNS::text, "label", QString::null ); + TQString label = citationElem.attributeNS( KoXmlNS::text, "label", TQString() ); bool autoNumbered = label.isEmpty(); KWFootNoteFrameSet *fs = m_textfs->insertFootNote( @@ -176,15 +176,15 @@ void KWTextDocument::loadOasisFootnote( const QDomElement& tag, KoOasisContext& fs->createInitialFrame( 0 ); // we don't know the page number... // Parse contents into the frameset - const QDomElement bodyElem = KoDom::namedItemNS( tag, KoXmlNS::text, QCString( localName.latin1() ) + "-body" ).toElement(); + const TQDomElement bodyElem = KoDom::namedItemNS( tag, KoXmlNS::text, TQCString( localName.latin1() ) + "-body" ).toElement(); fs->loadOasisContent( bodyElem, context ); } -bool KWTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& context, +bool KWTextDocument::loadSpanTag( const TQDomElement& tag, KoOasisContext& context, KoTextParag* parag, uint pos, - QString& textData, KoTextCustomItem* & customItem ) + TQString& textData, KoTextCustomItem* & customItem ) { - const QString localName( tag.localName() ); + const TQString localName( tag.localName() ); const bool isTextNS = tag.namespaceURI() == KoXmlNS::text; kdDebug(32500) << "KWTextDocument::loadSpanTag: " << localName << endl; @@ -192,7 +192,7 @@ bool KWTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& contex { if ( localName == "a" ) { - QString href( tag.attributeNS( KoXmlNS::xlink, "href", QString::null) ); + TQString href( tag.attributeNS( KoXmlNS::xlink, "href", TQString()) ); if ( href.startsWith("#") ) { context.styleStack().save(); @@ -207,19 +207,19 @@ bool KWTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& contex // we could have multiple spans there, but OO ensures that there is always only one, // splitting the hyperlink if necessary (at format changes). // Note that we ignore the formatting of the span. - QDomElement spanElem = KoDom::namedItemNS( tag, KoXmlNS::text, "span" ); - QString text; + TQDomElement spanElem = KoDom::namedItemNS( tag, KoXmlNS::text, "span" ); + TQString text; if( spanElem.isNull() ) text = tag.text(); else { // The save/restore of the stack is done by the caller (KoTextParag::loadOasisSpan) // This allows to use the span's format for the variable. - //kdDebug(32500) << "filling stack with " << spanElem.attributeNS( KoXmlNS::text, "style-name", QString::null ) << endl; + //kdDebug(32500) << "filling stack with " << spanElem.attributeNS( KoXmlNS::text, "style-name", TQString() ) << endl; context.fillStyleStack( spanElem, KoXmlNS::text, "style-name", "text" ); text = spanElem.text(); } textData = KoTextObject::customItemChar(); // hyperlink placeholder - // unused tag.attributeNS( KoXmlNS::office, "name", QString::null ) + // unused tag.attributeNS( KoXmlNS::office, "name", TQString() ) KoVariableCollection& coll = context.variableCollection(); customItem = new KoLinkVariable( this, text, href, coll.formatCollection()->format( "STRING" ), @@ -229,22 +229,22 @@ bool KWTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& contex } else if ( localName == "bookmark" ) { - appendBookmark( parag, pos, parag, pos, tag.attributeNS( KoXmlNS::text, "name", QString::null ) ); + appendBookmark( parag, pos, parag, pos, tag.attributeNS( KoXmlNS::text, "name", TQString() ) ); return true; } else if ( localName == "bookmark-start" ) { KWLoadingInfo* loadingInfo = m_textfs->kWordDocument()->loadingInfo(); - loadingInfo->m_bookmarkStarts.insert( tag.attributeNS( KoXmlNS::text, "name", QString::null ), + loadingInfo->m_bookmarkStarts.insert( tag.attributeNS( KoXmlNS::text, "name", TQString() ), KWLoadingInfo::BookmarkStart( this, parag, pos ) ); return true; } else if ( localName == "bookmark-end" ) { KWLoadingInfo* loadingInfo = m_textfs->kWordDocument()->loadingInfo(); - QString bkName = tag.attributeNS( KoXmlNS::text, "name", QString::null ); - KWLoadingInfo::BookmarkStartsMap::iterator it = loadingInfo->m_bookmarkStarts.find( bkName ); + TQString bkName = tag.attributeNS( KoXmlNS::text, "name", TQString() ); + KWLoadingInfo::BookmarkStartsMap::iterator it = loadingInfo->m_bookmarkStarts.tqfind( bkName ); if ( it == loadingInfo->m_bookmarkStarts.end() ) { // bookmark end without start. This seems to happen.. // insert simple bookmark then - appendBookmark( parag, pos, parag, pos, tag.attributeNS( KoXmlNS::text, "name", QString::null ) ); + appendBookmark( parag, pos, parag, pos, tag.attributeNS( KoXmlNS::text, "name", TQString() ) ); } else { if ( (*it).doc != this ) { // Oh tell me this never happens... @@ -267,15 +267,15 @@ bool KWTextDocument::loadSpanTag( const QDomElement& tag, KoOasisContext& contex { if ( tag.namespaceURI() == KoXmlNS::draw && localName == "frame" ) { - if ( tag.attributeNS( KoXmlNS::koffice, "is-wrapper-frame", QString::null ) + if ( tag.attributeNS( KoXmlNS::koffice, "is-wrapper-frame", TQString() ) == "true" ) { - QDomElement textbox = KoDom::namedItemNS( tag, KoXmlNS::draw, "text-box" ); + TQDomElement textbox = KoDom::namedItemNS( tag, KoXmlNS::draw, "text-box" ); if ( !textbox.isNull() ) { int numberOfElements = 0; - QDomElement elem; - QDomElement firstElem; + TQDomElement elem; + TQDomElement firstElem; forEachElement( elem, textbox ) { ++numberOfElements; |