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

Caolán McNamara caolanm at redhat.com
Thu Jan 22 07:11:26 PST 2015


 sc/source/ui/dbgui/PivotLayoutTreeList.cxx |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit c06f0d71e16ffe68836441d125a4c1eb50d5ccda
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 22 13:39:21 2015 +0000

    Resolves: fdo#88455 delete in empty data field crashes
    
    Change-Id: I399bf576fe89283f839842959f06b8fe83f13b2b
    (cherry picked from commit 66df4d7d309ce237e4979d57b1069659ece1e3a5)
    Reviewed-on: https://gerrit.libreoffice.org/14108
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
index 7f75da8..dcfdae3 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
@@ -38,7 +38,11 @@ void ScPivotLayoutTreeList::Setup(ScPivotLayoutDialog* pParent, SvPivotTreeListT
 
 bool ScPivotLayoutTreeList::DoubleClickHdl()
 {
-    ScItemValue* pCurrentItemValue = (ScItemValue*) GetCurEntry()->GetUserData();
+    SvTreeListEntry* pEntry = GetCurEntry();
+    if (!pEntry)
+        return false;
+
+    ScItemValue* pCurrentItemValue = (ScItemValue*) pEntry->GetUserData();
     ScPivotFuncData& rCurrentFunctionData = pCurrentItemValue->maFunctionData;
 
     if (mpParent->IsDataElement(rCurrentFunctionData.mnCol))
@@ -105,11 +109,12 @@ void ScPivotLayoutTreeList::KeyInput(const KeyEvent& rKeyEvent)
     vcl::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