From e01eb5907b04fdc194551741be6c6dbf5ee6f7e5 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 21 Jan 2014 22:20:23 -0500 Subject: Improve use tag logic by recording the loaded documents in a list. (bzr r12969) --- src/document.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index cc565e3aa..e804a4980 100644 --- a/src/document.h +++ b/src/document.h @@ -25,6 +25,7 @@ #include "gc-finalized.h" #include "gc-anchored.h" #include +#include #include namespace Avoid { @@ -120,6 +121,10 @@ public: GSList *_collection_queue; + // A list of svg documents being used or shown within this document + boost::ptr_list child_documents; + SPDocument *parent_document; + bool oldSignalsConnected; /** Returns our SPRoot */ -- cgit v1.2.3 From 9a0c54cb8bc9b0bfc0c6af95f4b156fd717179a8 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 22 Jan 2014 14:58:15 -0500 Subject: Protect against infinate looping of new included hrefs (bzr r12970) --- src/document.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index e804a4980..06b2b5f6e 100644 --- a/src/document.h +++ b/src/document.h @@ -221,7 +221,8 @@ public: sigc::connection connectResourcesChanged(const gchar *key, SPDocument::ResourcesChangedSignal::slot_type slot); void fitToRect(Geom::Rect const &rect, bool with_margins = false); - static SPDocument *createNewDoc(const gchar *uri, unsigned int keepalive, bool make_new = false); + static SPDocument *createNewDoc(const gchar *uri, unsigned int keepalive, + bool make_new = false, SPDocument *parent=NULL ); static SPDocument *createNewDocFromMem(const gchar *buffer, gint length, unsigned int keepalive); /** @@ -229,8 +230,9 @@ public: */ static SPItem *getItemFromListAtPointBottom(unsigned int dkey, SPGroup *group, const GSList *list, Geom::Point const &p, bool take_insensitive = false); - // ToDo - Merge createDoc with createNewDoc - static SPDocument *createDoc(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive); + static SPDocument *createDoc(Inkscape::XML::Document *rdoc, gchar const *uri, + gchar const *base, gchar const *name, unsigned int keepalive, + SPDocument *parent); SPDocument *doRef(); SPDocument *doUnref(); -- cgit v1.2.3 From 423ea7c0373e77a83c8a9ef62df9a786b4feb7ac Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 22 Jan 2014 17:58:40 -0500 Subject: Move sub-document reference creation code from uri-reference to document.cpp as createChildDoc(path) (bzr r12971) --- src/document.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index 06b2b5f6e..79381e0c2 100644 --- a/src/document.h +++ b/src/document.h @@ -121,10 +121,6 @@ public: GSList *_collection_queue; - // A list of svg documents being used or shown within this document - boost::ptr_list child_documents; - SPDocument *parent_document; - bool oldSignalsConnected; /** Returns our SPRoot */ @@ -207,6 +203,11 @@ private: Persp3D *current_persp3d; /**< Currently 'active' perspective (to which, e.g., newly created boxes are attached) */ Persp3DImpl *current_persp3d_impl; + // A list of svg documents being used or shown within this document + boost::ptr_list _child_documents; + // Conversely this is a parent document because this is a child. + SPDocument *_parent_document; + public: sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot); sigc::connection connectReconstructionFinish(ReconstructionFinish::slot_type slot); @@ -224,6 +225,7 @@ public: static SPDocument *createNewDoc(const gchar *uri, unsigned int keepalive, bool make_new = false, SPDocument *parent=NULL ); static SPDocument *createNewDocFromMem(const gchar *buffer, gint length, unsigned int keepalive); + SPDocument *createChildDoc(gchar const *uri); /** * Returns the bottommost item from the list which is at the point, or NULL if none. -- cgit v1.2.3 From ddb8af8009f151c7107daf0c2127f0ba2d882649 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 24 Jan 2014 20:05:26 -0500 Subject: Move absolute path generator to URI and use std::strings (bzr r12977) --- src/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index 79381e0c2..110db11c6 100644 --- a/src/document.h +++ b/src/document.h @@ -225,7 +225,7 @@ public: static SPDocument *createNewDoc(const gchar *uri, unsigned int keepalive, bool make_new = false, SPDocument *parent=NULL ); static SPDocument *createNewDocFromMem(const gchar *buffer, gint length, unsigned int keepalive); - SPDocument *createChildDoc(gchar const *uri); + SPDocument *createChildDoc(std::string const uri); /** * Returns the bottommost item from the list which is at the point, or NULL if none. -- cgit v1.2.3 From 7455f1a259ce28ee56866b5cde06e79be4cfaf97 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sun, 26 Jan 2014 12:19:47 -0500 Subject: Check file existance and clean up memory issues thanks to KK and Johan (bzr r12979) --- src/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.h') diff --git a/src/document.h b/src/document.h index 110db11c6..e5567d3b6 100644 --- a/src/document.h +++ b/src/document.h @@ -225,7 +225,7 @@ public: static SPDocument *createNewDoc(const gchar *uri, unsigned int keepalive, bool make_new = false, SPDocument *parent=NULL ); static SPDocument *createNewDocFromMem(const gchar *buffer, gint length, unsigned int keepalive); - SPDocument *createChildDoc(std::string const uri); + SPDocument *createChildDoc(std::string const &uri); /** * Returns the bottommost item from the list which is at the point, or NULL if none. -- cgit v1.2.3