summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-19 12:02:41 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2021-01-21 07:50:16 +0100
commitfbef08d9cb9c5bfc852dc23d5bafc9d057ee3bcd (patch)
tree53f49a0f9d49a1e96ffb75c6bcc809fa4c8d9ed3 /sc
parent30ee1dc7d3e479cf5f77452acf163ff61e2697da (diff)
pivot table: avoid crash on drag n drop
Change-Id: I8d081cf884c38b2e4f367143ad728c29b1466fbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109634 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListData.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index 95d36776a5d7..0dad394bda80 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -177,6 +177,9 @@ void ScPivotLayoutTreeListData::PushDataFieldNames(std::vector<ScDPName>& rDataF
void ScPivotLayoutTreeListData::InsertEntryForSourceTarget(weld::TreeView& rSource, int nTarget)
{
+ if (rSource.count_selected_rows() <=0)
+ return;
+
ScItemValue* pItemValue = reinterpret_cast<ScItemValue*>(rSource.get_selected_id().toInt64());
if (mpParent->IsDataElement(pItemValue->maFunctionData.mnCol))