sd/source/ui/dlg/prltempl.cxx | 43 +++--------------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-)
New commits: commit 5f11ab0a62e0370d453f8b89497a1a2274776f36 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Nov 14 20:54:49 2017 +0000 Resolves: tdf#113826 use brush vs background conversion mode of dialog Change-Id: If33e1672048c570887c2c53da646f86852bc6a6c Reviewed-on: https://gerrit.libreoffice.org/44740 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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); } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits