diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp
index 48c48c750ae3d07e74b7ca0e1484deb27b3ed38c..1b498a846ec018112149d37bbeb6dd1ce5ded556 100644 (file)
--- a/src/ui/view/view.cpp
+++ b/src/ui/view/view.cpp
#include "message-stack.h"
#include "message-context.h"
#include "verbs.h"
+#include "inkscape-private.h"
namespace Inkscape {
namespace UI {
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- sp_document_unref(_doc);
- _doc = 0;
+ if (inkscape_remove_document(_doc)) {
+ // this was the last view of this document, so delete it
+ delete _doc;
+ }
+ _doc = NULL;
}
Inkscape::Verb::delete_all_view (this);
_position_set_signal.emit (x,y);
}
-void View::setPosition(NR::Point const &p)
+void View::setPosition(Geom::Point const &p)
{
- setPosition (double(p[NR::X]), double(p[NR::Y]));
+ setPosition (double(p[Geom::X]), double(p[Geom::Y]));
}
void View::emitResized (double width, double height)
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- sp_document_unref (_doc);
+ if (inkscape_remove_document(_doc)) {
+ // this was the last view of this document, so delete it
+ delete _doc;
+ }
}
- _doc = sp_document_ref (doc);
+ inkscape_add_document(doc);
+
+ _doc = doc;
_document_uri_set_connection =
_doc->connectURISet(sigc::bind(sigc::ptr_fun(&_onDocumentURISet), this));
_document_resized_connection =