summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3828c91)
raw | patch | inline | side by side (parent: 3828c91)
author | scislac <scislac@users.sourceforge.net> | |
Sun, 4 Oct 2009 20:05:20 +0000 (20:05 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Sun, 4 Oct 2009 20:05:20 +0000 (20:05 +0000) |
src/document.cpp | patch | blob | history | |
src/document.h | patch | blob | history |
diff --git a/src/document.cpp b/src/document.cpp
index 8503c7841e153a117d57f802ba133e898860d38c..d406f3712d4ba2cf7a483efe3bf2449b0839c0d4 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
g_print ("Please implement deletion of perspectives here.\n");
}
+void SPDocument::initialize_current_persp3d()
+{
+ this->current_persp3d = persp3d_document_first_persp(this);
+ if (!this->current_persp3d) {
+ this->current_persp3d = persp3d_create_xml_element(this);
+ }
+}
+
unsigned long SPDocument::serial() const {
return priv->serial;
}
// Remark: Here, we used to create a "currentpersp3d" element in the document defs.
// But this is probably a bad idea since we need to adapt it for every change of selection, which will
// completely clutter the undo history. Maybe rather save it to prefs on exit and re-read it on startup?
-
- document->current_persp3d = persp3d_document_first_persp(document);
- if (!document->current_persp3d) {
- document->current_persp3d = persp3d_create_xml_element (document);
- }
+ document->initialize_current_persp3d();
sp_document_set_undo_sensitive(document, true);
{
// printf("Finishing Reconstruction\n");
priv->_reconstruction_finish_signal.emit();
+
+ // Reference to the old persp3d object is invalid after reconstruction.
+ initialize_current_persp3d();
+
return;
}
diff --git a/src/document.h b/src/document.h
index 696e568ad419e01465564e308928197278068ecf..789e3e2ed7b55dc702c781e03bdd0d7033a83e1a 100644 (file)
--- a/src/document.h
+++ b/src/document.h
void add_persp3d(Persp3D * const persp);
void remove_persp3d(Persp3D * const persp);
+ void initialize_current_persp3d();
sigc::connection connectModified(ModifiedSignal::slot_type slot);
sigc::connection connectURISet(URISetSignal::slot_type slot);