summaryrefslogtreecommitdiff
path: root/sc/source/core/data/attarray.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/attarray.cxx')
-rw-r--r--sc/source/core/data/attarray.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index d058b7e70b4f..3330cf14c10e 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -298,11 +298,15 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nInd
std::vector< sal_uInt32 > aCondFormatData;
if(pItem)
aCondFormatData = static_cast<const ScCondFormatItem*>(pItem)->GetCondFormatData();
- aCondFormatData.push_back(nIndex);
+ if (std::find(aCondFormatData.begin(), aCondFormatData.end(), nIndex)
+ == aCondFormatData.end())
+ {
+ aCondFormatData.push_back(nIndex);
- ScCondFormatItem aItem;
- aItem.SetCondFormatData( aCondFormatData );
- pNewPattern->GetItemSet().Put( aItem );
+ ScCondFormatItem aItem;
+ aItem.SetCondFormatData( aCondFormatData );
+ pNewPattern->GetItemSet().Put( aItem );
+ }
}
else
{