sc/source/filter/oox/extlstcontext.cxx |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

New commits:
commit ec44a178dbec1c7e3b7691634204fb2183c161c8
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Mar 17 11:07:14 2023 -0400
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jun 28 10:48:21 2023 +0200

    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 <hcas...@collabora.com>
    Change-Id: Ie2c1ba2c85d9eead963f4d9b1684d72b64fe815d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149069
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153092
    Tested-by: Jenkins
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153682

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;

Reply via email to