diff options
Diffstat (limited to 'sc/source/core/tool/queryparam.cxx')
-rw-r--r-- | sc/source/core/tool/queryparam.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index 00c7ba333880..099b55d4622e 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -22,6 +22,7 @@ #include "scmatrix.hxx" #include <svl/sharedstringpool.hxx> +#include <svl/zforlist.hxx> #include <osl/diagnose.h> namespace { @@ -171,7 +172,7 @@ void ScQueryParamBase::Resize(size_t nNew) } void ScQueryParamBase::FillInExcelSyntax( - svl::SharedStringPool& rPool, const OUString& rStr, SCSIZE nIndex) + svl::SharedStringPool& rPool, const OUString& rStr, SCSIZE nIndex, SvNumberFormatter* pFormatter ) { const OUString aCellStr = rStr; if (nIndex >= maEntries.size()) @@ -226,6 +227,20 @@ void ScQueryParamBase::FillInExcelSyntax( rEntry.eOp = SC_EQUAL; } } + + if (pFormatter) + { + sal_uInt32 nFormat = 0; + bool bNumber = pFormatter->IsNumberFormat( rItem.maString.getString(), nFormat, rItem.mfVal); + rItem.meType = bNumber ? ScQueryEntry::ByValue : ScQueryEntry::ByString; + + /* TODO: pFormatter currently is also used as a flag whether matching + * empty cells with an empty string is triggered from the interpreter. + * This could be handled independently if all queries should support + * it, needs to be evaluated if that actually is desired. */ + if (rItem.meType == ScQueryEntry::ByString) + rItem.mbMatchEmpty = (rEntry.eOp == SC_EQUAL && rItem.maString.isEmpty()); + } } ScQueryParamTable::ScQueryParamTable() : |