diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-07-05 09:10:05 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-07-05 09:29:43 +0200 |
commit | 4cb31f481e8bc271a39aaa4953edda8d898413be (patch) | |
tree | 89793a10a011c162f5c3d8af4baf2cd0712dddb9 | |
parent | e501e4549b3343f69b7ce19957e7bbc17d007d65 (diff) |
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.kaganski@collabora.com>
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
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))); } } |