summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-measure-line.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-measure-line.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-measure-line.cpp')
-rw-r--r--src/live_effects/lpe-measure-line.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp
index ef87be81c..625db150b 100644
--- a/src/live_effects/lpe-measure-line.cpp
+++ b/src/live_effects/lpe-measure-line.cpp
@@ -171,6 +171,9 @@ void
LPEMeasureLine::createArrowMarker(const char * mode)
{
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Document *xml_doc = document->getReprDoc();
SPObject *elemref = NULL;
Inkscape::XML::Node *arrow = NULL;
@@ -232,6 +235,9 @@ void
LPEMeasureLine::createTextLabel(Geom::Point pos, double length, Geom::Coord angle, bool remove, bool valid)
{
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Document *xml_doc = document->getReprDoc();
Inkscape::XML::Node *rtext = NULL;
double doc_w = document->getRoot()->width.value;
@@ -376,6 +382,9 @@ void
LPEMeasureLine::createLine(Geom::Point start,Geom::Point end, const char * id, bool main, bool overflow, bool remove, bool arrows)
{
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Document *xml_doc = document->getReprDoc();
SPObject *elemref = NULL;
Inkscape::XML::Node *line = NULL;
@@ -500,6 +509,9 @@ LPEMeasureLine::doBeforeEffect (SPLPEItem const* lpeitem)
SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeitem);
sp_lpe_item->parent = dynamic_cast<SPObject *>(splpeitem->parent);
SPDocument * document = SP_ACTIVE_DOCUMENT;
+ if (!document) {
+ return;
+ }
Inkscape::XML::Node *root = splpeitem->document->getReprRoot();
Inkscape::XML::Node *root_origin = document->getReprRoot();
if (root_origin != root) {