[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/source

Caolán McNamara caolanm at redhat.com
Tue Feb 3 03:13:00 PST 2015


 sc/source/ui/dbgui/PivotLayoutTreeListData.cxx  |   10 ++++++----
 sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx |   10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit f0fae54f44874a0da9e591f990ce5d2c906bff60
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 2 21:04:28 2015 +0000

    Related: fdo#88455 crash using delete in available fields
    
    Change-Id: I4ac5fe6f42b425ee96124b2dde39ff397a081638
    (cherry picked from commit 1746c886362b8525b04365dd6b7203b8098b99ba)
    Reviewed-on: https://gerrit.libreoffice.org/14291
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index e8f4805..33dbaa2 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -253,12 +253,14 @@ void ScPivotLayoutTreeListData::KeyInput(const KeyEvent& rKeyEvent)
     KeyCode aCode = rKeyEvent.GetKeyCode();
     sal_uInt16 nCode = aCode.GetCode();
 
-    switch (nCode)
+    if (nCode == KEY_DELETE)
     {
-        case KEY_DELETE:
-            GetModel()->Remove(GetCurEntry());
-            return;
+        const SvTreeListEntry* pEntry = GetCurEntry();
+        if (pEntry)
+            GetModel()->Remove(pEntry);
+        return;
     }
+
     SvTreeListBox::KeyInput(rKeyEvent);
 }
 
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
index a094f2a..746b512 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -80,12 +80,14 @@ void ScPivotLayoutTreeListLabel::KeyInput(const KeyEvent& rKeyEvent)
     KeyCode aCode = rKeyEvent.GetKeyCode();
     sal_uInt16 nCode = aCode.GetCode();
 
-    switch (nCode)
+    if (nCode == KEY_DELETE)
     {
-        case KEY_DELETE:
-            GetModel()->Remove(GetCurEntry());
-            return;
+        const SvTreeListEntry* pEntry = GetCurEntry();
+        if (pEntry)
+            GetModel()->Remove(pEntry);
+        return;
     }
+
     SvTreeListBox::KeyInput(rKeyEvent);
 }
 


More information about the Libreoffice-commits mailing list