diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-12 12:55:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-07-01 10:04:53 +0200 |
commit | ff1f64b8019a6ac1f2d28105155c335191c537ad (patch) | |
tree | ab74dde469c3629a4331454c4c2013d0ab2a0209 /sw/source/filter/html | |
parent | 4f26bf4c1382d7c32dc61be15db92a2503628b9c (diff) |
Resolves: tdf#132739 two style tags where there should be just one
(cherry picked from commit 6833e0c0af09637bb410dc800435dcc6c8333680)
(cherry picked from commit 766b501cf48440d042b598215e101e5851743b09)
Change-Id: Id9c8c8cc8c5ffdd21ba79ff39a6279cf2ddc8025
Diffstat (limited to 'sw/source/filter/html')
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.hxx | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index b2d5aecb9e78..368f97926656 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2111,10 +2111,12 @@ void SwHTMLWriter::OutCSS1_TableFrameFormatOptions( const SwFrameFormat& rFrameF Strm().WriteChar( '\"' ); } -void SwHTMLWriter::OutCSS1_TableCellBorderHack(SwFrameFormat const& rFrameFormat) +void SwHTMLWriter::OutCSS1_TableCellBordersAndBG(SwFrameFormat const& rFrameFormat, const SvxBrushItem *pBrushItem) { SwCSS1OutMode const aMode( *this, CSS1_OUTMODE_STYLE_OPT_ON|CSS1_OUTMODE_ENCODE|CSS1_OUTMODE_TABLEBOX, nullptr ); + if (pBrushItem) + OutCSS1_SvxBrush(*this, *pBrushItem, Css1Background::Table, nullptr); OutCSS1_SvxBox(*this, rFrameFormat.GetBox()); if (!m_bFirstCSS1Property) { diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index 46632157af43..dea6d9d01b62 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -430,11 +430,14 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, // Avoid non-CSS version in the ReqIF case. rWrt.OutBackground( pBrushItem, false ); - if( rWrt.m_bCfgOutStyles ) - OutCSS1_TableBGStyleOpt( rWrt, *pBrushItem ); + if (!rWrt.m_bCfgOutStyles) + pBrushItem = nullptr; } - rWrt.OutCSS1_TableCellBorderHack(*pBox->GetFrameFormat()); + // tdf#132739 with rWrt.m_bCfgOutStyles of true bundle the brush item css + // properties into the same "style" tag as the borders so there is only one + // style tag + rWrt.OutCSS1_TableCellBordersAndBG(*pBox->GetFrameFormat(), pBrushItem); sal_uInt32 nNumFormat = 0; double nValue = 0.0; diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 66f1b6a57198..43e657261b31 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -484,7 +484,7 @@ public: void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, const OUString& rAltText, HtmlFrmOpts nFrameOpts); void OutCSS1_TableFrameFormatOptions( const SwFrameFormat& rFrameFormat ); - void OutCSS1_TableCellBorderHack(const SwFrameFormat& rFrameFormat); + void OutCSS1_TableCellBordersAndBG(const SwFrameFormat& rFrameFormat, const SvxBrushItem *pBrushItem); void OutCSS1_SectionFormatOptions( const SwFrameFormat& rFrameFormat, const SwFormatCol *pCol ); void OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat, HtmlFrmOpts nFrameOpts, const SdrObject *pSdrObj=nullptr, |