[poppler] poppler/OutputDev.h poppler/Page.cc poppler/Page.h poppler/PSOutputDev.h

2012-12-13 Thread Albert Astals Cid
 poppler/OutputDev.h   |5 +
 poppler/PSOutputDev.h |4 +++-
 poppler/Page.cc   |3 +++
 poppler/Page.h|2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 03045469206adbd797e3a38fee3a16cdd1716812
Author: Albert Astals Cid aa...@kde.org
Date:   Thu Dec 13 19:24:54 2012 +0100

Fix crop on EPS conversion

Bug #30692
Patch is half William Bader's and half mine

diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index 15af90a..f540d57 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -22,6 +22,7 @@
 // Copyright (C) 2009, 2012 Albert Astals Cid aa...@kde.org
 // Copyright (C) 2010 Christian Feuersänger cfeuersaen...@googlemail.com
 // Copyright (C) 2012 Fabio D'Urso fabiodu...@hotmail.it
+// Copyright (C) 2012 William Bader williamba...@hotmail.com
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -111,6 +112,10 @@ public:
   // Does this device require incCharCount to be called for text on
   // non-shown layers?
   virtual GBool needCharCount() { return gFalse; }
+  
+  // Does this device need to clip pages to the crop box even when the
+  // box is the crop box?
+  virtual GBool needClipToCropBox() { return gFalse; }
 
   //- initialization and control
 
diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h
index 809f058..6f29096 100644
--- a/poppler/PSOutputDev.h
+++ b/poppler/PSOutputDev.h
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2005 Martin Kretzschmar mart...@gnome.org
 // Copyright (C) 2005 Kristian Høgsberg k...@redhat.com
-// Copyright (C) 2006-2008 Albert Astals Cid aa...@kde.org
+// Copyright (C) 2006-2008, 2012 Albert Astals Cid aa...@kde.org
 // Copyright (C) 2007 Brad Hards br...@kde.org
 // Copyright (C) 2009-2012 Thomas Freitag thomas.frei...@alfa.de
 // Copyright (C) 2009 Till Kamppeter till.kamppe...@gmail.com
@@ -151,6 +151,8 @@ public:
   // Does this device use beginType3Char/endType3Char?  Otherwise,
   // text in Type 3 fonts will be drawn with drawChar/drawString.
   virtual GBool interpretType3Chars() { return gFalse; }
+  
+  virtual GBool needClipToCropBox() { return mode == psModeEPS; }
 
   //- header/trailer (used only if manualCtrl is true)
 
diff --git a/poppler/Page.cc b/poppler/Page.cc
index 87bc3a4..8c2065b 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -481,6 +481,9 @@ Gfx *Page::createGfx(OutputDev *out, double hDPI, double 
vDPI,
 printf(* Rotate = %d\n, attrs-getRotate());
   }
 
+  if (!crop) {
+crop = (box == *cropBox)  out-needClipToCropBox();
+  }
   gfx = new Gfx(doc, out, num, attrs-getResourceDict(),
hDPI, vDPI, box, crop ? cropBox : (PDFRectangle *)NULL,
rotate, abortCheckCbk, abortCheckCbkData);
diff --git a/poppler/Page.h b/poppler/Page.h
index 78cedc4..a6098ed 100644
--- a/poppler/Page.h
+++ b/poppler/Page.h
@@ -59,6 +59,8 @@ public:
   GBool isValid() { return x1 != 0 || y1 != 0 || x2 != 0 || y2 != 0; }
   GBool contains(double x, double y) { return x1 = x  x = x2  y1 = y  
y = y2; }
   void clipTo(PDFRectangle *rect);
+  
+  bool operator==(const PDFRectangle rect) const { return x1 == rect.x1  y1 
== rect.y1  x2 == rect.x2  y2 == rect.y2; }
 };
 
 //
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler


[poppler] poppler/Gfx.cc

2012-12-13 Thread Albert Astals Cid
 poppler/Gfx.cc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 487f20d24830a97cad4773ae27f0c2cc58df2ed0
Author: Albert Astals Cid aa...@kde.org
Date:   Thu Dec 13 20:40:39 2012 +0100

Check obj1 is a dict before using it

Fixes bug #58257

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 99c326e..5c9ed35 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4601,7 +4601,7 @@ GBool Gfx::checkTransparencyGroup(Dict *resDict) {
   Object obj1, obj2;
   GfxBlendMode mode;
 
-  if (res-lookupGState(dict-getKey(i), obj1)) {
+  if (res-lookupGState(dict-getKey(i), obj1)  obj1.isDict()) {
 if (!obj1.dictLookup(BM, obj2)-isNull()) {
   if (state-parseBlendMode(obj2, mode)) {
 if (mode != gfxBlendNormal)
___
poppler mailing list
poppler@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/poppler