diff options
author | Henry Castro <hcastro@collabora.com> | 2023-03-17 11:07:14 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-06-15 03:55:02 +0200 |
commit | 242de60455e0fc554bb9fb592f8f00d7e5edb918 (patch) | |
tree | 1d40f9fa4fc99c4815a08b116e7db354907319ea /sc | |
parent | 069c7dc4e9706b40ca12d83d83f90f41cec948f8 (diff) |
sc: filter: oox: insert a new entry ScDataBarFormat if Id attribute...
does not exist:
<x14:cfRule type="dataBar" priority="1" id="{006000A4-0067-40D4-A5EF-00D900B80077}">
<x14:dataBar maxLength="100" minLength="0" border="1" axisPosition="automatic" direction="context" negativeBarBorderColorSameAsPositive="0">
<x14:cfvo type="num">
<xm:f>0</xm:f>
</x14:cfvo>
<x14:cfvo type="num">
<xm:f>1</xm:f>
</x14:cfvo>
<x14:fillColor rgb="FF63C384"/>
<x14:borderColor rgb="FF63C384"/>
<x14:negativeFillColor indexed="2"/>
<x14:negativeBorderColor indexed="2"/>
<x14:axisColor indexed="64"/>
</x14:dataBar>
</x14:cfRule>
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: Ie2c1ba2c85d9eead963f4d9b1684d72b64fe815d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149069
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153092
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 5328accac5c8..3209c846f9ce 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -165,11 +165,23 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl if (aType == "dataBar") { // an ext entry does not need to have an existing corresponding entry + ScDataBarFormatData* pInfo; ExtLst::const_iterator aExt = getExtLst().find( aId ); - if(aExt == getExtLst().end()) - return nullptr; + if (aExt == getExtLst().end()) + { + pInfo = new ScDataBarFormatData(); + if (pInfo) + { + auto pFormat = std::make_unique<ScDataBarFormat>(&getScDocument()); + pFormat->SetDataBarData(pInfo); + maEntries.push_back(std::move(pFormat)); + } + } + else + { + pInfo = aExt->second; + } - ScDataBarFormatData* pInfo = aExt->second; if (!pInfo) { return nullptr; |