[Libreoffice-commits] core.git: sw/source

Serge Krot (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 15 22:49:00 UTC 2020


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

New commits:
commit 9476dfe7d1b86b367966e7dedf67e11936c8d9d7
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 15 23:48:28 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>

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9e8d815d7de2..813ace50c4fc 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -256,6 +256,22 @@ void MSWordExportBase::ExportPoolItemsToCHP( ww8::PoolItems &rItems, sal_uInt16
 
                 AttrOutput().OutputItem( fontHeight );
              }
+             else if (nWhich == RES_CHRATR_COLOR)
+             {
+                const SvxBrushItem& rBrushColor = static_cast<const SvxBrushItem&>(*pItem);
+                const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, RES_CHRATR_BACKGROUND);
+                if (rBrushColor.GetColor() == COL_AUTO && pBackgroundItem)
+                {
+                    const SvxBrushItem& rBrushBackground = static_cast<const SvxBrushItem&>(*pBackgroundItem);
+                    SvxBrushItem 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