diff options
| author | Shlomi Fish <shlomif@shlomifish.org> | 2016-09-15 17:03:32 +0000 |
|---|---|---|
| committer | Shlomi Fish <shlomif@shlomifish.org> | 2016-09-15 17:03:32 +0000 |
| commit | 3bb19d6df3b7d4e9c2518484e62997f9150d5f5d (patch) | |
| tree | 3ac3c8748744b75c468d8c55d8eec27b841cfbb0 /src/sp-item.cpp | |
| parent | Refactor == true (diff) | |
| parent | [Bug #459914] Non-ascii (ja) charactors aren't displayed properly in Handle t... (diff) | |
| download | inkscape-3bb19d6df3b7d4e9c2518484e62997f9150d5f5d.tar.gz inkscape-3bb19d6df3b7d4e9c2518484e62997f9150d5f5d.zip | |
Merged.
(bzr r15100.1.17)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 0ba74f9fd..e03b715c0 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -317,8 +317,11 @@ void SPItem::lowerOne() { auto next_lower = find_last_if(parent->children.begin(), parent->children.iterator_to(*this), &is_item); if (next_lower != parent->children.iterator_to(*this)) { - next_lower--; - Inkscape::XML::Node *ref = next_lower->getRepr(); + Inkscape::XML::Node *ref = nullptr; + if (next_lower != parent->children.begin()) { + next_lower--; + ref = next_lower->getRepr(); + } getRepr()->parent()->changeOrder(getRepr(), ref); } } @@ -326,8 +329,11 @@ void SPItem::lowerOne() { void SPItem::lowerToBottom() { auto bottom = std::find_if(parent->children.begin(), parent->children.iterator_to(*this), &is_item); if (bottom != parent->children.iterator_to(*this)) { - bottom--; - Inkscape::XML::Node *ref = bottom->getRepr() ; + Inkscape::XML::Node *ref = nullptr; + if (bottom != parent->children.begin()) { + bottom--; + ref = bottom->getRepr(); + } parent->getRepr()->changeOrder(getRepr(), ref); } } |
