Kaydet (Commit) 6046207e authored tarafından Eike Rathke's avatar Eike Rathke

resolved fdo#73113 not string cell does not mean no string at cell

Introduced with c008dc48 the
ScQueryCellIterator::BinarySearch() evaluated all non-string cells as
not being string, ignoring edit cells and formula cell string results.

Change-Id: I43be46dc8db35d6d0677086c345379ed4627b355
üst 33227dbf
......@@ -1547,8 +1547,24 @@ bool ScQueryCellIterator::BinarySearch()
continue; // while
}
bool bHaveRefCell = false;
PositionType aPos = pCol->maCells.position(i);
bool bStr = aPos.first->type == sc::element_type_string;
bool bStr;
switch (aPos.first->type)
{
case sc::element_type_formula:
aCell = sc::toRefCell(aPos.first, aPos.second);
bHaveRefCell = true;
bStr = aCell.hasString();
break;
case sc::element_type_string:
case sc::element_type_edittext:
bStr = true;
break;
default:
bStr = false;
break;
}
nRes = 0;
// compares are content<query:-1, content>query:1
......@@ -1556,7 +1572,8 @@ bool ScQueryCellIterator::BinarySearch()
if (!bStr && !bByString)
{
double nCellVal;
aCell = sc::toRefCell(aPos.first, aPos.second);
if (!bHaveRefCell)
aCell = sc::toRefCell(aPos.first, aPos.second);
switch (aCell.meType)
{
case CELLTYPE_VALUE :
......@@ -1611,7 +1628,8 @@ bool ScQueryCellIterator::BinarySearch()
{
OUString aCellStr;
sal_uLong nFormat = pCol->GetNumberFormat(i);
aCell = sc::toRefCell(aPos.first, aPos.second);
if (!bHaveRefCell)
aCell = sc::toRefCell(aPos.first, aPos.second);
ScCellFormat::GetInputString(aCell, nFormat, aCellStr, rFormatter, pDoc);
nRes = pCollator->compareString(aCellStr, rEntry.GetQueryItem().maString.getString());
......
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