[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Feb 11 04:29:39 PST 2014


 sc/inc/mtvfunctions.hxx        |    2 +-
 sc/source/core/data/column.cxx |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 517cf1185e5e3fd4eaedf6b49ffecbd957317bbb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Feb 10 22:34:35 2014 -0500

    fdo#74209: This search algorithm had another issue. This fixes it.
    
    When the search range was i.e. 1-3, and the match was found at 5, the old
    code would return 5 when in fact it should have failed.  This change would
    honor the end position and limit the search within specified search range.
    
    Change-Id: If12a92fd3930ad128a5b0699a1addd96fb3a8eba
    (cherry picked from commit 1da03a88a98b50633d61557de27e4c0702a665eb)
    Reviewed-on: https://gerrit.libreoffice.org/7988
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/mtvfunctions.hxx b/sc/inc/mtvfunctions.hxx
index 6955d21..fdf79fa 100644
--- a/sc/inc/mtvfunctions.hxx
+++ b/sc/inc/mtvfunctions.hxx
@@ -618,7 +618,7 @@ FindElement2(
             break;
             default:
             {
-                ElseRetType aRet = rFuncElse(*it, nOffset);
+                ElseRetType aRet = rFuncElse(*it, nOffset, nDataSize);
                 if (aRet.second)
                     return PositionType(it, aRet.first);
             }
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 487e3a0..47ef9cb 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2985,20 +2985,20 @@ public:
         return const_cast<ScFormulaCell*>(p)->IsMultilineResult();
     }
 
-    std::pair<size_t,bool> operator() (const sc::CellStoreType::value_type& node, size_t nOffset)
+    std::pair<size_t,bool> operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize)
     {
         typedef std::pair<size_t,bool> RetType;
 
         if (node.type == sc::element_type_empty)
             return RetType(0, false);
 
-        for (size_t i = nOffset; i < node.size; ++i)
+        for (size_t i = 0; i < nDataSize; ++i)
         {
-            SCROW nRow = node.position + i;
+            SCROW nRow = node.position + i + nOffset;
             sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos);
             if (IsAmbiguousScriptNonZero(nScriptType))
                 // Return the offset from the first row.
-                return RetType(i, true);
+                return RetType(i+nOffset, true);
         }
 
         return RetType(0, false);


More information about the Libreoffice-commits mailing list