summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlstyli.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/xml/xmlstyli.cxx')
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 7388d86e283f..59d1fe43749e 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -392,12 +392,15 @@ XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport,
nNumberFormat(-1),
nLastSheet(-1),
bParentSet(false),
- mpCondFormat(NULL)
+ mpCondFormat(NULL),
+ mbDeleteCondFormat(true)
{
}
XMLTableStyleContext::~XMLTableStyleContext()
{
+ if(mbDeleteCondFormat)
+ delete mpCondFormat;
}
SvXMLImportContext *XMLTableStyleContext::CreateChildContext(
@@ -444,11 +447,6 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
{
if(itr->EqualEntries(*mpCondFormat))
{
- // we don't need the new cond format entry now
- // the found one is the same and we just need to add the range to it
- delete mpCondFormat;
- mpCondFormat = NULL;
-
ScRangeList& rRangeList = itr->GetRangeList();
sal_uInt32 nCondId = itr->GetKey();
size_t n = rRange.size();
@@ -464,12 +462,13 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
aMarkData.MarkFromRangeList(rRange, true);
pDoc->ApplySelectionPattern( aPattern , aMarkData);
- break;
+ return;
}
}
- if(mpCondFormat)
+ if(mpCondFormat && mbDeleteCondFormat)
{
+ mbDeleteCondFormat = false;
sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab );
mpCondFormat->SetKey(nIndex);
mpCondFormat->AddRange(rRange);