sw/source/filter/ww8/ww8atr.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit 98967613b4ca12f6be4d3a75be65caa3b45621e3 Author: Serge Krot <serge.k...@cib.de> AuthorDate: Fri Jan 10 14:44:25 2020 +0100 Commit: Thorsten Behrens <thorsten.behr...@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.behr...@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 <sberg...@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87537 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits