summaryrefslogtreecommitdiffstats
path: root/src/ui/tool
diff options
context:
space:
mode:
authorIan Bruce <ian_bruce@mail.ru>2018-07-29 07:56:35 +0000
committerMartin Owens <doctormo@gmail.com>2019-03-03 02:03:36 +0000
commitf70b4daa0d53567b20bde6d86b69c1f89be402c8 (patch)
tree7bb44c4d3c8fd96245780a6eef458dcd73f87bf2 /src/ui/tool
parentUpdat extensions to latest version (diff)
downloadinkscape-f70b4daa0d53567b20bde6d86b69c1f89be402c8.tar.gz
inkscape-f70b4daa0d53567b20bde6d86b69c1f89be402c8.zip
temporary fix for bug where undo/redo does not restore node-type changes
This is not intended to be a permanent patch, but to point out the actual source of a problem where undo/redo does not work for node-type changes. It works by disabling the function of the PathManipulator::_nodetypesKey() method, to match some breakage which has apparently occurred somewhere else. Presumably, somebody would know where that was. Once that is located and fixed, this patch will be unnecessary, except for a minor code cleanup. At that point, the functional change would itself constitute a bug, instead of a temporary fix. Full details are available at <https://bugs.launchpad.net/inkscape/+bug/1780775>.
Diffstat (limited to 'src/ui/tool')
-rw-r--r--src/ui/tool/path-manipulator.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index d5e111c7b..8309dbe0e 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -193,20 +193,23 @@ void PathManipulator::writeXML()
{
if (!_live_outline)
_updateOutline();
+
_setGeometry();
- if (!_path) return;
- _observer->block();
- if (!empty()) {
- _path->updateRepr();
- _getXMLNode()->setAttribute(_nodetypesKey().data(), _createTypeString().data());
- } else {
- // this manipulator will have to be destroyed right after this call
- _getXMLNode()->removeObserver(*_observer);
- _path->deleteObject(true, true);
- _path = nullptr;
+ if (_path) {
+ _observer->block();
+ if (!empty()) {
+ _path->updateRepr();
+ _getXMLNode()->setAttribute(_nodetypesKey().data(), _createTypeString().data());
+ }
+ else {
+ // this manipulator will have to be destroyed right after this call
+ _getXMLNode()->removeObserver(*_observer);
+ _path->deleteObject(true, true);
+ _path = nullptr;
+ }
+ _observer->unblock();
}
- _observer->unblock();
}
/** Remove all nodes from the path. */
@@ -1522,8 +1525,12 @@ void PathManipulator::_setGeometry()
/** Figure out in what attribute to store the nodetype string. */
Glib::ustring PathManipulator::_nodetypesKey()
{
- if (_lpe_key.empty()) return "sodipodi:nodetypes";
- return _lpe_key + "-nodetypes";
+ // temporary fix
+ // if (_lpe_key.empty())
+ if (false)
+ return ("sodipodi:nodetypes");
+ else
+ return (_lpe_key + "-nodetypes");
}
/** Return the XML node we are editing.