[Libreoffice-commits] .: 2 commits - sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Mar 15 14:32:50 PDT 2012


 sc/source/core/data/cell.cxx      |    6 +++---
 sc/source/ui/inc/namepast.hxx     |    1 +
 sc/source/ui/namedlg/namepast.cxx |    5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2118ec3630fe12ff2a663c94421780870f264e83
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Mar 15 22:22:10 2012 +0100

    update the relatice refs after the absolute refs, fdo#47285
    
    The algoithm for updating absolute refs needs to calculate the old
    position based on the information before any updates to the RefData

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 6d5baaf..f191c5d 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -788,9 +788,6 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
 {
     pCode = rCell.pCode->Clone();
 
-    if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
-        pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
-
     // evtl. Fehler zuruecksetzen und neu kompilieren
     //  nicht im Clipboard - da muss das Fehlerflag erhalten bleiben
     //  Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler behalten
@@ -827,6 +824,9 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, ScDocument& rDoc, cons
         pCode->AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos );
     }
 
+    if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
+        pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
+
     if( !bCompile )
     {   // Name references with references and ColRowNames
         pCode->Reset();
commit bd43abc94d30332d06fad7964bd01dc5f70c22e7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Mar 15 15:57:54 2012 +0100

    ScNameMgrTable takes a reference, fdo#47307

diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index b2abb45..77e3712 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -57,6 +57,7 @@ private:
     ScRangeManagerTable* mpTable;
 
     std::vector<rtl::OUString> maSelectedNames;
+    boost::ptr_map<rtl::OUString, ScRangeName> maRangeMap;
 public:
     ScNamePasteDlg( Window * pParent, ScDocShell* pShell, bool bInsList=true );
 
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 68a406f..8b4f78b 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -54,18 +54,17 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, ScDocShell* pShell, bool )
 {
     ScDocument* pDoc = pShell->GetDocument();
     std::map<rtl::OUString, ScRangeName*> aCopyMap;
-    boost::ptr_map<rtl::OUString, ScRangeName> aRangeMap;
     pDoc->GetRangeNameMap(aCopyMap);
     std::map<rtl::OUString, ScRangeName*>::iterator itr = aCopyMap.begin(), itrEnd = aCopyMap.end();
     for (; itr != itrEnd; ++itr)
     {
         rtl::OUString aTemp(itr->first);
-        aRangeMap.insert(aTemp, new ScRangeName(*itr->second));
+        maRangeMap.insert(aTemp, new ScRangeName(*itr->second));
     }
 
     ScViewData* pViewData = pShell->GetViewData();
     ScAddress aPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
-    mpTable = new ScRangeManagerTable(&maCtrl, aRangeMap, aPos);
+    mpTable = new ScRangeManagerTable(&maCtrl, maRangeMap, aPos);
 
     maBtnPaste.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
     maBtnPasteAll.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));


More information about the Libreoffice-commits mailing list