summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-copy_rotate.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-02-18 12:10:14 +0000
committerJabiertxof <jtx@jtx>2017-02-18 12:10:14 +0000
commit50cff32bb7ab2fb2ab618ee5b3f4e31852e5802c (patch)
tree4405713f4584d4ebfbb483e541304165e1a27b8c /src/live_effects/lpe-copy_rotate.cpp
parentFix bug on rotate copies with one line vertical input (diff)
downloadinkscape-50cff32bb7ab2fb2ab618ee5b3f4e31852e5802c.tar.gz
inkscape-50cff32bb7ab2fb2ab618ee5b3f4e31852e5802c.zip
Fix bug 1665595 and prevent other LPE the same bug when using ACTIVE_DOCUMENT
Fixed bugs: - https://launchpad.net/bugs/1665595 (bzr r15530)
Diffstat (limited to 'src/live_effects/lpe-copy_rotate.cpp')
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index 26912115e..9ba680cd4 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -92,11 +92,13 @@ LPECopyRotate::doAfterEffect (SPLPEItem const* lpeitem)
{
if (split_items) {
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
items.clear();
container = dynamic_cast<SPObject *>(sp_lpe_item->parent);
- SPDocument * doc = SP_ACTIVE_DOCUMENT;
Inkscape::XML::Node *root = sp_lpe_item->document->getReprRoot();
- Inkscape::XML::Node *root_origin = doc->getReprRoot();
+ Inkscape::XML::Node *root_origin = document->getReprRoot();
if (root_origin != root) {
return;
}
@@ -174,6 +176,9 @@ void
LPECopyRotate::cloneD(SPObject *origin, SPObject *dest, bool root, bool reset)
{
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Document *xml_doc = document->getReprDoc();
if ( SP_IS_GROUP(origin) && SP_IS_GROUP(dest) && SP_GROUP(origin)->getItemCount() == SP_GROUP(dest)->getItemCount() ) {
std::vector< SPObject * > childs = origin->childList(true);
@@ -216,6 +221,9 @@ void
LPECopyRotate::toItem(Geom::Affine transform, size_t i, bool reset)
{
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Document *xml_doc = document->getReprDoc();
const char * elemref_id = g_strdup(Glib::ustring("rotated-").append(std::to_string(i)).append("-").append(sp_lpe_item->getRepr()->attribute("id")).c_str());
items.push_back(elemref_id);