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/KWOasisLoader.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/KWOasisLoader.cpp')
-rw-r--r-- | kword/KWOasisLoader.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kword/KWOasisLoader.cpp b/kword/KWOasisLoader.cpp index 27cdcf54..99f5ee62 100644 --- a/kword/KWOasisLoader.cpp +++ b/kword/KWOasisLoader.cpp @@ -40,8 +40,8 @@ #include <kdebug.h> #include <klocale.h> -#include <qvaluelist.h> -#include <qdom.h> +#include <tqvaluelist.h> +#include <tqdom.h> KWOasisLoader::KWOasisLoader( KWDocument* doc ) : m_doc( doc ) @@ -50,9 +50,9 @@ KWOasisLoader::KWOasisLoader( KWDocument* doc ) // Warning, this method has no undo/redo support, it is *called* by the undo/redo commands. // cursor is set when pasting into a textframesetedit (kwcommand), 0 otherwise. -QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCursor* cursor ) +TQValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCursor* cursor ) { - QValueList<KWFrame *> frames; + TQValueList<KWFrame *> frames; if ( store->bad() || !store->hasFile( "content.xml" ) ) { kdError(32001) << "Invalid ZIP store in memory" << endl; @@ -63,8 +63,8 @@ QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCurs store->disallowNameExpansion(); KoOasisStore oasisStore( store ); - QDomDocument contentDoc; - QString errorMessage; + TQDomDocument contentDoc; + TQString errorMessage; bool ok = oasisStore.loadAndParse( "content.xml", contentDoc, errorMessage ); if ( !ok ) { kdError(32001) << "Error parsing content.xml: " << errorMessage << endl; @@ -72,7 +72,7 @@ QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCurs } KoOasisStyles oasisStyles; - QDomDocument stylesDoc; + TQDomDocument stylesDoc; (void)oasisStore.loadAndParse( "styles.xml", stylesDoc, errorMessage ); // Load styles from style.xml oasisStyles.createStyleMap( stylesDoc, true ); @@ -81,16 +81,16 @@ QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCurs m_doc->createLoadingInfo(); - QDomElement content = contentDoc.documentElement(); + TQDomElement content = contentDoc.documentElement(); - QDomElement body( KoDom::namedItemNS( content, KoXmlNS::office, "body" ) ); + TQDomElement body( KoDom::namedItemNS( content, KoXmlNS::office, "body" ) ); if ( body.isNull() ) { kdError(32001) << "No office:body found!" << endl; return frames; } // We then want to use whichever element is the child of <office:body>, // whether that's <office:text> or <office:presentation> or whatever. - QDomElement iter, realBody; + TQDomElement iter, realBody; forEachElement( iter, body ) { realBody = iter; } @@ -113,11 +113,11 @@ QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCurs { // The main loop from KoTextDocument::loadOasisText but for frames only // (can't paste text if there is no text-frameset being edited, where would it go?) - QDomElement tag; + TQDomElement tag; forEachElement( tag, realBody ) { context.styleStack().save(); - const QString bodyTagLocalName = tag.localName(); + const TQString bodyTagLocalName = tag.localName(); kdDebug() << k_funcinfo << bodyTagLocalName << endl; if ( bodyTagLocalName == "frame" && tag.namespaceURI() == KoXmlNS::draw ) { @@ -140,7 +140,7 @@ QValueList<KWFrame *> KWOasisLoader::insertOasisData( KoStore* store, KoTextCurs return frames; } -void KWOasisLoader::loadOasisSettings( const QDomDocument& settingsDoc ) +void KWOasisLoader::loadOasisSettings( const TQDomDocument& settingsDoc ) { KoOasisSettings settings( settingsDoc ); KoOasisSettings::Items viewSettings = settings.itemSet( "view-settings" ); @@ -152,7 +152,7 @@ void KWOasisLoader::loadOasisSettings( const QDomDocument& settingsDoc ) m_doc->variableCollection()->variableSetting()->loadOasis( settings ); } -static QString headerTypeToFramesetName( const QString& localName, bool hasEvenOdd ) +static TQString headerTypeToFramesetName( const TQString& localName, bool hasEvenOdd ) { if ( localName == "header" ) return hasEvenOdd ? i18n("Odd Pages Header") : i18n( "Header" ); @@ -167,10 +167,10 @@ static QString headerTypeToFramesetName( const QString& localName, bool hasEvenO if ( localName == "footer-first" ) // NOT OASIS COMPLIANT return i18n("First Page Footer"); kdWarning(32001) << "Unknown tag in headerTypeToFramesetName: " << localName << endl; - return QString::null; + return TQString(); } -static KWFrameSet::Info headerTypeToFrameInfo( const QString& localName, bool /*hasEvenOdd*/ ) +static KWFrameSet::Info headerTypeToFrameInfo( const TQString& localName, bool /*hasEvenOdd*/ ) { if ( localName == "header" ) return KWFrameSet::FI_ODD_HEADER; @@ -182,7 +182,7 @@ static KWFrameSet::Info headerTypeToFrameInfo( const QString& localName, bool /* return KWFrameSet::FI_EVEN_FOOTER; // ######## KWord extension, because I'm too lazy. - // TODO: the real solution is a separate page layout for the first page. + // TODO: the real solution is a separate page tqlayout for the first page. if ( localName == "header-first" ) // NOT OASIS COMPLIANT return KWFrameSet::FI_FIRST_HEADER; if ( localName == "footer-first" ) // NOT OASIS COMPLIANT @@ -190,9 +190,9 @@ static KWFrameSet::Info headerTypeToFrameInfo( const QString& localName, bool /* return KWFrameSet::FI_BODY; } -void KWOasisLoader::loadOasisHeaderFooter( const QDomElement& headerFooter, bool hasEvenOdd, QDomElement& style, KoOasisContext& context ) +void KWOasisLoader::loadOasisHeaderFooter( const TQDomElement& headerFooter, bool hasEvenOdd, TQDomElement& style, KoOasisContext& context ) { - const QString localName = headerFooter.localName(); + const TQString localName = headerFooter.localName(); bool isHeader = localName.startsWith( "header" ); KWTextFrameSet *fs = new KWTextFrameSet( m_doc, headerTypeToFramesetName( localName, hasEvenOdd ) ); @@ -203,7 +203,7 @@ void KWOasisLoader::loadOasisHeaderFooter( const QDomElement& headerFooter, bool context.styleStack().push( style ); KWFrame* frame = new KWFrame( fs, 29, isHeader?0:567, 798-29, 41 ); frame->loadCommonOasisProperties( context, fs, "header-footer" ); - const QString minHeight = context.styleStack().attributeNS( KoXmlNS::fo, "min-height" ); + const TQString minHeight = context.styleStack().attributeNS( KoXmlNS::fo, "min-height" ); if ( !minHeight.isEmpty() ) frame->setMinimumFrameHeight( KoUnit::parseValue( minHeight ) ); @@ -228,21 +228,21 @@ void KWOasisLoader::loadOasisIgnoreList( const KoOasisSettings& settings ) KoOasisSettings::Items configurationSettings = settings.itemSet( "configuration-settings" ); if ( !configurationSettings.isNull() ) { - const QString ignorelist = configurationSettings.parseConfigItemString( "SpellCheckerIgnoreList" ); + const TQString ignorelist = configurationSettings.parseConfigItemString( "SpellCheckerIgnoreList" ); kdDebug()<<" ignorelist :"<<ignorelist<<endl; - m_doc->setSpellCheckIgnoreList( QStringList::split( ',', ignorelist ) ); + m_doc->setSpellCheckIgnoreList( TQStringList::split( ',', ignorelist ) ); } } -KWFrame* KWOasisLoader::loadFrame( const QDomElement& frameTag, KoOasisContext& context, const KoPoint& offset ) +KWFrame* KWOasisLoader::loadFrame( const TQDomElement& frameTag, KoOasisContext& context, const KoPoint& offset ) { KWFrame* frame = 0; - QDomElement elem; + TQDomElement elem; forEachElement( elem, frameTag ) { if ( elem.namespaceURI() != KoXmlNS::draw ) continue; - const QString localName = elem.localName(); + const TQString localName = elem.localName(); if ( localName == "text-box" ) { //kdDebug()<<" append text-box\n"; @@ -257,8 +257,8 @@ KWFrame* KWOasisLoader::loadFrame( const QDomElement& frameTag, KoOasisContext& break; } else if ( localName == "object" ) { - QDomElement mathElem; // will be set if we find <math:math> - QDomElement childElem; + TQDomElement mathElem; // will be set if we tqfind <math:math> + TQDomElement childElem; forEachElement( childElem, elem ) { if ( childElem.localName() == "math" @@ -279,11 +279,11 @@ KWFrame* KWOasisLoader::loadFrame( const QDomElement& frameTag, KoOasisContext& } } if ( frame ) { - const QString anchorType = frameTag.attributeNS( KoXmlNS::text, "anchor-type", QString::null ); + const TQString anchorType = frameTag.attributeNS( KoXmlNS::text, "anchor-type", TQString() ); if ( anchorType == "page" ) { - double x = KoUnit::parseValue( frameTag.attributeNS( KoXmlNS::svg, "x", QString::null ) ); - double y = KoUnit::parseValue( frameTag.attributeNS( KoXmlNS::svg, "y", QString::null ) ); - int pageNum = frameTag.attributeNS( KoXmlNS::text, "anchor-page-number", QString::null ).toInt(); + double x = KoUnit::parseValue( frameTag.attributeNS( KoXmlNS::svg, "x", TQString() ) ); + double y = KoUnit::parseValue( frameTag.attributeNS( KoXmlNS::svg, "y", TQString() ) ); + int pageNum = frameTag.attributeNS( KoXmlNS::text, "anchor-page-number", TQString() ).toInt(); // Ensure that we have enough pages KWPageManager* pageManager = m_doc->pageManager(); while ( pageNum > pageManager->lastPageNumber() ) @@ -295,7 +295,7 @@ KWFrame* KWOasisLoader::loadFrame( const QDomElement& frameTag, KoOasisContext& return frame; } -KWFrame* KWOasisLoader::loadOasisTextBox( const QDomElement& frameTag, const QDomElement& tag, +KWFrame* KWOasisLoader::loadOasisTextBox( const TQDomElement& frameTag, const TQDomElement& tag, KoOasisContext& context ) { // Text frame chains. When seeing frame 'B' is chained to this frame A when loading, @@ -307,16 +307,16 @@ KWFrame* KWOasisLoader::loadOasisTextBox( const QDomElement& frameTag, const QDo KWLoadingInfo* loadingInfo = m_doc->loadingInfo(); KWTextFrameSet* fs = 0; - QString frameName = frameTag.attributeNS( KoXmlNS::draw, "name", QString::null ); - QString chainNextName = tag.attributeNS( KoXmlNS::draw, "chain-next-name", QString::null ); + TQString frameName = frameTag.attributeNS( KoXmlNS::draw, "name", TQString() ); + TQString chainNextName = tag.attributeNS( KoXmlNS::draw, "chain-next-name", TQString() ); if ( !chainNextName.isEmpty() && loadingInfo ) { // 'B' in the above example kdDebug(32001) << "Loading " << frameName << " : next-in-chain=" << chainNextName << endl; // Check if we already loaded that frame (then we need to go 'before' it) KWFrame* nextFrame = loadingInfo->frameByName( chainNextName ); if ( nextFrame ) { fs = dynamic_cast<KWTextFrameSet *>( nextFrame->frameSet() ); - chainNextName = QString::null; // already found, no need to store it - kdDebug(32001) << " found " << nextFrame << " -> frameset " << ( fs ? fs->name() : QString::null ) << endl; + chainNextName = TQString(); // already found, no need to store it + kdDebug(32001) << " found " << nextFrame << " -> frameset " << ( fs ? fs->name() : TQString() ) << endl; } } KWFrame* prevFrame = loadingInfo->chainPrevFrame( frameName ); @@ -347,10 +347,10 @@ KWFrame* KWOasisLoader::loadOasisTextBox( const QDomElement& frameTag, const QDo return frame; } -KWTableFrameSet* KWOasisLoader::loadOasisTable( const QDomElement& tag, +KWTableFrameSet* KWOasisLoader::loadOasisTable( const TQDomElement& tag, KoOasisContext& context ) { - const QString name = tag.attributeNS( KoXmlNS::table, "name", i18n( "Unnamed Table" ) ); // ### check for unicity? + const TQString name = tag.attributeNS( KoXmlNS::table, "name", i18n( "Unnamed Table" ) ); // ### check for unicity? KWTableFrameSet* table = new KWTableFrameSet( m_doc, name ); table->loadOasis( tag, context ); m_doc->addFrameSet(table, false); |