summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-07-01 13:08:29 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-07-01 13:08:29 +0900
commitc2fdb394e63c0df50f1a38eace1077a9151374ce (patch)
tree4932e34432dac662526ac23f7dba04beabedf254 /filters
parenta9bbaa83cc3c2e3291786ef7f80e834a3e81ae44 (diff)
downloadkoffice-c2fdb394e63c0df50f1a38eace1077a9151374ce.tar.gz
koffice-c2fdb394e63c0df50f1a38eace1077a9151374ce.zip
Fix functionality broken by commit a9bbaa83
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'filters')
-rw-r--r--filters/kpresenter/kword/kprkword.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/filters/kpresenter/kword/kprkword.cpp b/filters/kpresenter/kword/kprkword.cpp
index 8dbd628b..87e57a6f 100644
--- a/filters/kpresenter/kword/kprkword.cpp
+++ b/filters/kpresenter/kword/kprkword.cpp
@@ -19,6 +19,8 @@
#include <config.h>
+#include <list>
+
#include <kgenericfactory.h>
#include <KoStoreDevice.h>
#include <KoFilterChain.h>
@@ -26,7 +28,6 @@
#include <kprkword.h>
#include <tdelocale.h>
#include <kdebug.h>
-#include <tqptrlist.h>
#include <tqcolor.h>
typedef KGenericFactory<KprKword, KoFilter> KprKwordFactory;
@@ -177,8 +178,7 @@ void KprKword::convert()
if ( objects.isNull() )
return;
- TQPtrList< KprObject > objList;
- objList.setAutoDelete( true );
+ std::list<KprObject*> objList;
TQDomNodeList lst = objects.elementsByTagName( "OBJECT" );
uint lstcount = lst.count();
@@ -193,21 +193,22 @@ void KprKword::convert()
KprObject * obj = new KprObject;
obj->y = orig.attribute( "y" ).toDouble();
obj->elem = object;
- objList.inSort( obj );
+ objList.push_back(obj);
}
}
}
+ objList.sort([](KprObject *a, KprObject *b) { return *a < *b; });
int curPage = -1;
- //kdDebug() << "found " << objList.count() << " objects" << endl;
+ //kdDebug() << "found " << objList.size() << " objects" << endl;
- for ( TQPtrListIterator<KprObject> it(objList); it.current(); ++it )
+ for (KprObject *obj : objList)
{
- TQDomElement elem = it.current()->elem;
+ TQDomElement elem = obj->elem;
// Detect the first object of each page
- int page = int( it.current()->y / ptPageHeight );
+ int page = int( obj->y / ptPageHeight );
bool isTitle = ( page > curPage );
- //kdDebug() << "KprKword::convert y=" << it.current()->y << " ptPageHeight=" << ptPageHeight
+ //kdDebug() << "KprKword::convert y=" << obj->y << " ptPageHeight=" << ptPageHeight
// << " isTitle=" << isTitle << endl;
curPage = page;
@@ -461,6 +462,11 @@ void KprKword::convert()
isTitle = false;
}
}
+
+ for (KprObject *obj : objList)
+ {
+ delete obj;
+ }
}
#include <kprkword.moc>