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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 14 08:02:46 UTC 2020


 sc/source/core/data/formulacell.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c8630211eb9fda51d353c100c4f081e76617212e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Sep 13 20:23:20 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 14 10:02:00 2020 +0200

    lcl_fillRangeFromRefList always dereferences its ScDocument* arg
    
    Change-Id: I73b985ba49ac2f43b4760fa8426232d4eb088345
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102617
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 010b4b4a8de2..320c53a223a6 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -364,15 +364,15 @@ lcl_checkIfAdjacent(
 
 void
 lcl_fillRangeFromRefList(
-    const ScDocument* pDoc,
+    const ScDocument& rDoc,
     const ScAddress& aPos, const std::vector<formula::FormulaToken*>& rReferences, ScRange& rRange)
 {
     const ScSingleRefData aStart(
             SingleDoubleRefProvider(*rReferences.front()).Ref1);
-    rRange.aStart = aStart.toAbs(*pDoc, aPos);
+    rRange.aStart = aStart.toAbs(rDoc, aPos);
     const ScSingleRefData aEnd(
             SingleDoubleRefProvider(*rReferences.back()).Ref2);
-    rRange.aEnd = aEnd.toAbs(*pDoc, aPos);
+    rRange.aEnd = aEnd.toAbs(rDoc, aPos);
 }
 
 bool
@@ -383,7 +383,7 @@ lcl_refListFormsOneRange(
 {
     if (rReferences.size() == 1)
     {
-        lcl_fillRangeFromRefList(pDoc, rPos, rReferences, rRange);
+        lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
         return true;
     }
 
@@ -415,7 +415,7 @@ lcl_refListFormsOneRange(
         std::sort(rReferences.begin(), rReferences.end(), LessByReference(pDoc, rPos, aWhich));
         if (lcl_checkIfAdjacent(pDoc, rPos, rReferences, aWhich))
         {
-            lcl_fillRangeFromRefList(pDoc, rPos, rReferences, rRange);
+            lcl_fillRangeFromRefList(*pDoc, rPos, rReferences, rRange);
             return true;
         }
     }


More information about the Libreoffice-commits mailing list