diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-09-02 23:44:27 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-09-02 23:44:27 +0000 |
| commit | bd9e980c59453168a9d55a093564421b593e186e (patch) | |
| tree | 6e577b37f7eb020878b2aa7a0cee482c685c4835 /src/selection-chemistry.cpp | |
| parent | converted some c-string usage to c++ string class usage: should fix some memo... (diff) | |
| download | inkscape-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.cpp | 11 |
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); } } |
