summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-14 20:54:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-15 09:56:17 +0100
commit5f11ab0a62e0370d453f8b89497a1a2274776f36 (patch)
treeed2eb6a0d5b5fc11d426a97aecf50996db2a93e4 /sd
parentf3eaa4f2de419f5cb96608341ac7d979f5a07625 (diff)
Resolves: tdf#113826 use brush vs background conversion mode of dialog
Change-Id: If33e1672048c570887c2c53da646f86852bc6a6c Reviewed-on: https://gerrit.libreoffice.org/44740 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')
-rw-r--r--sd/source/ui/dlg/prltempl.cxx43
1 files changed, 4 insertions, 39 deletions
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index a81bf0107b95..039f72dbd650 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -63,8 +63,6 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
pOutSet ( nullptr ),
pOrgSet ( &rStyleBase.GetItemSet() )
{
- const SfxPoolItem *pItem = nullptr;
-
if( IS_OUTLINE(ePO))
{
// Unfortunately, the Itemsets of our style sheets are not discreet..
@@ -95,9 +93,9 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
pOutSet = new SfxItemSet( rStyleBase.GetItemSet() );
pOutSet->ClearItem();
-
// If there is no bullet item in this stylesheet, we get it
// from 'Outline 1' style sheet.
+ const SfxPoolItem *pItem = nullptr;
if( SfxItemState::SET != aInputSet.GetItemState(EE_PARA_NUMBULLET, false, &pItem ))
{
OUString aStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " 1");
@@ -111,44 +109,11 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell const * pDocSh,
// preselect selected layer in dialog
aInputSet.Put( SfxUInt16Item( SID_PARAM_CUR_NUM_LEVEL, 1<<GetOutlineLevel()));
- /*
- * Adjusting item set since background tabpage can only work
- * with SvxBrushItems, EE_CHAR_BKGCOLOR is SvxBackgroundColorItem.
- */
- aInputSet.MergeRange(SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR);
- pOutSet->MergeRange(SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR);
- if ( aInputSet.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 );
-
- aInputSet.ClearItem( EE_CHAR_BKGCOLOR );
- /* and stick it into the set */
- aInputSet.Put( aBrushItem );
- }
+ SetInputSet(&aInputSet);
}
else {
- /*
- * same here
- */
- aInputSet.SetRanges(pOrgSet->GetRanges());
- aInputSet.MergeRange(SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR);
- aInputSet.Put(*pOrgSet, false);
- if ( pOrgSet->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 );
-
- aInputSet.ClearItem( EE_CHAR_BKGCOLOR );
- /* and stick it into the set */
- aInputSet.Put( aBrushItem );
- }
+ SetInputSet(pOrgSet);
}
- SetInputSet( &aInputSet );
SvxColorListItem aColorListItem(*static_cast<const SvxColorListItem*>( mpDocShell->GetItem( SID_COLOR_TABLE ) ) );
SvxGradientListItem aGradientListItem(*static_cast<const SvxGradientListItem*>( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) );
@@ -316,7 +281,7 @@ void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
}
else if (nId == mnBackground)
{
- 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);
}
}