[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Tue Jul 30 13:12:18 PDT 2013


 sc/source/core/data/conditio.cxx |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit eea9c45b74c2980d76154a3755ba8f037401efbd
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 30 16:12:53 2013 -0400

    More on avoiding direct access to reference data members.
    
    Change-Id: I313c6504d7c0beeb68318ce436b48fa900e4cf48

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 591fc0f..c0939ff 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1429,22 +1429,24 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
             while ( ( t = static_cast<ScToken*>(pFormula->GetNextReference()) ) != NULL )
             {
                 ScSingleRefData& rRef1 = t->GetSingleRef();
-                if ( rRef1.IsTabRel() && !rRef1.IsTabDeleted() )
+                ScAddress aAbs = rRef1.toAbs(aSrcPos);
+                if (!rRef1.IsTabDeleted())
                 {
-                    if ( rRef1.nTab < nMinTab )
-                        nMinTab = rRef1.nTab;
-                    if ( rRef1.nTab > nMaxTab )
-                        nMaxTab = rRef1.nTab;
+                    if (aAbs.Tab() < nMinTab)
+                        nMinTab = aAbs.Tab();
+                    if (aAbs.Tab() > nMaxTab)
+                        nMaxTab = aAbs.Tab();
                 }
                 if ( t->GetType() == svDoubleRef )
                 {
                     ScSingleRefData& rRef2 = t->GetDoubleRef().Ref2;
-                    if ( rRef2.IsTabRel() && !rRef2.IsTabDeleted() )
+                    aAbs = rRef2.toAbs(aSrcPos);
+                    if (!rRef2.IsTabDeleted())
                     {
-                        if ( rRef2.nTab < nMinTab )
-                            nMinTab = rRef2.nTab;
-                        if ( rRef2.nTab > nMaxTab )
-                            nMaxTab = rRef2.nTab;
+                        if (aAbs.Tab() < nMinTab)
+                            nMinTab = aAbs.Tab();
+                        if (aAbs.Tab() > nMaxTab)
+                            nMaxTab = aAbs.Tab();
                     }
                 }
             }


More information about the Libreoffice-commits mailing list