Kaydet (Commit) cff2f333 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Add isEmpty() to SharedString. This simplies a lot of its call sites.

Change-Id: I0ebc43abe59ac317c053a4f606dbe376d85c03b0
üst a11e224e
......@@ -40,6 +40,7 @@ public:
const rtl_uString* getDataIgnoreCase() const;
bool isValid() const;
bool isEmpty() const;
};
}
......
......@@ -1487,7 +1487,7 @@ public:
// Simple string matching i.e. no regexp match.
if (isTextMatchOp(rEntry))
{
if (rItem.meType != ScQueryEntry::ByString && rItem.maString.getString().isEmpty())
if (rItem.meType != ScQueryEntry::ByString && rItem.maString.isEmpty())
{
// #i18374# When used from functions (match, countif, sumif, vlookup, hlookup, lookup),
// the query value is assigned directly, and the string is empty. In that case,
......
......@@ -976,7 +976,7 @@ double ScInterpreter::CompareFunc( const ScCompare& rComp, ScCompareOptions* pOp
if (!rItems.empty())
{
const ScQueryEntry::Item& rItem = rItems[0];
if (rItem.meType != ScQueryEntry::ByString && !rItem.maString.getString().isEmpty() &&
if (rItem.meType != ScQueryEntry::ByString && !rItem.maString.isEmpty() &&
(rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL))
{
// As in ScTable::ValidQuery() match a numeric string for a
......
......@@ -107,7 +107,7 @@ bool ScQueryEntry::IsQueryByEmpty() const
const Item& rItem = maQueryItems[0];
return eOp == SC_EQUAL &&
rItem.meType == ByEmpty &&
rItem.maString.getString().isEmpty() &&
rItem.maString.isEmpty() &&
rItem.mfVal == SC_EMPTYFIELDS;
}
......@@ -129,7 +129,7 @@ bool ScQueryEntry::IsQueryByNonEmpty() const
const Item& rItem = maQueryItems[0];
return eOp == SC_EQUAL &&
rItem.meType == ByEmpty &&
rItem.maString.getString().isEmpty() &&
rItem.maString.isEmpty() &&
rItem.mfVal == SC_NONEMPTYFIELDS;
}
......
......@@ -113,6 +113,11 @@ bool SharedString::isValid() const
return mpData != NULL;
}
bool SharedString::isEmpty() const
{
return mpData == NULL || mpData->length == 0;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment