From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- lib/kofficecore/KoPictureCollection.cpp | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'lib/kofficecore/KoPictureCollection.cpp') diff --git a/lib/kofficecore/KoPictureCollection.cpp b/lib/kofficecore/KoPictureCollection.cpp index 8941f32e1..3d680bf73 100644 --- a/lib/kofficecore/KoPictureCollection.cpp +++ b/lib/kofficecore/KoPictureCollection.cpp @@ -19,7 +19,7 @@ * Boston, MA 02110-1301, USA. */ -#include +#include #include #include @@ -37,7 +37,7 @@ KoPicture KoPictureCollection::findPicture(const KoPictureKey& key) const #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::findPicture " << key.toString() << endl; #endif - ConstIterator it = find( key ); + ConstIterator it = tqfind( key ); if ( it == end() ) { KoPicture picture; @@ -72,7 +72,7 @@ KoPicture KoPictureCollection::insertPicture(const KoPicture& picture) return insertPicture(picture.getKey(), picture); } -KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) +KoPicture KoPictureCollection::downloadPicture(const KURL& url, TQWidget *window) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::downloadPicture " << url.prettyURL() << endl; @@ -99,7 +99,7 @@ KoPicture KoPictureCollection::downloadPicture(const KURL& url, QWidget *window) return pic; } -KoPicture KoPictureCollection::loadPicture(const QString& fileName) +KoPicture KoPictureCollection::loadPicture(const TQString& fileName) { #ifdef DEBUG_PICTURES kdDebug(30003) << "KoPictureCollection::loadPicture " << fileName << endl; @@ -122,23 +122,23 @@ KoPicture KoPictureCollection::loadPicture(const QString& fileName) return c; } -QString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) +TQString KoPictureCollection::getFileName(const Type pictureType, KoPicture& picture, int& counter) { - QString storeURL; + TQString storeURL; // ### TODO: remove "cliparts" when KPresenter is ready for it if (pictureType==CollectionClipart) storeURL="cliparts/clipart"; else storeURL="pictures/picture"; - storeURL+=QString::number(++counter); + storeURL+=TQString::number(++counter); storeURL+='.'; storeURL+=picture.getExtension(); return storeURL; } -QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const +TQString KoPictureCollection::getOasisFileName(const KoPicture& picture) const { - QString storeURL( "Pictures/"); + TQString storeURL( "Pictures/"); if ( !picture.uniquePictureId().isEmpty() ) storeURL+=picture.uniquePictureId(); else @@ -148,10 +148,10 @@ QString KoPictureCollection::getOasisFileName(const KoPicture& picture) const return storeURL; } -bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const QValueList& keys) +bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, const TQValueList& keys) { int counter=0; - QValueList::const_iterator it = keys.begin(); + TQValueList::const_iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -159,7 +159,7 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString storeURL=getFileName(pictureType, c, counter); + TQString storeURL=getFileName(pictureType, c, counter); if (store->open(storeURL)) { @@ -174,9 +174,9 @@ bool KoPictureCollection::saveToStore(const Type pictureType, KoStore *store, co return true; } -bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys, KoXmlWriter* manifestWriter ) +bool KoPictureCollection::saveOasisToStore( KoStore *store, TQValueList keys, KoXmlWriter* manifestWriter ) { - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture c = findPicture( *it ); @@ -184,7 +184,7 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueListopen(storeURL)) { KoStoreDevice dev(store); @@ -199,16 +199,16 @@ bool KoPictureCollection::saveOasisToStore( KoStore *store, QValueList keys) +TQDomElement KoPictureCollection::saveXML(const Type pictureType, TQDomDocument &doc, TQValueList keys) { - QString strElementName("PICTURES"); + TQString strElementName("PICTURES"); if (pictureType==CollectionImage) strElementName="PIXMAPS"; else if (pictureType==CollectionClipart) strElementName="CLIPARTS"; - QDomElement cliparts = doc.createElement( strElementName ); + TQDomElement cliparts = doc.createElement( strElementName ); int counter=0; - QValueList::Iterator it = keys.begin(); + TQValueList::Iterator it = keys.begin(); for ( ; it != keys.end(); ++it ) { KoPicture picture = findPicture( *it ); @@ -216,8 +216,8 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d kdWarning(30003) << "Picture " << (*it).toString() << " not found in collection !" << endl; else { - QString pictureName=getFileName(pictureType, picture, counter); - QDomElement keyElem = doc.createElement( "KEY" ); + TQString pictureName=getFileName(pictureType, picture, counter); + TQDomElement keyElem = doc.createElement( "KEY" ); cliparts.appendChild(keyElem); (*it).saveAttributes(keyElem); keyElem.setAttribute("name", pictureName); @@ -226,13 +226,13 @@ QDomElement KoPictureCollection::saveXML(const Type pictureType, QDomDocument &d return cliparts; } -void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap & map ) +void KoPictureCollection::readXML( TQDomElement& pixmapsElem, TQMap & map ) { - for( QDomNode n = pixmapsElem.firstChild(); + for( TQDomNode n = pixmapsElem.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomElement keyElement = n.toElement(); + TQDomElement keyElement = n.toElement(); if (keyElement.isNull()) continue; if (keyElement.tagName()=="KEY") { @@ -244,7 +244,7 @@ void KoPictureCollection::readXML( QDomElement& pixmapsElem, QMap