summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-09-02 23:44:27 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-09-02 23:44:27 +0000
commitbd9e980c59453168a9d55a093564421b593e186e (patch)
tree6e577b37f7eb020878b2aa7a0cee482c685c4835 /src/selection-chemistry.cpp
parentconverted some c-string usage to c++ string class usage: should fix some memo... (diff)
downloadinkscape-bd9e980c59453168a9d55a093564421b593e186e.tar.gz
inkscape-bd9e980c59453168a9d55a093564421b593e186e.zip
Fix for 406044 : Esc with no selection, activates selection tool
(bzr r11647)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 041bc4b2d..068928d8f 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -150,11 +150,18 @@ void SelectionHelper::selectAllInAll(SPDesktop *dt)
void SelectionHelper::selectNone(SPDesktop *dt)
{
+ InkNodeTool *nt = NULL;
if (tools_isactive(dt, TOOLS_NODES)) {
- InkNodeTool *nt = static_cast<InkNodeTool*>(dt->event_context);
+ nt = static_cast<InkNodeTool*>(dt->event_context);
+ }
+
+ if (nt && !nt->_selected_nodes->empty()) {
nt->_selected_nodes->clear();
- } else {
+ } else if (!sp_desktop_selection(dt)->isEmpty()) {
sp_desktop_selection(dt)->clear();
+ } else {
+ // If nothing selected switch to selection tool
+ tools_switch(dt, TOOLS_SELECT);
}
}