kernel: fillInheritedPageAttr has to initialize Cropbox to Mediabox
If Cropbox is not present in the page dictionary we have to initialize
to the Mediabox size because otherwise we could end up with just a
subset of the Media. I have overlooked this when I implemented the
thing.
This fixes the issue when a large document (bigger than A4) without
Cropbox specified explicitly ended smaller after any changes to the
page.
Index: pdfedit-0.4.1/src/kernel/cpage.cc
===================================================================
--- pdfedit-0.4.1.orig/src/kernel/cpage.cc 2011-01-28 14:56:39.000000000 +0100
+++ pdfedit-0.4.1/src/kernel/cpage.cc 2011-01-28 15:35:28.000000000 +0100
@@ -215,10 +215,10 @@ namespace {
if(!attrs.mediaBox.get())
attrs.mediaBox=IProperty::getSmartCObjectPtr(getIPropertyFromRectangle(defaultRect));
- // CropBox is optional and specification doesn't say anything about
- // default value - we are using standard A4 format
+ // CropBox is optional and specification says that Cropbox should be
+ // initialized to the Mediabox size if not present
if(!attrs.cropBox.get())
- attrs.cropBox=IProperty::getSmartCObjectPtr(getIPropertyFromRectangle(defaultRect));
+ attrs.cropBox=attrs.mediaBox;
// Rotate is optional and specification defines default value to 0
if(!attrs.rotate.get())