[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 13 11:02:55 UTC 2021


 sw/source/filter/html/css1atr.cxx  |    4 +++-
 sw/source/filter/html/htmltabw.cxx |    9 ++++++---
 sw/source/filter/html/wrthtml.hxx  |    2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 0b5243bcd938f65550ad240c8dab8a0a519d108e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 12 12:55:30 2021 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Aug 13 13:02:19 2021 +0200

    Resolves: tdf#132739 two style tags where there should be just one
    
    Change-Id: Id9c8c8cc8c5ffdd21ba79ff39a6279cf2ddc8025
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120359
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index f8fd83cf47aa..e956fb3a6890 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2063,10 +2063,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 5657b2fe1eb5..54d2d2bb3576 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -429,11 +429,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 340c1a0a81dc..00d281c8f8ab 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -494,7 +494,7 @@ public:
     void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& rFrameFormat, std::u16string_view 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,


More information about the Libreoffice-commits mailing list