summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-05-11 23:43:43 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-05-11 23:58:24 +0200
commit03ca37a3034027e9ef4cf80814994007fd595a95 (patch)
tree76733465456ebfb667fe12738f4a0729ba55de0a
parent7327195602e7870e20a4eebb8ea26ae7294f065b (diff)
update references in color scales
Change-Id: Ie86cbd173a21e79d802a03fd112ea01c0cf44116
-rw-r--r--sc/inc/colorscale.hxx2
-rw-r--r--sc/source/core/data/colorscale.cxx29
-rw-r--r--sc/source/core/data/documen2.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx3
-rw-r--r--sc/source/core/data/document.cxx9
5 files changed, 45 insertions, 0 deletions
diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx
index 2d5839f5111e..54f0c5958c02 100644
--- a/sc/inc/colorscale.hxx
+++ b/sc/inc/colorscale.hxx
@@ -56,6 +56,8 @@ public:
double GetValue() const;
void SetFormula(const rtl::OUString& rFormula, ScDocument* pDoc, const ScAddress& rAddr, formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT);
void UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab, SCTAB nTabNo);
+ void UpdateReference( UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
bool GetMin() const;
bool GetMax() const;
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 728d23e4f927..6a249ff88c2b 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -82,6 +82,15 @@ void ScColorScaleEntry::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab, SCTAB nTabN
}
}
+void ScColorScaleEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ if(mpCell)
+ {
+ mpCell->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz );
+ }
+}
+
const Color& ScColorScaleEntry::GetColor() const
{
return maColor;
@@ -390,6 +399,17 @@ void ScColorScaleFormat::UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab)
}
}
+void ScColorScaleFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ maRanges.UpdateReference( eUpdateRefMode, mpDoc, rRange, nDx, nDy, nDz );
+
+ for(iterator itr = begin(); itr != end(); ++itr)
+ {
+ itr->UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
+ }
+}
+
bool ScColorScaleFormat::CheckEntriesForRel(const ScRange& rRange) const
{
bool bNeedUpdate = false;
@@ -500,4 +520,13 @@ void ScColorScaleFormatList::UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab)
}
}
+void ScColorScaleFormatList::UpdateReference( UpdateRefMode eUpdateRefMode,
+ const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz )
+{
+ for(iterator itr = begin(); itr != end(); ++itr)
+ {
+ itr->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 605f9cd751c4..1120f052fb30 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -866,6 +866,8 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
// update conditional formats after table is inserted
if ( pCondFormList )
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
// sheet names of references may not be valid until sheet is copied
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index f016df5ba88b..f1bce7bb445f 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -79,6 +79,7 @@
#include "formulaparserpool.hxx"
#include "clipparam.hxx"
#include "sheetevents.hxx"
+#include "colorscale.hxx"
#include "queryentry.hxx"
#include "globalnames.hxx"
@@ -1006,6 +1007,8 @@ void ScDocument::UpdateReference( UpdateRefMode eUpdateRefMode,
pDPCollection->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
UpdateChartRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz );
UpdateRefAreaLinks( eUpdateRefMode, aRange, nDx, nDy, nDz );
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
if ( pCondFormList )
pCondFormList->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
if ( pValidationList )
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 52a8d7d6c51f..d24cb7f9aa05 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -75,6 +75,7 @@
#include "markdata.hxx"
#include "drwlayer.hxx"
#include "conditio.hxx"
+#include "colorscale.hxx"
#include "validat.hxx"
#include "prnsave.hxx"
#include "chgtrack.hxx"
@@ -477,6 +478,8 @@ bool ScDocument::InsertTab( SCTAB nPos, const rtl::OUString& rName,
// update conditional formats after table is inserted
if ( pCondFormList )
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
// sheet names of references are not valid until sheet is inserted
@@ -565,6 +568,8 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector<rtl::OUString>& rName
// update conditional formats after table is inserted
if ( pCondFormList )
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,nNewSheets);
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( URM_INSDEL, aRange, 0,0,nNewSheets);
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,nNewSheets );
// sheet names of references are not valid until sheet is inserted
@@ -629,6 +634,8 @@ bool ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc )
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,-1 );
if ( pCondFormList )
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,-1 );
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( URM_INSDEL, aRange, 0,0,-1 );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,-1 );
if ( pUnoBroadcaster )
@@ -718,6 +725,8 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets, ScDocument* pRefUndoDoc
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,-1*nSheets );
if ( pCondFormList )
pCondFormList->UpdateReference( URM_INSDEL, aRange, 0,0,-1*nSheets );
+ if ( mpColorScaleList )
+ mpColorScaleList->UpdateReference( URM_INSDEL, aRange, 0,0,-1*nSheets );
if ( pValidationList )
pValidationList->UpdateReference( URM_INSDEL, aRange, 0,0,-1*nSheets );
if ( pUnoBroadcaster )