summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-01-19 12:02:41 +0100
committerJan Holesovsky <kendy@collabora.com>2021-02-09 13:47:06 +0100
commit8e98abb60d6930670d92906a6110b80b84a003c3 (patch)
tree7338fc837cf4a91c5514d2c3d42f776614272d0e
parentc9f1be6ce897f0fcf5aae7da1ca909ac1164dca1 (diff)
pivot table: avoid crash on drag n drop
prevents from unexpected situation when user will send double request for the same drag and drop operation (slow internet connection and repeating operation) Change-Id: I8d081cf884c38b2e4f367143ad728c29b1466fbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109634 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit fbef08d9cb9c5bfc852dc23d5bafc9d057ee3bcd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109737 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-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 6b10fd8b953f..da54e26ad5a1 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -184,6 +184,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))