diff options
author | Eike Rathke <erack@redhat.com> | 2016-07-27 18:18:43 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-27 18:18:52 +0200 |
commit | a02f7aa735c52f5d20df0e2a94cc06879cb3dfac (patch) | |
tree | 0d0687d85a7137e4d63788c6451622186624a6c6 /sc | |
parent | 09cc958dee93ad0ad2ab0d8cc9cc4c09e46c3653 (diff) |
do not search in empty string if there is no note, tdf#65334 follow-up
Change-Id: I6c347b5bccd4ffd6a43a80e9d73a0b5fcf82926b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/table6.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index e5582b4ddb41..121d1d20ff7d 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -68,12 +68,22 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo if (!bDoSearch) return false; - aCell = aCol[nCol].GetCellValue(nRow); - if (aCell.isEmpty() && rSearchItem.GetCellType() != SvxSearchCellType::NOTE) - return false; + ScPostIt* pNote; + if (rSearchItem.GetCellType() == SvxSearchCellType::NOTE) + { + pNote = aCol[nCol].GetCellNote(nRow); + if (!pNote) + return false; + } + else + { + aCell = aCol[nCol].GetCellValue(nRow); + if (aCell.isEmpty()) + return false; + pNote = nullptr; + } bool bMultiLine = false; - ScPostIt* pNote = nullptr; CellType eCellType = aCell.meType; switch (rSearchItem.GetCellType()) { @@ -105,7 +115,6 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo break; case SvxSearchCellType::NOTE: { - pNote = aCol[nCol].GetCellNote(nRow); if (pNote) { aString = pNote->GetText(); |