diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2019-03-15 14:21:30 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2019-03-15 14:21:30 +0000 |
| commit | 1602477dfd4371a17639b0b6e4f59f5a5ea9565a (patch) | |
| tree | 6f4561f58d15f8b6608897e232b37658143d46e6 /src/document.cpp | |
| parent | Improve deb generation and install scripts (diff) | |
| download | inkscape-1602477dfd4371a17639b0b6e4f59f5a5ea9565a.tar.gz inkscape-1602477dfd4371a17639b0b6e4f59f5a5ea9565a.zip | |
Make InkscapeApplication responsible for managing documents and windows.
Any change from previous behavior is a bug.
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/document.cpp b/src/document.cpp index a6ad44c9d..1fc32d8a0 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -216,7 +216,6 @@ SPDocument::~SPDocument() { // This is at the end of the destructor, because preceding code adds new orphans to the queue collectOrphans(); - } sigc::connection SPDocument::connectDestroy(sigc::signal<void>::slot_type slot) @@ -460,6 +459,10 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, )); document->oldSignalsConnected = true; + + // ************* Fix Document ************** + // Move to separate function? + /** Fix baseline spacing (pre-92 files) **/ if ( (!sp_no_convert_text_baseline_spacing) && sp_version_inside_range( document->root->version.inkscape, 0, 1, 0, 92 ) ) { @@ -471,11 +474,17 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, sp_file_convert_font_name(document); } - /** Fix dpi (pre-92 files) **/ + /** Fix dpi (pre-92 files). With GUI fixed in Inkscape::Application::fix_document. **/ if ( !(INKSCAPE.use_gui()) && sp_version_inside_range( document->root->version.inkscape, 0, 1, 0, 92 ) ) { sp_file_convert_dpi(document); } + // Update LPE's See: Related bug:#1769679 #18 + SPDefs * defs = document->getDefs(); + if (defs) { + defs->emitModified(SP_OBJECT_MODIFIED_CASCADE); + } + return document; } @@ -513,7 +522,6 @@ SPDocument *SPDocument::createChildDoc(std::string const &document_uri) } else { path = document_uri; } - std::cout << "Added document_base: '" << path << std::endl; document = createNewDoc(path.c_str(), false, false, this); } return document; @@ -782,6 +790,17 @@ Geom::Rect SPDocument::getViewBox() const return viewBox; } +/** + * Set default viewbox calculated from document properties. + */ +void SPDocument::setViewBox() +{ + setViewBox(Geom::Rect(0, + 0, + getWidth().value(getDisplayUnit()), + getHeight().value(getDisplayUnit()))); +} + void SPDocument::setViewBox(const Geom::Rect &viewBox) { root->viewBox_set = true; |
