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

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Feb 24 23:17:01 PST 2013


 formula/source/core/api/FormulaCompiler.cxx |    6 +++---
 sc/inc/conditio.hxx                         |    2 +-
 sc/source/core/data/conditio.cxx            |   10 +++++-----
 sc/source/core/data/table2.cxx              |    2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit a11f944b4c3d268e0f3b36bbccba3a50d2db066a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Feb 25 08:09:43 2013 +0100

    ocMacro and ocExternal need to be recalculated on load, fdo#60977
    
    Change-Id: I9e69ca2feae44bc645e8a49e349557f0933a23eb

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index eca4fb5..3cfb903 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1062,6 +1062,9 @@ void FormulaCompiler::Factor()
                     // override ModeAlways, use
                     // AddRecalcMode(RECALCMODE_ONLOAD) instead.
                 case ocConvert :
+                case ocDde:
+                case ocMacro:
+                case ocExternal:
                     pArr->AddRecalcMode( RECALCMODE_ONLOAD );
                 break;
                     // If the referred cell is moved the value changes.
@@ -1081,9 +1084,6 @@ void FormulaCompiler::Factor()
                     pArr->AddRecalcMode( RECALCMODE_ONLOAD );
                     pArr->SetHyperLink(true);
                 break;
-                case ocDde:
-                    pArr->AddRecalcMode( RECALCMODE_ONLOAD );
-                break;
                 default:
                     ;   // nothing
             }
commit 5d8548da365c326919597fa0d2699a6762889dc9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Feb 23 00:22:27 2013 +0100

    use URM_COPY when copying cond formats, fdo#60306, fdo#60311
    
    Change-Id: I7a232c27dd0c1eee6f389d30f46658500aaded47

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 245fb66..810d3be 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -411,7 +411,7 @@ public:
     void            CompileAll();
     void            CompileXML();
     void            UpdateReference( UpdateRefMode eUpdateRefMode,
-                                const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
+                                const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bCopyAsMove = false );
     void            DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
     void            UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
     void            RenameCellStyle( const rtl::OUString& rOld, const rtl::OUString& rNew );
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 93127c4..bf364e5 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1992,15 +1992,15 @@ void ScConditionalFormat::CompileXML()
 }
 
 void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
-                                const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+                                const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bCopyAsMove )
 {
-    if( eUpdateRefMode == URM_COPY && nDz != 0 )
+    for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
+        itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
+
+    if( eUpdateRefMode == URM_COPY && bCopyAsMove )
         maRanges.UpdateReference( URM_MOVE, pDoc, rRange, nDx, nDy, nDz );
     else
         maRanges.UpdateReference( eUpdateRefMode, pDoc, rRange, nDx, nDy, nDz );
-
-    for(CondFormatContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
-        itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
 }
 
 void ScConditionalFormat::DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index db43e5e..4add7ef 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -685,7 +685,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO
         ScConditionalFormat* pNewFormat = itr->Clone(pDocument);
 
         pNewFormat->AddRange(aIntersectedRange);
-        pNewFormat->UpdateReference(URM_MOVE, aNewRange, nDx, nDy, pTable->nTab - nTab);
+        pNewFormat->UpdateReference(URM_COPY, aNewRange, nDx, nDy, pTable->nTab - nTab, true);
 
         sal_uLong nMax = 0;
         for(ScConditionalFormatList::const_iterator itrCond = mpCondFormatList->begin();


More information about the Libreoffice-commits mailing list