diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-06-14 20:24:27 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-06-14 21:49:49 +0200 |
commit | 62fb96e075e79676b45912a3a8ec2702b1e3aaf2 (patch) | |
tree | e4c26a3e3b91e752e3816f1fbd629808e43275ba /sw | |
parent | b47151f5d1e287425511b45c5474e10eb0ba3a9d (diff) |
Handle highlighting case inside SvxBackgroundPage class
... instead of converting attributes.
Change-Id: I3e45c0641389a7b6bdecb5141646aa13ee5c0aa5
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/utlui/uitool.cxx | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index d793a99775cf..4b4344ca0840 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -127,28 +127,15 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode) { // Always use the visible background const SfxPoolItem *pTmpBrush; - bool bUseHighlight = false; if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_HIGHLIGHT, true, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) ); if( aTmpBrush.GetColor() != COL_TRANSPARENT ) { - aTmpBrush.SetWhich( RES_BACKGROUND ); + aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); rSet.Put( aTmpBrush ); - bUseHighlight = true; } } - if( !bUseHighlight ) - { - if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, true, &pTmpBrush ) ) - { - SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) ); - aTmpBrush.SetWhich( RES_BACKGROUND ); - rSet.Put( aTmpBrush ); - } - else - rSet.ClearItem(RES_BACKGROUND); - } } if( nMode == CONV_ATTR_STD ) @@ -181,12 +168,8 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, const sa // Background / highlighting { const SfxPoolItem *pTmpItem; - if( SfxItemState::SET == rSet.GetItemState( RES_BACKGROUND, false, &pTmpItem ) ) + if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) ) { - SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpItem) ); - aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); - rSet.Put( aTmpBrush ); - // Highlight is an MS specific thing, so remove it at the first time when LO modifies // this part of the imported document. rSet.Put( SvxBrushItem(RES_CHRATR_HIGHLIGHT) ); |