tdf#88276: Add slot and handlers for toolbar|sidebar buttons

those changes make getting/setting of text background colour
possible from toolbar and sidebar buttons, but likely more
handlers needs to be added to various other places in the code

Change-Id: I698ca2304399befdd63317eb8872aa3129f27637
Reviewed-on: https://gerrit.libreoffice.org/15909
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
This commit is contained in:
Katarina Behrens
2015-05-26 14:56:09 +02:00
committed by Yousuf Philips
parent 4e6713e923
commit c1b9d61bac
10 changed files with 67 additions and 3 deletions

View File

@@ -211,7 +211,7 @@ const SfxItemInfo aItemInfos[EDITITEMCOUNT] = {
{ SID_ATTR_CHAR_OVERLINE, SfxItemPoolFlags::POOLABLE },
{ SID_ATTR_CHAR_CASEMAP, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_CASEMAP
{ SID_ATTR_CHAR_GRABBAG, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_GRABBAG
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_BKGCOLOR
{ SID_ATTR_CHAR_BACK_COLOR, SfxItemPoolFlags::POOLABLE }, // EE_CHAR_BKGCOLOR
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_TAB
{ 0, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_LINEBR
{ SID_ATTR_CHAR_CHARSETCOLOR, SfxItemPoolFlags::POOLABLE }, // EE_FEATURE_NOTCONV

View File

@@ -119,6 +119,7 @@
#define SID_ATTR_CHAR_LATIN_POSTURE ( SID_SVX_START + 997 )
#define SID_ATTR_CHAR_LATIN_WEIGHT ( SID_SVX_START + 998 )
#define SID_ATTR_CHAR_GRABBAG ( SID_SVX_START + 1142 )
#define SID_ATTR_CHAR_BACK_COLOR ( SID_SVX_START + 1143 )
// these ID didn't exist prior to the svx split, add new ids here
#define SID_ATTR_CHAR_OVERLINE ( SID_EDIT_START + 68 )
@@ -226,10 +227,11 @@
#define SID_ATTR_CHAR_LATIN_LANGUAGE ( SID_EDIT_START + 92 )
#define SID_ATTR_CHAR_LATIN_POSTURE ( SID_EDIT_START + 93 )
#define SID_ATTR_CHAR_LATIN_WEIGHT ( SID_EDIT_START + 94 )
#define SID_ATTR_CHAR_BACK_COLOR ( SID_EDIT_START + 95 )
*/
#if 94 > (SID_EDIT_END-SID_EDIT_START)
#error Resource-Ueberlauf in #line, #file
#if 95 > (SID_EDIT_END-SID_EDIT_START)
#error Resource-Overflow in #line, #file
#endif
#define SID_DRAW_TEXT_VERTICAL SID_ATTR_CHAR_VERTICAL

View File

@@ -233,6 +233,7 @@
// Strings of the ToolBox-Controls from tbcontrl.cxx
#define RID_SVXSTR_FILLPATTERN (RID_SVX_START + 191)
#define RID_SVXSTR_FRAME (RID_SVX_START + 192)
#define RID_SVXSTR_CHAR_BACK_COLOR (RID_SVX_START + 193)
#define RID_SVXSTR_FRAME_COLOR (RID_SVX_START + 194)
#define RID_SVXSTR_FRAME_STYLE (RID_SVX_START + 195)
#define RID_SVXSTR_EXTRAS_CHARBACKGROUND (RID_SVX_START + 196)

View File

@@ -2722,6 +2722,11 @@ interface DrawView
ExecMethod = ExecChar ;
StateMethod = GetAttrState ;
]
SID_ATTR_CHAR_BACK_COLOR
[
ExecMethod = ExecChar ;
StateMethod = GetAttrState ;
]
SID_ATTR_CHAR_KERNING
[
ExecMethod = ExecChar ;

View File

@@ -44,6 +44,12 @@ shell TextObjectBar
StateMethod = GetAttrState;
]
SID_ATTR_CHAR_BACK_COLOR // ole : ?, status : ?
[
ExecMethod = Execute;
StateMethod = GetAttrState;
]
SID_ATTR_CHAR_WEIGHT // ole : ?, status : ?
[
ExecMethod = Execute;

View File

@@ -215,6 +215,7 @@ void SdDLL::RegisterControllers()
SvxStyleToolBoxControl::RegisterControl(0, pMod);
SvxFontNameToolBoxControl::RegisterControl(0, pMod);
SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_COLOR, pMod );
SvxColorToolBoxControl::RegisterControl( SID_ATTR_CHAR_BACK_COLOR, pMod );
SvxGrafFilterToolBoxControl::RegisterControl( SID_GRFFILTER, pMod );
SvxGrafModeToolBoxControl::RegisterControl( SID_ATTR_GRAF_MODE, pMod );

View File

@@ -2169,6 +2169,31 @@ SvxColorItem Color SID_ATTR_CHAR_COLOR
GroupId = GID_FORMAT;
]
SvxBackgroundColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = FALSE,
MenuConfig = FALSE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
SfxBoolItem ColorControl SID_COLOR_CONTROL

View File

@@ -320,6 +320,7 @@ item INT16 SvxCharReliefItem;
item BOOL SvxBlinkItem;
item BOOL SvxAutoKernItem;
item INT32 SvxColorItem;
item INT32 SvxBackgroundColorItem;
item BOOL SvxContourItem;
item INT16 SvxFormatBreakItem; // enum
item BOOL SvxFormatKeepItem;

View File

@@ -1434,6 +1434,8 @@ void SvxColorWindow_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, co
aColor = static_cast<const XLineColorItem*>(pState)->GetColorValue();
else if ( pState->ISA( XFillColorItem ) )
aColor = static_cast<const XFillColorItem*>(pState)->GetColorValue();
else if ( pState->ISA( SvxBackgroundColorItem ) )
aColor = static_cast<const SvxBackgroundColorItem*>(pState)->GetValue();
}
if ( aColor == COL_TRANSPARENT )
@@ -2551,6 +2553,11 @@ SvxColorToolBoxControl::SvxColorToolBoxControl(
bSidebarType = false;
break;
case SID_ATTR_CHAR_BACK_COLOR:
addStatusListener( OUString( ".uno:CharBackColor" ));
mPaletteManager.SetLastColor( COL_YELLOW );
break;
case SID_FRAME_LINECOLOR:
addStatusListener( OUString( ".uno:FrameLineColor" ));
addStatusListener( OUString( ".uno:BorderTLBR" ));
@@ -2614,6 +2621,10 @@ VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_BACKGROUND ) );
break;
case SID_ATTR_CHAR_BACK_COLOR :
pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_CHAR_BACK_COLOR ) );
break;
case SID_FRAME_LINECOLOR:
pColorWin->SetText( SVX_RESSTR( RID_SVXSTR_FRAME_COLOR ) );
break;
@@ -2712,6 +2723,11 @@ void SvxColorToolBoxControl::Select(sal_uInt16 /*nSelectModifier*/)
aParamName = "BackColor";
break;
case SID_ATTR_CHAR_BACK_COLOR :
aCommand = ".uno:CharBackColor";
aParamName = "CharBackColor";
break;
case SID_FRAME_LINECOLOR :
aCommand = ".uno:FrameLineColor";
aParamName = "FrameLineColor";
@@ -2750,6 +2766,8 @@ void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XLineColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_FILL_COLOR )
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(XFillColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_CHAR_BACK_COLOR )
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxBackgroundColorItem), nSlotId ) );
else
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, TYPE(SvxColorItem), nSlotId ) );
}

View File

@@ -125,6 +125,11 @@ String RID_SVXSTR_EXTRAS_CHARBACKGROUND
Text [ en-US ] = "Highlighting" ;
};
String RID_SVXSTR_CHAR_BACK_COLOR
{
Text [ en-US ] = "Text Background Color" ;
};
String RID_SVXSTR_BACKGROUND
{
Text [ en-US ] = "Background";