diff options
Diffstat (limited to 'sc/source/filter/oox/extlstcontext.cxx')
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index f30e01a0ad08..533f672ac95c 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -83,6 +83,7 @@ void ExtCfRuleContext::onStartElement( const AttributeList& rAttribs ) ExtConditionalFormattingContext::ExtConditionalFormattingContext(WorksheetContextBase& rFragment): WorksheetContextBase(rFragment) { + nPriority = -1; isPreviousElementF = false; } @@ -103,6 +104,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl { OUString aType = rAttribs.getString(XML_type, OUString()); OUString aId = rAttribs.getString(XML_id, OUString()); + nPriority = rAttribs.getInteger( XML_priority, -1 ); if (aType == "dataBar") { @@ -178,6 +180,7 @@ void ExtConditionalFormattingContext::onEndElement() case XM_TOKEN(f): { rFormulas.push_back(aChars); + maPriorities.push_back(nPriority); } break; case XLS14_TOKEN( cfRule ): @@ -200,9 +203,9 @@ void ExtConditionalFormattingContext::onEndElement() aRange[i].aEnd.SetTab(nTab); } - if(isPreviousElementF) // sqref can be alone in some cases. + if (isPreviousElementF) // sqref can be alone in some cases. { - for(const OUString& rFormula : rFormulas) + for (const OUString& rFormula : rFormulas) { ScAddress rPos = aRange.GetTopLeftCorner(); rStyle = getStyles().createExtDxfStyle(rStyleIdx); @@ -214,11 +217,17 @@ void ExtConditionalFormattingContext::onEndElement() maEntries.push_back(std::unique_ptr<ScFormatEntry>(pEntry)); rStyleIdx++; } + + assert(rFormulas.size() == maPriorities.size()); rFormulas.clear(); } std::vector< std::unique_ptr<ExtCfCondFormat> >& rExtFormats = getCondFormats().importExtCondFormat(); - rExtFormats.push_back(o3tl::make_unique<ExtCfCondFormat>(aRange, maEntries)); + rExtFormats.push_back(o3tl::make_unique<ExtCfCondFormat>(aRange, maEntries, &maPriorities)); + + if (isPreviousElementF) + maPriorities.clear(); + isPreviousElementF = false; } break; |