summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/pdfinput/pdf-input.cpp
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-09-22 17:47:37 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-09-22 17:47:37 +0000
commit2df0abfd438d90edb6056f0197ed9d27ce2cd1f1 (patch)
treead735614844c956d9799885b605dd3d866cd611f /src/extension/internal/pdfinput/pdf-input.cpp
parentFix CMake build (follow-up to r12567) (diff)
downloadinkscape-2df0abfd438d90edb6056f0197ed9d27ce2cd1f1.tar.gz
inkscape-2df0abfd438d90edb6056f0197ed9d27ce2cd1f1.zip
Fix adding viewBox to new documents.
Fixed bugs: - https://launchpad.net/bugs/1228660 - https://launchpad.net/bugs/1228693 - https://launchpad.net/bugs/1228852 (bzr r12575)
Diffstat (limited to 'src/extension/internal/pdfinput/pdf-input.cpp')
-rw-r--r--src/extension/internal/pdfinput/pdf-input.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index b04c9782f..213550688 100644
--- a/src/extension/internal/pdfinput/pdf-input.cpp
+++ b/src/extension/internal/pdfinput/pdf-input.cpp
@@ -46,6 +46,7 @@
#include "document-private.h"
#include "document-undo.h"
#include "inkscape.h"
+#include "util/units.h"
#include "dialogs/dialog-events.h"
#include <gtk/gtk.h>
@@ -747,6 +748,11 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
delete pdf_doc;
delete dlg;
+ // Set viewBox if it doesn't exist
+ if (!doc->getRoot()->viewBox_set) {
+ doc->setViewBox(Geom::Rect::from_xywh(0, 0, doc->getWidth().quantity, doc->getHeight().quantity));
+ }
+
// Restore undo
DocumentUndo::setUndoSensitive(doc, saved);