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

Kohei Yoshida kohei.yoshida at gmail.com
Thu Jun 27 12:25:47 PDT 2013


 sc/source/core/data/formulacell.cxx |   18 +++++++++---------
 sc/source/core/tool/compiler.cxx    |   24 ++++++++++++------------
 2 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit d2ac8eef9e437a409efd7ca79a2b0f3cadecade7
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Jun 27 15:12:10 2013 -0400

    Rename a variable to something more meaningful.
    
    Change-Id: I860e5301e3fec3f06f318b28787f71b63dbaf0ab

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 224bbea..e432d79 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2100,7 +2100,7 @@ bool ScFormulaCell::UpdateReference(
     if (pUndoDoc)
         pOldCode.reset(pCode->Clone());
 
-    ScRangeData* pRangeData = NULL;
+    ScRangeData* pSharedCode = NULL;
     bool bValChanged = false;
     bool bRangeModified = false;    // any range, not only shared formula
     bool bRefSizeChanged = false;
@@ -2110,7 +2110,7 @@ bool ScFormulaCell::UpdateReference(
         // Update cell or range references.
         ScCompiler aComp(pDocument, aPos, *pCode);
         aComp.SetGrammar(pDocument->GetGrammar());
-        pRangeData = aComp.UpdateReference(eUpdateRefMode, aOldPos, rRange,
+        pSharedCode = aComp.UpdateReference(eUpdateRefMode, aOldPos, rRange,
                                          nDx, nDy, nDz,
                                          bValChanged, bRefSizeChanged);
         bRangeModified = aComp.HasModifiedRange();
@@ -2215,7 +2215,7 @@ bool ScFormulaCell::UpdateReference(
         bHasRelName = HasRelNameReference();
         // Reference changed and new listening needed?
         // Except in Insert/Delete without specialties.
-        bNewListening = (bRangeModified || pRangeData || bColRowNameCompile
+        bNewListening = (bRangeModified || pSharedCode || bColRowNameCompile
                 || (bValChanged && (eUpdateRefMode != URM_INSDEL ||
                         bInDeleteUndo || bRefSizeChanged)) ||
                 (bHasRelName && eUpdateRefMode != URM_COPY))
@@ -2231,14 +2231,14 @@ bool ScFormulaCell::UpdateReference(
 
     bool bNeedDirty = false;
     // NeedDirty for changes except for Copy and Move/Insert without RelNames
-    if ( bRangeModified || pRangeData || bColRowNameCompile ||
+    if ( bRangeModified || pSharedCode || bColRowNameCompile ||
             (bValChanged && eUpdateRefMode != URM_COPY &&
              (eUpdateRefMode != URM_MOVE || bHasRelName) &&
              (!bIsInsert || bHasRelName || bInDeleteUndo ||
               bRefSizeChanged)) || bOnRefMove)
         bNeedDirty = true;
 
-    if (pUndoDoc && (bValChanged || pRangeData || bOnRefMove))
+    if (pUndoDoc && (bValChanged || pSharedCode || bOnRefMove))
     {
         // Copy the cell to aUndoPos, which is its current position in the document,
         // so this works when UpdateReference is called before moving the cells
@@ -2258,13 +2258,13 @@ bool ScFormulaCell::UpdateReference(
 
     bValChanged = false;
 
-    if ( pRangeData )
+    if ( pSharedCode )
     {   // Replace shared formula with own formula
         pDocument->RemoveFromFormulaTree( this );   // update formula count
         delete pCode;
-        pCode = pRangeData->GetCode()->Clone();
+        pCode = pSharedCode->GetCode()->Clone();
         // #i18937# #i110008# call MoveRelWrap, but with the old position
-        ScCompiler::MoveRelWrap(*pCode, pDocument, aOldPos, pRangeData->GetMaxCol(), pRangeData->GetMaxRow());
+        ScCompiler::MoveRelWrap(*pCode, pDocument, aOldPos, pSharedCode->GetMaxCol(), pSharedCode->GetMaxRow());
         ScCompiler aComp2(pDocument, aPos, *pCode);
         aComp2.SetGrammar(pDocument->GetGrammar());
         aComp2.UpdateSharedFormulaReference( eUpdateRefMode, aOldPos, rRange,
@@ -2297,7 +2297,7 @@ bool ScFormulaCell::UpdateReference(
         }
     }
 
-    if ( bNeedDirty && (!(eUpdateRefMode == URM_INSDEL && bHasRelName) || pRangeData) )
+    if ( bNeedDirty && (!(eUpdateRefMode == URM_INSDEL && bHasRelName) || pSharedCode) )
     {   // Cut off references, invalid or similar?
         sc::AutoCalcSwitch(*pDocument, false);
         SetDirty();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4748aef..d22c54f 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4222,25 +4222,25 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
             }
         }
         // Check for SharedFormulas.
-        ScRangeData* pRangeData = NULL;
+        ScRangeData* pSharedCode = NULL;
         pArr->Reset();
-        for( FormulaToken* j = pArr->GetNextName(); j && !pRangeData;
+        for( FormulaToken* j = pArr->GetNextName(); j && !pSharedCode;
              j = pArr->GetNextName() )
         {
             if( j->GetOpCode() == ocName )
             {
                 ScRangeData* pName = GetRangeData( *j);
                 if (pName && pName->HasType(RT_SHARED))
-                    pRangeData = pName;
+                    pSharedCode = pName;
             }
         }
         // Check SharedFormulas for wraps.
-        if (pRangeData)
+        if (pSharedCode)
         {
-            ScRangeData* pName = pRangeData;
-            pRangeData = NULL;
+            ScRangeData* pName = pSharedCode;
+            pSharedCode = NULL;
             pArr->Reset();
-            for( t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()); t && !pRangeData;
+            for( t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()); t && !pSharedCode;
                  t = static_cast<ScToken*>(pArr->GetNextReferenceRPN()) )
             {
                 bool bRelName = (t->GetType() == svSingleRef ?
@@ -4257,16 +4257,16 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
                     // wrapped it. Replace SharedFormula.
                     if (!bValid)
                     {
-                        pRangeData = pName;
+                        pSharedCode = pName;
                         rChanged = true;
                     }
                 }
             }
         }
-        return pRangeData;
+        return pSharedCode;
     }
 
-    ScRangeData* pRangeData = NULL;
+    ScRangeData* pSharedCode = NULL;
     ScToken* t;
     pArr->Reset();
     while( (t = static_cast<ScToken*>(pArr->GetNextReferenceOrName())) != NULL )
@@ -4276,7 +4276,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
             ScRangeData* pName = GetRangeData( *t);
             if (pName && pName->HasType(RT_SHAREDMOD))
             {
-                pRangeData = pName;     // maybe need a replacement of shared with own code
+                pSharedCode = pName;     // maybe need a replacement of shared with own code
                 rChanged = true;
             }
         }
@@ -4373,7 +4373,7 @@ ScRangeData* ScCompiler::UpdateReference(UpdateRefMode eUpdateRefMode,
         }
     }
 
-    return pRangeData;
+    return pSharedCode;
 }
 
 bool ScCompiler::UpdateNameReference(UpdateRefMode eUpdateRefMode,


More information about the Libreoffice-commits mailing list