diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-23 05:52:15 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-23 05:52:15 +0000 |
| commit | f6e71416f19343cb97098c175acce52771e5e32b (patch) | |
| tree | d487d09840f9cce4372ac89b22f81bf3b2c858e4 /src/ui/view/view.cpp | |
| parent | purge old toolbar code, fill in values and labels (diff) | |
| download | inkscape-f6e71416f19343cb97098c175acce52771e5e32b.tar.gz inkscape-f6e71416f19343cb97098c175acce52771e5e32b.zip | |
allow multiple (balanced) calls to add and remove document
(bzr r2745)
Diffstat (limited to 'src/ui/view/view.cpp')
| -rw-r--r-- | src/ui/view/view.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp index 04158ddbd..6b6e0b8b6 100644 --- a/src/ui/view/view.cpp +++ b/src/ui/view/view.cpp @@ -23,6 +23,7 @@ #include "message-stack.h" #include "message-context.h" #include "verbs.h" +#include "inkscape-private.h" namespace Inkscape { namespace UI { @@ -83,6 +84,9 @@ View::View() */ View::~View() { + if (_doc) { + inkscape_remove_document(_doc); + } _close(); } @@ -138,8 +142,11 @@ void View::setDocument(SPDocument *doc) { if (_doc) { _document_uri_set_connection.disconnect(); _document_resized_connection.disconnect(); + inkscape_remove_document(_doc); } + inkscape_add_document(doc); + _doc = doc; _document_uri_set_connection = _doc->connectURISet(sigc::bind(sigc::ptr_fun(&_onDocumentURISet), this)); |
