[poppler] Branch 'poppler-0.14' - poppler/Page.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Oct 14 16:03:17 PDT 2010


 poppler/Page.cc |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 653b8da5bd6e50303207a2e8ccb5f5ad67db3767
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Oct 14 23:33:13 2010 +0100

    Only clip boxes to mediabox if we are at the page level
    
    Fixes bug 30784

diff --git a/poppler/Page.cc b/poppler/Page.cc
index d52cb77..3e80605 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2005 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2005 Jeff Muizelaar <jeff at infidigm.net>
-// Copyright (C) 2005-2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005-2010 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006-2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2006 Nickolay V. Shmyrev <nshmyrev at yandex.ru>
 // Copyright (C) 2006 Scott Turner <scotty1024 at mac.com>
@@ -91,6 +91,7 @@ void PDFRectangle::clipTo(PDFRectangle *rect) {
 PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
   Object obj1;
   PDFRectangle mBox;
+  const GBool isPage = dict->is("Page");
 
   // get old/default values
   if (attrs) {
@@ -124,8 +125,8 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
   if (!haveCropBox) {
     cropBox = mediaBox;
   }
-  else
-  {
+
+  if (isPage) {
     // cropBox can not be bigger than mediaBox
     if (cropBox.x2 - cropBox.x1 > mediaBox.x2 - mediaBox.x1)
     {
@@ -147,11 +148,13 @@ PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
   artBox = cropBox;
   readBox(dict, "ArtBox", &artBox);
 
-  // clip all other boxes to the media box
-  cropBox.clipTo(&mediaBox);
-  bleedBox.clipTo(&mediaBox);
-  trimBox.clipTo(&mediaBox);
-  artBox.clipTo(&mediaBox);
+  if (isPage) {
+    // clip all other boxes to the media box
+    cropBox.clipTo(&mediaBox);
+    bleedBox.clipTo(&mediaBox);
+    trimBox.clipTo(&mediaBox);
+    artBox.clipTo(&mediaBox);
+  }
 
   // rotate
   dict->lookup("Rotate", &obj1);


More information about the poppler mailing list