summaryrefslogtreecommitdiff
path: root/sc/source/core/tool
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-04-08 10:12:16 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-04-08 10:40:57 +0200
commita0d2fb3217094aa7158310f0bcf16093bcc4984f (patch)
treeeb0cdbe2b1ac502acb0ce0dd7b2de37de2475270 /sc/source/core/tool
parenta4d69d2a7680d4c8062119d2b9dab1df7c2b574d (diff)
tdf#141547: maQueryItems can be 0
E.g., fillQueryParam (sc/source/ui/unoobj/datauno.cxx) may clear it and leave empty if relevant input item is empty. Note how commit e4b924df8f9ad02c66549751cb8e123e420e8508 had changed the same checks in ScQueryEntry::IsQueryBy[Non]Empty. Change-Id: I552462c72e69ddce43711bcff645dc6c7b133db7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113783 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r--sc/source/core/tool/queryentry.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/sc/source/core/tool/queryentry.cxx b/sc/source/core/tool/queryentry.cxx
index 465bbd805e03..a295759e0c3c 100644
--- a/sc/source/core/tool/queryentry.cxx
+++ b/sc/source/core/tool/queryentry.cxx
@@ -115,17 +115,9 @@ bool ScQueryEntry::IsQueryByNonEmpty() const
rItem.mfVal == SC_NONEMPTYFIELDS;
}
-const ScQueryEntry::Item& ScQueryEntry::GetQueryItem() const
+ScQueryEntry::Item& ScQueryEntry::GetQueryItemImpl() const
{
- if (maQueryItems.size() > 1)
- // Reset to a single query mode.
- maQueryItems.resize(1);
- return maQueryItems[0];
-}
-
-ScQueryEntry::Item& ScQueryEntry::GetQueryItem()
-{
- if (maQueryItems.size() > 1)
+ if (maQueryItems.size() != 1)
// Reset to a single query mode.
maQueryItems.resize(1);
return maQueryItems[0];