diff options
Diffstat (limited to 'sw/source/filter/html/css1atr.cxx')
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 9619002314af..bc2449b865cc 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -185,9 +185,21 @@ OString lclConvToHex(sal_uInt16 nHex) bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue, std::optional<sw::Css1Background> oMode) { - if (!bReqIF || (oMode.has_value() && *oMode != sw::Css1Background::TableCell)) + if (!bReqIF) return false; + if (oMode.has_value() && *oMode != sw::Css1Background::TableCell) + { + // Table or row. + if (rProperty == sCSS1_P_background && rValue == "transparent") + { + // This is the default already. + return true; + } + + return false; + } + // Only allow these two keys, nothing else in ReqIF mode. if (rProperty == sCSS1_P_text_decoration) { @@ -244,7 +256,12 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp, const OUString *pSVal, std::optional<sw::Css1Background> oMode ) { - if (IgnorePropertyForReqIF(mbReqIF, pProp, sVal, oMode)) + OString aPropertyValue(sVal); + if (aPropertyValue.isEmpty() && pSVal) + { + aPropertyValue = pSVal->toUtf8(); + } + if (IgnorePropertyForReqIF(mbReqIF, pProp, aPropertyValue, oMode)) return; OStringBuffer sOut; |