From d832c91bf21f6649c1ca7b35bfa7ac67b7832cc3 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Mon, 14 Mar 2016 23:37:29 -0400 Subject: Commit to using our stored units for now. (bzr r14707) --- src/widgets/text-toolbar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp index c49f0bc05..60e932338 100644 --- a/src/widgets/text-toolbar.cpp +++ b/src/widgets/text-toolbar.cpp @@ -1106,9 +1106,11 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/ lh_unit = unit_table.getUnit("%"); height = query.line_height.value * 100; } else { - lh_unit = tracker->getActiveUnit(); - // Can get unit like this: unit_table.getUnit(query.line_height.unit); - height = Inkscape::Util::Quantity::convert(query.line_height.computed, "px", lh_unit); + //Unit const *active = tracker->getActiveUnit(); + // This allows us to show the unit stored to the user, but right now + // it's always px (because Tav said other units are broken/2016) + lh_unit = unit_table.getUnit(query.line_height.unit); + height = query.line_height.computed; } // Set before value is set -- cgit v1.2.3 From c1a9b9773542b5a5de771a06a20834f38bb2da90 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 15 Mar 2016 22:38:20 +0100 Subject: fix-bug-1557192. paint-order crash with multiple items Fixed bugs: - https://launchpad.net/bugs/1557192 (bzr r14708) --- src/desktop-style.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index c28302d22..d10c75cd8 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -1004,10 +1004,10 @@ objects_query_paintorder (const std::vector &objects, SPStyle *style_re n_order ++; - if (!prev_order.empty() && prev_order.compare( style->paint_order.value ) != 0) { - same_order = false; - } if (style->paint_order.set) { + if (!prev_order.empty() && prev_order.compare( style->paint_order.value ) != 0) { + same_order = false; + } prev_order = style->paint_order.value; } } -- cgit v1.2.3 From 67901523e5dc2f6ba839550bd5790fe143c3143e Mon Sep 17 00:00:00 2001 From: raphael0202 Date: Wed, 16 Mar 2016 18:20:29 +0100 Subject: [Bug #1558153] Typos and tabs instead of spaces in extension module. Fixed bugs: - https://launchpad.net/bugs/1558153 (bzr r14713) --- src/extension/implementation/implementation.h | 24 ++++++++++++------------ src/extension/implementation/script.cpp | 18 +++++++++--------- src/extension/init.cpp | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index f6f933aaf..1232ae0c8 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -18,7 +18,7 @@ #include <2geom/forward.h> namespace Gtk { - class Widget; + class Widget; } class SPDocument; @@ -33,7 +33,7 @@ class View; } // namespace UI namespace XML { - class Node; + class Node; } // namespace XML namespace Extension { @@ -51,18 +51,18 @@ namespace Implementation { */ class ImplementationDocumentCache { - /** + /** * The document that this instance is working on. */ - Inkscape::UI::View::View * _view; + Inkscape::UI::View::View * _view; public: - ImplementationDocumentCache (Inkscape::UI::View::View * view) : - _view(view) - { - return; - }; - virtual ~ImplementationDocumentCache ( ) { return; }; - Inkscape::UI::View::View const * view ( ) { return _view; }; + ImplementationDocumentCache (Inkscape::UI::View::View * view) : + _view(view) + { + return; + }; + virtual ~ImplementationDocumentCache ( ) { return; }; + Inkscape::UI::View::View const * view ( ) { return _view; }; }; /** @@ -116,7 +116,7 @@ public: // ----- Effect functions ----- /** Find out information about the file. */ virtual Gtk::Widget * prefs_effect(Inkscape::Extension::Effect *module, - Inkscape::UI::View::View *view, + Inkscape::UI::View::View *view, sigc::signal *changeSignal, ImplementationDocumentCache *docCache); virtual void effect(Inkscape::Extension::Effect * /*module*/, diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index 4cb0c9b73..f990598eb 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -152,7 +152,7 @@ Script::Script() : } /** - * brief Destructor + * \brief Destructor */ Script::~Script() { @@ -280,9 +280,9 @@ bool Script::check_existence(const std::string &command) /** \return none - \brief This function 'loads' an extention, basically it determines - the full command for the extention and stores that. - \param module The extention to be loaded. + \brief This function 'loads' an extension, basically it determines + the full command for the extension and stores that. + \param module The extension to be loaded. The most difficult part about this function is finding the actual command through all of the Reprs. Basically it is hidden down a @@ -292,7 +292,7 @@ bool Script::check_existence(const std::string &command) At that point all of the loops are exited, and there is an if statement to make sure they didn't exit because of not finding - the command. If that's the case, the extention doesn't get loaded + the command. If that's the case, the extension doesn't get loaded and should error out at a higher level. */ @@ -545,17 +545,17 @@ SPDocument *Script::open(Inkscape::Extension::Input *module, /** \return none - \brief This function uses an extention to save a document. It first + \brief This function uses an extension to save a document. It first creates an SVG file of the document, and then runs it through the script. - \param module Extention to be used + \param module Extension to be used \param doc Document to be saved \param filename The name to save the final file as \return false in case of any failure writing the file, otherwise true Well, at some point people need to save - it is really what makes the entire application useful. And, it is possible that someone - would want to use an extetion for this, so we need a function to + would want to use an extension for this, so we need a function to do that eh? First things first, the document is saved to a temporary file that @@ -563,7 +563,7 @@ SPDocument *Script::open(Inkscape::Extension::Input *module, ink_ext_ as a prefix. Don't worry, this file gets deleted at the end of the function. - After we have the SVG file, then extention_execute is called with + After we have the SVG file, then Script::execute is called with the temporary file name and the final output filename. This should put the output of the script into the final output file. We then delete the temporary file. diff --git a/src/extension/init.cpp b/src/extension/init.cpp index c16a5a899..af7af2cb1 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -1,6 +1,6 @@ /* * This is what gets executed to initialize all of the modules. For - * the internal modules this invovles executing their initialization + * the internal modules this involves executing their initialization * functions, for external ones it involves reading their .spmodule * files and bringing them into Sodipodi. * -- cgit v1.2.3 From b288e8e5d98684ae81c109a4c4ffa1d25fc4d727 Mon Sep 17 00:00:00 2001 From: raphael0202 Date: Fri, 18 Mar 2016 08:04:08 +0100 Subject: [Bug #1558177] Simplify if conditions in Script.cpp. Fixed bugs: - https://launchpad.net/bugs/1558177 (bzr r14715) --- src/extension/implementation/script.cpp | 6 +----- src/extension/output.cpp | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index f990598eb..2ec17f947 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -232,11 +232,7 @@ bool Script::check_existence(const std::string &command) //Don't search when it is an absolute path. */ if (Glib::path_is_absolute(command)) { - if (Glib::file_test(command, Glib::FILE_TEST_EXISTS)) { - return true; - } else { - return false; - } + return Glib::file_test(command, Glib::FILE_TEST_EXISTS); } // First search in the current directory diff --git a/src/extension/output.cpp b/src/extension/output.cpp index 8de5583c7..83f0fed2f 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -192,8 +192,7 @@ Output::prefs (void) delete dialog; - if (response == Gtk::RESPONSE_OK) return true; - return false; + return (response == Gtk::RESPONSE_OK); } /** -- cgit v1.2.3 From fbc8d89437445c1024ab4ef2e838f177f408f9f1 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 18 Mar 2016 10:16:49 +0100 Subject: Fix writing of 'x' and 'y' attributes in multiline text via sodipode:role="line". (bzr r14716) --- src/sp-text.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 4a5b1b1d6..7d4348d19 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -819,8 +819,8 @@ void TextTagAttributes::setFirstXY(Geom::Point &point) attributes.x.resize(1, zero_length); if (attributes.y.empty()) attributes.y.resize(1, zero_length); - attributes.x[0].computed = point[Geom::X]; - attributes.y[0].computed = point[Geom::Y]; + attributes.x[0] = point[Geom::X]; + attributes.y[0] = point[Geom::Y]; } void TextTagAttributes::mergeInto(Inkscape::Text::Layout::OptionalTextTagAttrs *output, Inkscape::Text::Layout::OptionalTextTagAttrs const &parent_attrs, unsigned parent_attrs_offset, bool copy_xy, bool copy_dxdyrotate) const -- cgit v1.2.3 From ae7a4f0320d820a6183dde933fba576bc2c9f58f Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 18 Mar 2016 18:34:07 +0100 Subject: Bug #1419517 Fix Crash when applying new path effect after deleting pattern of Pattern-along-path LPE Fixed bugs: - https://launchpad.net/bugs/1419517 (bzr r14717) --- src/live_effects/parameter/path.cpp | 7 ++++++- src/sp-object.cpp | 15 +++++++-------- src/ui/tool/path-manipulator.cpp | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp index e0369e662..7ea1d465c 100644 --- a/src/live_effects/parameter/path.cpp +++ b/src/live_effects/parameter/path.cpp @@ -294,7 +294,12 @@ void PathParam::set_new_value (Geom::PathVector const &newpath, bool write_to_svg) { remove_link(); - _pathvector = newpath; + if (newpath.empty()) { + param_set_and_write_default(); + return; + } else { + _pathvector = newpath; + } must_recalculate_pwd2 = true; if (write_to_svg) { diff --git a/src/sp-object.cpp b/src/sp-object.cpp index db66eb3e6..7dbc51b84 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -958,16 +958,15 @@ void SPObject::readAttr(gchar const *key) //g_assert(object != NULL); //g_assert(SP_IS_OBJECT(object)); g_assert(key != NULL); - //XML Tree being used here. - g_assert(this->getRepr() != NULL); + if (this->getRepr() != NULL ) { + unsigned int keyid = sp_attribute_lookup(key); + if (keyid != SP_ATTR_INVALID) { + /* Retrieve the 'key' attribute from the object's XML representation */ + gchar const *value = this->getRepr()->attribute(key); - unsigned int keyid = sp_attribute_lookup(key); - if (keyid != SP_ATTR_INVALID) { - /* Retrieve the 'key' attribute from the object's XML representation */ - gchar const *value = getRepr()->attribute(key); - - setKeyValue(keyid, value); + setKeyValue(keyid, value); + } } } diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index f4790c317..3b25439f3 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1492,7 +1492,6 @@ void PathManipulator::_getGeometry() void PathManipulator::_setGeometry() { using namespace Inkscape::LivePathEffect; - if (empty()) return; if (!_lpe_key.empty()) { // copied from nodepath.cpp @@ -1505,6 +1504,7 @@ void PathManipulator::_setGeometry() LIVEPATHEFFECT(_path)->requestModified(SP_OBJECT_MODIFIED_FLAG); } } else { + if (empty()) return; //XML Tree being used here directly while it shouldn't be. if (_path->getRepr()->attribute("inkscape:original-d")) _path->set_original_curve(_spcurve, false, false); -- cgit v1.2.3 From 4596974f9ee43a2f5700e3daa468474179aaa829 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 18 Mar 2016 18:58:10 +0100 Subject: Remove code of a semifixed bug (bzr r14718) --- src/sp-object.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 7dbc51b84..db66eb3e6 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -958,15 +958,16 @@ void SPObject::readAttr(gchar const *key) //g_assert(object != NULL); //g_assert(SP_IS_OBJECT(object)); g_assert(key != NULL); + //XML Tree being used here. - if (this->getRepr() != NULL ) { - unsigned int keyid = sp_attribute_lookup(key); - if (keyid != SP_ATTR_INVALID) { - /* Retrieve the 'key' attribute from the object's XML representation */ - gchar const *value = this->getRepr()->attribute(key); + g_assert(this->getRepr() != NULL); - setKeyValue(keyid, value); - } + unsigned int keyid = sp_attribute_lookup(key); + if (keyid != SP_ATTR_INVALID) { + /* Retrieve the 'key' attribute from the object's XML representation */ + gchar const *value = getRepr()->attribute(key); + + setKeyValue(keyid, value); } } -- cgit v1.2.3