summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRohan Kumar <rohankanojia420@gmail.com>2017-01-21 01:31:34 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-03-01 10:58:43 +0000
commita04abc59ae24690992a771305a4e89451c77c289 (patch)
tree3d6925010d6f001b61ac425c67f3f83b74f332f1 /sd
parentd40a90f6d156fcdca8737295d85befe6cc384b8e (diff)
tdf#96681 Lack of UI to change the text background color of a style
Added Highlighting tab to Edit Style button in impress Change-Id: I9426f583da4078cd380823bbaa30ce1941ffa3bd Reviewed-on: https://gerrit.libreoffice.org/23684 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/prltempl.cxx1
-rw-r--r--sd/source/ui/func/futempl.cxx22
-rw-r--r--sd/source/ui/inc/prltempl.hxx1
-rw-r--r--sd/uiconfig/sdraw/ui/drawprtldialog.ui14
4 files changed, 38 insertions, 0 deletions
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 7c254907be91..03dfaf410b8f 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -149,6 +149,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
mnTab = AddTabPage( "RID_SVXPAGE_TABULATOR", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TABULATOR ), nullptr );
mnAsian = AddTabPage( "RID_SVXPAGE_PARA_ASIAN", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PARA_ASIAN ), nullptr );
mnAlign = AddTabPage( "RID_SVXPAGE_ALIGN_PARAGRAPH", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGN_PARAGRAPH ), nullptr );
+ mnBackground = AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr);
SvtCJKOptions aCJKOptions;
if( !aCJKOptions.IsAsianTypographyEnabled() )
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index bd978008831b..30893d8c4308 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -36,6 +36,8 @@
#include <editeng/editeng.hxx>
#include <editeng/lrspitem.hxx>
#include <svx/svdopage.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/brushitem.hxx>
#include <svx/svditer.hxx>
#include <svx/sdr/properties/properties.hxx>
@@ -103,6 +105,10 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
SfxStyleSheetBase* pStyleSheet = nullptr;
const SfxPoolItem* pItem;
+ static const sal_uInt16 aRanges[] = {
+ EE_ITEMS_START, EE_ITEMS_END,
+ SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR
+ };
SfxStyleFamily nFamily = (SfxStyleFamily)USHRT_MAX;
if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY,
false, &pItem ))
@@ -299,6 +305,15 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
ScopedVclPtr<SfxAbstractTabDialog> pPresDlg;
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
bool bOldDocInOtherLanguage = false;
+ SfxItemSet aNewAttr(mpViewShell->GetPool(), aRanges);
+
+ if( aNewAttr.GetItemState( XATTR_FILLBACKGROUND, true, &pItem ) == SfxItemState::SET)
+ {
+ Color aBackColor = static_cast<const SvxBackgroundColorItem*>(pItem)->GetValue();
+ SvxBrushItem aBrushItem(aBackColor, XATTR_FILLBACKGROUND);
+ aNewAttr.ClearItem(XATTR_FILLBACKGROUND);
+ aNewAttr.Put(aBrushItem);
+ }
SfxStyleFamily eFamily = pStyleSheet->GetFamily();
@@ -399,6 +414,13 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
SfxItemSet aTempSet(*pOutSet);
static_cast<SdStyleSheet*>(pStyleSheet)->AdjustToFontHeight(aTempSet);
+ const SvxBrushItem* pBrushItem = static_cast<const SvxBrushItem*>(aTempSet.GetItem(XATTR_FILLBACKGROUND));
+ if( pBrushItem )
+ {
+ SvxBackgroundColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR);
+ aTempSet.ClearItem(XATTR_FILLBACKGROUND);
+ aTempSet.Put(aBackColorItem);
+ }
/* Special treatment: reset the INVALIDS to
NULL-Pointer (otherwise INVALIDs or pointer point
to DefaultItems in the template; both would
diff --git a/sd/source/ui/inc/prltempl.hxx b/sd/source/ui/inc/prltempl.hxx
index e2b8bc672f19..0694e86cd1ed 100644
--- a/sd/source/ui/inc/prltempl.hxx
+++ b/sd/source/ui/inc/prltempl.hxx
@@ -61,6 +61,7 @@ private:
sal_uInt16 mnTab;
sal_uInt16 mnAsian;
sal_uInt16 mnAlign;
+ sal_uInt16 mnBackground;
PresentationObjects ePO;
diff --git a/sd/uiconfig/sdraw/ui/drawprtldialog.ui b/sd/uiconfig/sdraw/ui/drawprtldialog.ui
index c5c5fa2b7b30..561f63000965 100644
--- a/sd/uiconfig/sdraw/ui/drawprtldialog.ui
+++ b/sd/uiconfig/sdraw/ui/drawprtldialog.ui
@@ -298,6 +298,20 @@
<property name="tab_fill">False</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="RID_SVXPAGE_BACKGROUND">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Highlighting</property>
+ </object>
+ <packing>
+ <property name="position">15</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>