rev 11875 - in trunk/packages/kdegraphics/debian: . patches

Ana Beatriz Guerrero López ana at alioth.debian.org
Fri Aug 8 16:04:39 UTC 2008


Author: ana
Date: 2008-08-08 16:04:39 +0000 (Fri, 08 Aug 2008)
New Revision: 11875

Added:
   trunk/packages/kdegraphics/debian/patches/02_kpdf_kde_bug_166145.diff
Modified:
   trunk/packages/kdegraphics/debian/changelog
Log:
let's make albert and pino happy :-P



Modified: trunk/packages/kdegraphics/debian/changelog
===================================================================
--- trunk/packages/kdegraphics/debian/changelog	2008-08-08 14:50:32 UTC (rev 11874)
+++ trunk/packages/kdegraphics/debian/changelog	2008-08-08 16:04:39 UTC (rev 11875)
@@ -10,8 +10,10 @@
     there are an even number of elements in 
     KSVG::SVGAnimatedPointsImpl::parsePoints. 
     Thanks a lot to Steve Cotton. (Closes: #493363) 
+  * Fetch fix for KDE bug 166145, it fixes crash on malfored documents while
+    showing the Properties dialog.
 
- -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sat, 02 Jul 2008 15:00:12 +0100
+ -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Fri, 08 Aug 2008 18:10:26 +0200
 
 kdegraphics (4:3.5.9-2) unstable; urgency=low
 

Added: trunk/packages/kdegraphics/debian/patches/02_kpdf_kde_bug_166145.diff
===================================================================
--- trunk/packages/kdegraphics/debian/patches/02_kpdf_kde_bug_166145.diff	                        (rev 0)
+++ trunk/packages/kdegraphics/debian/patches/02_kpdf_kde_bug_166145.diff	2008-08-08 16:04:39 UTC (rev 11875)
@@ -0,0 +1,98 @@
+#DPATCHLEVEL=0
+--- kpdf/core/generator_pdf/generator_pdf.cpp	(revision 826869)
++++ kpdf/core/generator_pdf/generator_pdf.cpp	(revision 844056)
+@@ -380,12 +380,13 @@
+ 
+     fonts = NULL;
+     fontsLen = fontsSize = 0;
++    QValueVector<Ref> visitedXObjects;
+     for (pg = 1; pg <= pdfdoc->getNumPages(); ++pg)
+     {
+         page = pdfdoc->getCatalog()->getPage(pg);
+         if ((resDict = page->getResourceDict()))
+         {
+-            scanFonts(resDict, list, &fonts, fontsLen, fontsSize);
++            scanFonts(resDict, list, &fonts, fontsLen, fontsSize, &visitedXObjects);
+         }
+         annots = new Annots(pdfdoc->getXRef(), pdfdoc->getCatalog(), page->getAnnots(&obj1));
+         obj1.free();
+@@ -396,7 +397,7 @@
+                 obj1.streamGetDict()->lookup("Resources", &obj2);
+                 if (obj2.isDict())
+                 {
+-                    scanFonts(obj2.getDict(), list, &fonts, fontsLen, fontsSize);
++                    scanFonts(obj2.getDict(), list, &fonts, fontsLen, fontsSize, &visitedXObjects);
+                 }
+                 obj2.free();
+             }
+@@ -632,9 +633,9 @@
+ }
+ //END Generator inherited functions
+ 
+-void PDFGenerator::scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize)
++void PDFGenerator::scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, QValueVector<Ref> *visitedXObjects)
+ {
+-    Object obj1, obj2, xObjDict, xObj, resObj;
++    Object obj1, obj2, xObjDict, xObj, xObj2, resObj;
+     Ref r;
+     GfxFontDict *gfxFontDict;
+     GfxFont *font;
+@@ -670,18 +671,38 @@
+     // recursively scan any resource dictionaries in objects in this
+     // resource dictionary
+     resDict->lookup("XObject", &xObjDict);
+-    if (xObjDict.isDict())
+-    {
+-        for (i = 0; i < xObjDict.dictGetLength(); ++i)
+-        {
+-            xObjDict.dictGetVal(i, &xObj);
+-            if (xObj.isStream())
+-            {
+-                xObj.streamGetDict()->lookup("Resources", &resObj);
+-                if (resObj.isDict()) scanFonts(resObj.getDict(), list, fonts, fontsLen, fontsSize);
++    if (xObjDict.isDict()) {
++        for (i = 0; i < xObjDict.dictGetLength(); ++i) {
++            xObjDict.dictGetValNF(i, &xObj);
++            if (xObj.isRef()) {
++                bool alreadySeen = false;
++                // check for an already-seen XObject
++                for (int k = 0; k < visitedXObjects->count(); ++k) {
++                    if (xObj.getRef().num == visitedXObjects->at(k).num &&
++                        xObj.getRef().gen == visitedXObjects->at(k).gen) {
++                            alreadySeen = true;
++                    }
++                }
++
++                if (alreadySeen) {
++                    xObj.free();
++                    continue;
++                }
++
++                visitedXObjects->append(xObj.getRef());
++            }
++
++            xObj.fetch(pdfdoc->getXRef(), &xObj2);
++
++            if (xObj2.isStream()) {
++                xObj2.streamGetDict()->lookup("Resources", &resObj);
++                if (resObj.isDict() && resObj.getDict() != resDict) {
++                    scanFonts(resObj.getDict(), list, fonts, fontsLen, fontsSize, visitedXObjects);
++                }
+                 resObj.free();
+             }
+             xObj.free();
++            xObj2.free();
+         }
+     }
+     xObjDict.free();
+--- kpdf/core/generator_pdf/generator_pdf.h	(revision 826869)
++++ kpdf/core/generator_pdf/generator_pdf.h	(revision 844056)
+@@ -86,7 +86,7 @@
+         // friend class to access private document related variables
+         friend class PDFPixmapGeneratorThread;
+ 
+-        void scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize);
++        void scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, QValueVector<Ref> *visitedXObjects);
+         void scanFont(GfxFont *font, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize);
+ 
+         void fillViewportFromLink( DocumentViewport &viewport, LinkDest *destination );




More information about the pkg-kde-commits mailing list