summaryrefslogtreecommitdiffstats
path: root/src/dyna-draw-context.cpp
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-09-28 19:02:40 +0000
committerMarkus Engel <markus.engel@tum.de>2013-09-28 19:02:40 +0000
commitcfb97f009e1a5f7e6908f53b7af47cf4d93614f6 (patch)
tree2eaee250bfd429abab799a8dc7ecd16edc3e049e /src/dyna-draw-context.cpp
parentfix one code path where fullname wasn't freed (diff)
downloadinkscape-cfb97f009e1a5f7e6908f53b7af47cf4d93614f6.tar.gz
inkscape-cfb97f009e1a5f7e6908f53b7af47cf4d93614f6.zip
Fixed crash with calligraphic tool in subtract mode.
Fixed bugs: - https://launchpad.net/bugs/1230007 (bzr r12615)
Diffstat (limited to 'src/dyna-draw-context.cpp')
-rw-r--r--src/dyna-draw-context.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp
index 01f71f76a..f8980e218 100644
--- a/src/dyna-draw-context.cpp
+++ b/src/dyna-draw-context.cpp
@@ -954,9 +954,20 @@ void SPDynaDrawContext::set_to_accumulated(bool unionize, bool subtract) {
}
}
- SPItem *item=SP_ITEM(desktop->doc()->getObjectByRepr(this->repr));
- item->doWriteTransform(item->getRepr(), item->transform, NULL, true);
+ // Now we need to write the transform information.
+ // First, find out whether our repr is still linked to a valid object. In this case,
+ // we need to write the transform data only for this element.
+ // Either there was no boolean op or it failed.
+ SPItem *result = SP_ITEM(desktop->doc()->getObjectByRepr(this->repr));
+
+ if (result == NULL) {
+ // The boolean operation succeeded.
+ // Now we fetch the single item, that has been set as selected by the boolean op.
+ // This is its result.
+ result = desktop->getSelection()->singleItem();
+ }
+ result->doWriteTransform(result->getRepr(), result->transform, NULL, true);
} else {
if (this->repr) {
sp_repr_unparent(this->repr);