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

Kohei Yoshida kohei.yoshida at collabora.com
Wed Nov 27 11:36:58 PST 2013


 sc/source/core/data/grouptokenconverter.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 56805bab63f30496c7f13a0e88c2b265044cad30
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Nov 27 14:05:45 2013 -0500

    We shouldn't check isValid() here.
    
    When the referenced range consists of entirely empty cells, we get
    an empty array, which is correct, but an empty array returns false when
    calling isValid(), which is not correct.  After some thought, it's best
    not to check for isValid() here.
    
    Change-Id: I50dcea4f2b55d5f5c6f1226cca4106ddcad62145

diff --git a/sc/source/core/data/grouptokenconverter.cxx b/sc/source/core/data/grouptokenconverter.cxx
index 55b2709..b295fee 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -116,9 +116,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
                     // returned array equals or greater than the requested
                     // length.
 
-                    formula::VectorRefArray aArray = mrDoc.FetchVectorRefArray(aRefPos, nLen);
-                    if (!aArray.isValid())
-                        return false;
+                    formula::VectorRefArray aArray;
+                    if (nLen)
+                        aArray = mrDoc.FetchVectorRefArray(aRefPos, nLen);
 
                     formula::SingleVectorRefToken aTok(aArray, nLen);
                     mrGroupTokens.AddToken(aTok);
@@ -184,9 +184,9 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
                 for (SCCOL i = aAbs.aStart.Col(); i <= aAbs.aEnd.Col(); ++i)
                 {
                     aRefPos.SetCol(i);
-                    formula::VectorRefArray aArray = mrDoc.FetchVectorRefArray(aRefPos, nArrayLength);
-                    if (!aArray.isValid())
-                        return false;
+                    formula::VectorRefArray aArray;
+                    if (nArrayLength)
+                        aArray = mrDoc.FetchVectorRefArray(aRefPos, nArrayLength);
 
                     aArrays.push_back(aArray);
                 }


More information about the Libreoffice-commits mailing list