summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-18 02:28:24 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-18 02:29:22 +0100
commit8a028afd55decfd269268d0d1e6adcfbdc9d85d0 (patch)
tree325e02f94c5034bcb48e83720ce85297c98200ee
parent6859c0230444e57dc8526e398c4c3c6f5bb218cc (diff)
we need to use a copy of the original ScPatternAttr, fdo#58338
Change-Id: Ic231347cb864bff073d46ddef06f65b7517c45c3
-rw-r--r--sc/source/core/data/attarray.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 31e4b2fbd193..201538d6fe7f 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -279,9 +279,10 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd
{
const ScPatternAttr* pPattern = GetPattern(nTempStartRow);
- ScPatternAttr aPattern( pDocument->GetPool() );
+ boost::scoped_ptr<ScPatternAttr> pNewPattern;
if(pPattern)
{
+ pNewPattern.reset( new ScPatternAttr(*pPattern) );
SCROW nPatternStartRow;
SCROW nPatternEndRow;
GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow );
@@ -296,17 +297,18 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd
ScCondFormatItem aItem;
aItem.SetCondFormatData( aCondFormatData );
- aPattern.GetItemSet().Put( aItem );
+ pNewPattern->GetItemSet().Put( aItem );
}
else
{
+ pNewPattern.reset( new ScPatternAttr( pDocument->GetPool() ) );
ScCondFormatItem aItem;
aItem.AddCondFormatData(nIndex);
- aPattern.GetItemSet().Put( aItem );
+ pNewPattern->GetItemSet().Put( aItem );
nTempEndRow = nEndRow;
}
- SetPatternArea( nTempStartRow, nTempEndRow, &aPattern, true );
+ SetPatternArea( nTempStartRow, nTempEndRow, pNewPattern.get(), true );
nTempStartRow = nTempEndRow + 1;
}
while(nTempEndRow < nEndRow);
@@ -328,9 +330,9 @@ void ScAttrArray::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 n
{
const ScPatternAttr* pPattern = GetPattern(nTempStartRow);
- ScPatternAttr aPattern( pDocument->GetPool() );
if(pPattern)
{
+ ScPatternAttr aPattern( *pPattern );
SCROW nPatternStartRow;
SCROW nPatternEndRow;
GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow );