[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Wed Jul 27 16:19:38 UTC 2016


 sc/source/core/data/table6.cxx |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit a02f7aa735c52f5d20df0e2a94cc06879cb3dfac
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jul 27 18:18:43 2016 +0200

    do not search in empty string if there is no note, tdf#65334 follow-up
    
    Change-Id: I6c347b5bccd4ffd6a43a80e9d73a0b5fcf82926b

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index e5582b4..121d1d2 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();


More information about the Libreoffice-commits mailing list