summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-08-11 12:26:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-08-13 15:42:03 +0200
commit6284804c2ccb3ad8bb6e1c1dac8d622f66b8c07d (patch)
treeab5e6d8c1a8ae8b61824d262cd0424030c89779d /sd/source
parentf70e978f4bf223d7edbb4c3a981f46938a3b3ed1 (diff)
move the SvxBackgroundColorItem<->SvxBrushItem conversion
into the dialog itself Change-Id: I83db9f02145a4927257dd5691f82dad1a11eaea6 Reviewed-on: https://gerrit.libreoffice.org/41029 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/dlg/dlgchar.cxx2
-rw-r--r--sd/source/ui/func/fuchar.cxx26
2 files changed, 2 insertions, 26 deletions
diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx
index 57c7f2d18266..f60512623f1b 100644
--- a/sd/source/ui/dlg/dlgchar.cxx
+++ b/sd/source/ui/dlg/dlgchar.cxx
@@ -65,7 +65,7 @@ void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
else if (nId == mnCharBackground)
{
- aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
rPage.PageCreated(aSet);
}
}
diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx
index 4a8aedd64ece..b5c5a187bdce 100644
--- a/sd/source/ui/func/fuchar.cxx
+++ b/sd/source/ui/func/fuchar.cxx
@@ -68,33 +68,9 @@ void FuChar::DoExecute( SfxRequest& rReq )
SfxItemSet aEditAttr( mpDoc->GetPool() );
mpView->GetAttributes( aEditAttr );
- static const sal_uInt16 aRanges[] =
- {
- EE_ITEMS_START, EE_ITEMS_END,
- SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR,
- 0
- };
-
- SfxItemSet aNewAttr( mpViewShell->GetPool(),
- aRanges );
+ SfxItemSet aNewAttr(mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
aNewAttr.Put( aEditAttr, false );
- // EE_CHAR_BKGCOLOR is SvxBackgroundColorItem, but char background tabpage
- // can only work with SvxBrushItems (it requires major undertaking to have
- // it support anything else). Do the following then:
- const SfxPoolItem* pItem;
- if ( aNewAttr.GetItemState( EE_CHAR_BKGCOLOR, true, &pItem ) == SfxItemState::SET )
- {
- // extract Color outta SvxBackColorItem
- Color aBackColor = static_cast<const SvxBackgroundColorItem*>(pItem)->GetValue();
- // make new SvxBrushItem with this Color
- SvxBrushItem aBrushItem( aBackColor, SID_ATTR_BRUSH_CHAR );
-
- aNewAttr.ClearItem( EE_CHAR_BKGCOLOR );
- // and stick it into the set
- aNewAttr.Put( aBrushItem );
- }
-
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSdTabCharDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc->GetDocSh() ) : nullptr);
sal_uInt16 nResult = RET_CANCEL;