diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-22 13:39:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-23 20:19:18 +0000 |
commit | 44ee9731b6ac11699cb9066a8577aba32cab7ab9 (patch) | |
tree | 76b2daf1b4b8d4780ff05c080dfdf909e7d6fa28 | |
parent | 2e6d4d4941db42184d7e7b68960a1affd7c61101 (diff) |
Resolves: fdo#88455 delete in empty data field crashes
Change-Id: I399bf576fe89283f839842959f06b8fe83f13b2b
(cherry picked from commit 66df4d7d309ce237e4979d57b1069659ece1e3a5)
Reviewed-on: https://gerrit.libreoffice.org/14110
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx index 32c55ce6b2f5..4c6121e73dbb 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) 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); } |