From 8519d51b3a06a84d0d6418651e66e9bb534f1788 Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Wed, 18 Mar 2015 10:31:11 +0100 Subject: Char highlight: export character background to MSO formats based on settings Change-Id: Iaaf9e7ee5e61cfabb0d675b83fa71776dece87e2 --- sw/qa/extras/globalfilter/globalfilter.cxx | 4 ++++ sw/source/filter/ww8/attributeoutputbase.hxx | 1 + sw/source/filter/ww8/ww8atr.cxx | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 71d2adaa5aa7..a74103765447 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -18,6 +18,7 @@ #include #include #include +#include class Test : public SwModelTestBase { @@ -364,6 +365,9 @@ void Test::testCharHighlight() "Office Open XML Text", }; + SvtFilterOptions& rOpt = SvtFilterOptions::Get(); + rOpt.SetCharBackground2Shading(); + for( size_t nFilter = 0; nFilter < SAL_N_ELEMENTS(aFilterNames); ++nFilter ) { if (mxComponent.is()) diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 5b8d268503c9..58a226a7202c 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -414,6 +414,7 @@ protected: virtual void CharAnimatedText( const SvxBlinkItem& ) = 0; /// Sfx item RES_CHRATR_BACKGROUND + void CharBackgroundBase( const SvxBrushItem& ); virtual void CharBackground( const SvxBrushItem& ) = 0; /// Sfx item RES_CHRATR_CJK_FONT diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index c52e9c352063..1bd05c8854b2 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -134,6 +134,7 @@ #include "fields.hxx" #include #include +#include using ::editeng::SvxBorderLine; using namespace ::com::sun::star; @@ -5310,7 +5311,7 @@ void AttributeOutputBase::OutputItem( const SfxPoolItem& rHt ) CharAnimatedText( static_cast< const SvxBlinkItem& >( rHt ) ); break; case RES_CHRATR_BACKGROUND: - CharBackground( static_cast< const SvxBrushItem& >( rHt ) ); + CharBackgroundBase( static_cast< const SvxBrushItem& >( rHt ) ); break; case RES_CHRATR_CJK_FONT: @@ -5633,4 +5634,17 @@ const SwRedlineData* AttributeOutputBase::GetParagraphMarkerRedline( const SwTxt return NULL; } +void AttributeOutputBase::CharBackgroundBase( const SvxBrushItem& rBrush ) +{ + const SvtFilterOptions& rOpt = SvtFilterOptions::Get(); + if( rOpt.IsCharBackground2Highlighting() ) + { + CharHighlight(rBrush); + } + else + { + CharBackground(rBrush); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit