summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-02 21:04:28 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-02-03 12:22:40 +0100
commitb195fc7549dd17fb659795ea9e916af99f9909b5 (patch)
tree4211f5937e9ab50a63efafd6f3b377d22cce5f79 /sc
parent86ea9493fda77e6aa5e6ebd666b2d8306057d6cc (diff)
Related: fdo#88455 crash using delete in available fields
Change-Id: I4ac5fe6f42b425ee96124b2dde39ff397a081638 (cherry picked from commit 1746c886362b8525b04365dd6b7203b8098b99ba) Reviewed-on: https://gerrit.libreoffice.org/14290 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListData.cxx10
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx10
2 files changed, 12 insertions, 8 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index 2d5365343df9..a2c78e9507f4 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 6617b0b03c4a..013ce2c27b28 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -78,12 +78,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);
}