sc/source/core/data/attarray.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit 315b9b4a5c53eed5fd283bc329e05d7d8fbc9ebc Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Tue Dec 18 02:28:24 2012 +0100 we need to use a copy of the original ScPatternAttr, fdo#58338 Change-Id: Ic231347cb864bff073d46ddef06f65b7517c45c3 diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 31e4b2f..201538d 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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits