writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   19 +++------------
 1 file changed, 5 insertions(+), 14 deletions(-)

New commits:
commit 4cb31f481e8bc271a39aaa4953edda8d898413be
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Jul 5 09:10:05 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Jul 5 09:29:43 2023 +0200

    Related: tdf#131062 Simplify a bit
    
    The overly complicated processing was added in commit
    7f805108a4ccc5751d7cbcb722ded5247e398578 (tdf#131062 DOCX import:
    fix table-style paragraph background color, 2020-03-02). Setting
    sPropertyName to "ParaBackColor" was then nullified by not using
    its value for PROP_FILL_COLOR case, and using the old "FillColor"
    value instead. Likely that was just forgotten cleanup after some
    experimentation.
    
    Change-Id: I1facec63bf74a50b1f16a7accd243345c017a032
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154016
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index cd77182657c8..36add41691b0 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1115,15 +1115,10 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
                 // handle paragraph background color defined in 
CellColorHandler
                 if (eId == PROP_FILL_COLOR)
                 {
-                    // table style defines paragraph background color, use the 
correct property name
                     auto pFillStyleProp = 
std::find_if(rCellProperties.begin(), rCellProperties.end(),
                         [](const beans::PropertyValue& rProp) { return 
rProp.Name == "FillStyle"; });
-                    if ( pFillStyleProp != rCellProperties.end() &&
-                         pFillStyleProp->Value == 
uno::Any(drawing::FillStyle_SOLID) )
-                    {
-                        sPropertyName = "ParaBackColor";
-                    }
-                    else
+                    if ( pFillStyleProp == rCellProperties.end() ||
+                         pFillStyleProp->Value != 
uno::Any(drawing::FillStyle_SOLID) )
                     {
                         // FillStyle_NONE, skip table style usage for 
paragraph background color
                         continue;
@@ -1165,15 +1160,11 @@ void 
DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag
                     if ( bIsParaLevel && xParagraph->getString().getLength() 
== 0 )
                         continue;
 
-                    if ( eId != PROP_FILL_COLOR )
-                    {
-                        // apply style setting when the paragraph doesn't 
modify it
-                        
aProps.push_back(comphelper::makePropertyValue(sPropertyName, 
pCellProp->Value));
-                    }
-                    else
+                    // apply style setting when the paragraph doesn't modify it
+                    
aProps.push_back(comphelper::makePropertyValue(sPropertyName, 
pCellProp->Value));
+                    if (eId == PROP_FILL_COLOR)
                     {
                         // we need this for complete import of table-style 
based paragraph background color
-                        
aProps.push_back(comphelper::makePropertyValue("FillColor",  pCellProp->Value));
                         
aProps.push_back(comphelper::makePropertyValue("FillStyle",  
uno::Any(drawing::FillStyle_SOLID)));
                     }
                 }

Reply via email to