[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/source

Serge Krot (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 29 11:47:09 UTC 2020


 sw/source/filter/ww8/ww8atr.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 98967613b4ca12f6be4d3a75be65caa3b45621e3
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Fri Jan 10 14:44:25 2020 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Jan 29 12:46:38 2020 +0100

    tdf#129924 docx import: set background color
    
    Change-Id: If586a7a11e375c1592253630af87772bca40b52e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86542
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    
    tdf#129924 critical fix: use SvxColorItem instead of SvxBrushItem
    
    Change-Id: I09b1e9fe53315974864c8d6947c7cb861f069a68
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86953
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87537
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index dd9bcf6d02ef..892750d8240f 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -261,6 +261,22 @@ void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems &rItems, sal_uInt16
 
                 AttrOutput().OutputItem( fontHeight );
              }
+             else if (nWhich == RES_CHRATR_COLOR)
+             {
+                const SvxColorItem& rColor = static_cast<const SvxColorItem&>(*pItem);
+                const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, RES_CHRATR_BACKGROUND);
+                if (rColor.GetValue() == COL_AUTO && pBackgroundItem)
+                {
+                    const SvxBrushItem& rBrushBackground = static_cast<const SvxBrushItem&>(*pBackgroundItem);
+                    SvxColorItem aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, RES_CHRATR_COLOR);
+                    AttrOutput().OutputItem(aForeground);
+                }
+                else
+                {
+                    // default
+                    AttrOutput().OutputItem( *pItem );
+                }
+             }
              else
              {
                 AttrOutput().OutputItem( *pItem );


More information about the Libreoffice-commits mailing list