summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2016-09-15 17:03:32 +0000
committerShlomi Fish <shlomif@shlomifish.org>2016-09-15 17:03:32 +0000
commit3bb19d6df3b7d4e9c2518484e62997f9150d5f5d (patch)
tree3ac3c8748744b75c468d8c55d8eec27b841cfbb0 /src/sp-item.cpp
parentRefactor == true (diff)
parent[Bug #459914] Non-ascii (ja) charactors aren't displayed properly in Handle t... (diff)
downloadinkscape-3bb19d6df3b7d4e9c2518484e62997f9150d5f5d.tar.gz
inkscape-3bb19d6df3b7d4e9c2518484e62997f9150d5f5d.zip
Merged.
(bzr r15100.1.17)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp14
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);
}
}