From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/sp-rect.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 2ba9a7023..40107096f 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -12,12 +12,10 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif - #include "display/curve.h" -#include <2geom/rect.h> #include "inkscape.h" #include "document.h" @@ -25,7 +23,6 @@ #include "style.h" #include "sp-rect.h" #include -#include "xml/repr.h" #include "sp-guide.h" #include "preferences.h" -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/sp-rect.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 40107096f..2ba9a7023 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -12,10 +12,12 @@ */ #ifdef HAVE_CONFIG_H -#include +# include "config.h" #endif + #include "display/curve.h" +#include <2geom/rect.h> #include "inkscape.h" #include "document.h" @@ -23,6 +25,7 @@ #include "style.h" #include "sp-rect.h" #include +#include "xml/repr.h" #include "sp-guide.h" #include "preferences.h" -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/sp-rect.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 2ba9a7023..40107096f 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -12,12 +12,10 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif - #include "display/curve.h" -#include <2geom/rect.h> #include "inkscape.h" #include "document.h" @@ -25,7 +23,6 @@ #include "style.h" #include "sp-rect.h" #include -#include "xml/repr.h" #include "sp-guide.h" #include "preferences.h" -- cgit v1.2.3 From f273f14eb1b54861f1b3a7eb622cb481ee33cec9 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 26 Sep 2016 13:26:47 +0200 Subject: Fix undo/redo for mesh gradients. (bzr r15135) --- src/sp-rect.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 40107096f..88dad5354 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -28,6 +28,7 @@ #define noRECT_VERBOSE +//#define OBJECT_TRACE SPRect::SPRect() : SPShape() { } @@ -36,6 +37,10 @@ SPRect::~SPRect() { } void SPRect::build(SPDocument* doc, Inkscape::XML::Node* repr) { +#ifdef OBJECT_TRACE + objectTrace( "SPRect::build" ); +#endif + SPShape::build(doc, repr); this->readAttr("x"); @@ -44,9 +49,20 @@ void SPRect::build(SPDocument* doc, Inkscape::XML::Node* repr) { this->readAttr("height"); this->readAttr("rx"); this->readAttr("ry"); + +#ifdef OBJECT_TRACE + objectTrace( "SPRect::build", false ); +#endif } void SPRect::set(unsigned key, gchar const *value) { + +#ifdef OBJECT_TRACE + std::stringstream temp; + temp << "SPRect::set: " << key << " " << (value?value:"null"); + objectTrace( temp.str() ); +#endif + /* fixme: We need real error processing some time */ // We must update the SVGLengths immediately or nodes may be misplaced after they are moved. @@ -104,9 +120,17 @@ void SPRect::set(unsigned key, gchar const *value) { SPShape::set(key, value); break; } +#ifdef OBJECT_TRACE + objectTrace( "SPRect::set", false ); +#endif } void SPRect::update(SPCtx* ctx, unsigned int flags) { + +#ifdef OBJECT_TRACE + objectTrace( "SPRect::update", true, flags ); +#endif + if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) { SPItemCtx const *ictx = reinterpret_cast(ctx); @@ -127,9 +151,17 @@ void SPRect::update(SPCtx* ctx, unsigned int flags) { } SPShape::update(ctx, flags); +#ifdef OBJECT_TRACE + objectTrace( "SPRect::update", false, flags ); +#endif } Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + +#ifdef OBJECT_TRACE + objectTrace( "SPRect::write", true, flags ); +#endif + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = xml_doc->createElement("svg:rect"); } @@ -151,6 +183,10 @@ Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape:: this->set_shape(); // evaluate SPCurve SPShape::write(xml_doc, repr, flags); +#ifdef OBJECT_TRACE + objectTrace( "SPRect::write", false, flags ); +#endif + return repr; } -- cgit v1.2.3 From b6875ce1916a57c9e13cfc0b8fd63fa522b1e449 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Jan 2017 17:03:42 +0100 Subject: Actually unsets attribute instead of ignoring it when it's 0 Fixed bugs: - https://launchpad.net/bugs/481805 (bzr r15420) --- src/sp-rect.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 88dad5354..e69cdfc7b 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -120,6 +120,7 @@ void SPRect::set(unsigned key, gchar const *value) { SPShape::set(key, value); break; } + updateRepr(); #ifdef OBJECT_TRACE objectTrace( "SPRect::set", false ); #endif @@ -171,10 +172,14 @@ Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape:: if (this->rx._set) { sp_repr_set_svg_length(repr, "rx", this->rx); + } else { + repr->setAttribute("rx", NULL); } if (this->ry._set) { sp_repr_set_svg_length(repr, "ry", this->ry); + } else { + repr->setAttribute("ry", NULL); } sp_repr_set_svg_length(repr, "x", this->x); -- cgit v1.2.3 From dda1f59f8916265c7ef0a5de8ef4497a09cfc1da Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Jan 2017 15:56:11 +0100 Subject: revert 15420 because of severe regression (bzr r15423) --- src/sp-rect.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/sp-rect.cpp') diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index e69cdfc7b..88dad5354 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -120,7 +120,6 @@ void SPRect::set(unsigned key, gchar const *value) { SPShape::set(key, value); break; } - updateRepr(); #ifdef OBJECT_TRACE objectTrace( "SPRect::set", false ); #endif @@ -172,14 +171,10 @@ Inkscape::XML::Node * SPRect::write(Inkscape::XML::Document *xml_doc, Inkscape:: if (this->rx._set) { sp_repr_set_svg_length(repr, "rx", this->rx); - } else { - repr->setAttribute("rx", NULL); } if (this->ry._set) { sp_repr_set_svg_length(repr, "ry", this->ry); - } else { - repr->setAttribute("ry", NULL); } sp_repr_set_svg_length(repr, "x", this->x); -- cgit v1.2.3