summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-23 00:22:27 +0100
committerPetr Mladek <pmladek@suse.cz>2013-02-27 08:59:01 +0000
commita26a63e9315e3df6ec9ae08e73efb62dfb7b4ba1 (patch)
treeb502b98ccbc5c057a1c63c843c2990b88cbdbd32
parentab82ad7b1c5c9e0567319e60aacd6e960668ad2d (diff)
use URM_COPY when copying cond formats, fdo#60306, fdo#60311
Change-Id: I7a232c27dd0c1eee6f389d30f46658500aaded47 Reviewed-on: https://gerrit.libreoffice.org/2414 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org> Reviewed-on: https://gerrit.libreoffice.org/2416 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--sc/inc/conditio.hxx2
-rw-r--r--sc/source/core/data/conditio.cxx10
-rw-r--r--sc/source/core/data/table2.cxx2
3 files changed, 7 insertions, 7 deletions
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 245fb66c4c93..810d3be31054 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 843eda530990..a6ba7363048d 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1999,15 +1999,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 c3c99b2ca626..1127f5274e24 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();