From fbef08d9cb9c5bfc852dc23d5bafc9d057ee3bcd Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Tue, 19 Jan 2021 12:02:41 +0100 Subject: pivot table: avoid crash on drag n drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8d081cf884c38b2e4f367143ad728c29b1466fbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109634 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sc/source/ui/dbgui/PivotLayoutTreeListData.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc') 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& rDataF void ScPivotLayoutTreeListData::InsertEntryForSourceTarget(weld::TreeView& rSource, int nTarget) { + if (rSource.count_selected_rows() <=0) + return; + ScItemValue* pItemValue = reinterpret_cast(rSource.get_selected_id().toInt64()); if (mpParent->IsDataElement(pItemValue->maFunctionData.mnCol)) -- cgit