diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-09-28 20:14:17 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-10-01 12:16:09 +0100 |
commit | 2ec30db5f8a9b629b3a099ed8e4d3598567feceb (patch) | |
tree | 113a08052bc6d04b79b281e0c237788b63f7a90c | |
parent | 1ba25c3ada91963f095c976764d68db039be0fd8 (diff) |
fetime of mpCondFormat is more complex, fdo#55379
Change-Id: I2b34f9fefdfdfa245ab73f8691090cbde8bcd34e
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r-- | sc/source/filter/xml/xmlstyli.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlstyli.hxx | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 7388d86e283f..167755f9b56e 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(); @@ -470,6 +468,7 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres if(mpCondFormat) { + mbDeleteCondFormat = false; sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); mpCondFormat->AddRange(rRange); diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index d674fe3625c9..2498b3cc8618 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -101,6 +101,7 @@ class XMLTableStyleContext : public XMLPropStyleContext SCTAB nLastSheet; bool bParentSet; ScConditionalFormat* mpCondFormat; + bool mbDeleteCondFormat; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } |