diff options
author | Prashant Pandey <prashant3.yishu@gmail.com> | 2013-06-18 18:53:19 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-06-28 19:59:22 +0200 |
commit | 419cd55f6c738d795e4fa160ff7edf3dc0b7c5de (patch) | |
tree | c0c1850310a5c14c15d6c3fbf217e03034cd935c | |
parent | 6491e0ed5b460857a6f7af8d5b87099f57522a21 (diff) |
sidebar: ParaPropertyPanel conversion to .ui
Change-Id: Ib51c1499c51d9d7ca87f90622add431a8755dac6
-rw-r--r-- | include/svx/dialogs.hrc | 5 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 593 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.hrc | 97 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 46 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.src | 369 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebarparagraph.ui | 552 |
7 files changed, 927 insertions, 736 deletions
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc index 1d91d394ed1f..0f8d02cdb8a6 100644 --- a/include/svx/dialogs.hrc +++ b/include/svx/dialogs.hrc @@ -1004,8 +1004,11 @@ #define RID_SVXSTR_DOC_MODIFIED_NO (SVX_OOO_BUILD_START + 5) // 1235 #define RID_SVXSTR_DOC_LOAD (SVX_OOO_BUILD_START + 6) // 1236 +// sidebar-related resources (defined in the appropriate .hrc's) +#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1240) + // !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!! -#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1237) +#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1260) // ---------------------------------------------------------------------------- // if we have _a_lot_ time, we should group the resource ids by type, instead diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 9e3c2cf85fd3..f293a0ddc8ca 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -21,6 +21,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/redlinecontrol \ svx/uiconfig/ui/redlinefilterpage \ svx/uiconfig/ui/redlineviewpage \ + svx/uiconfig/ui/sidebarparagraph \ svx/uiconfig/ui/sidebartextpanel \ )) diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index f2d384075d63..1d11ebb7b414 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -50,12 +50,35 @@ using namespace cssu; using ::sfx2::sidebar::Theme; using ::sfx2::sidebar::ControlFactory; +const char UNO_LEFTPARA[] = ".uno:LeftPara"; +const char UNO_RIGHTPARA[] = ".uno:RightPara"; +const char UNO_CENTERPARA[] = ".uno:CenterPara"; +const char UNO_JUSTIFYPARA[] = ".uno:JustifyPara"; + +const char UNO_DEFAULTBULLET[] = ".uno:DefaultBullet"; +const char UNO_DEFAULTNUMBERING[] = ".uno:DefaultNumbering"; + +const char UNO_PARABACKCOLOR[] = ".uno:ParaBackColor"; + +const char UNO_INCREMENTINDENT[] = ".uno:IncrementIndent"; +const char UNO_DECREMENTINDENT[] = ".uno:DecrementIndent"; +const char UNO_HANGINGINDENT[] = ".uno:HangingIndent"; + +const char UNO_INCREMENTINDENT2[] = ".uno:IncrementIndent2"; +const char UNO_DECREMENTINDENT2[] = ".uno:DecrementIndent2"; +const char UNO_HANGINGINDENT2[] = ".uno:HangingIndent2"; + +const char UNO_LINESPACING[] = ".uno:LineSpacing"; + +const char UNO_CELLVERTTOP[] = ".uno:CellVertTop"; +const char UNO_CELLVERTCENTER[] = ".uno:CellVertCenter"; +const char UNO_CELLVERTBOTTOM[] = ".uno:CellVertBottom"; + +const char UNO_PARASPACEINC[] = ".uno:ParaspaceIncrease"; +const char UNO_PARASPACEDEC[] = ".uno:ParaspaceDecrease"; + namespace svx {namespace sidebar { #define DEFAULT_VALUE 0 -#define TOOLBOX_ITEM1 1 -#define TOOLBOX_ITEM2 2 -#define TOOLBOX_ITEM3 3 -#define TOOLBOX_ITEM4 4 #define MAX_DURCH 5670 @@ -68,37 +91,6 @@ namespace svx {namespace sidebar { #define MAX_SC_SD 116220200 #define NEGA_MAXVALUE -10000000 -#define POS_FT_PARA_SPACE Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y), MAP_APPFONT)) -#define POS_FT_PARA_SPACE2 Point(LogicToPixel(Point(FT_PARA_SPACE_X,FT_PARA_SPACE_Y2), MAP_APPFONT)) -#define POS_TBX_PARA_SPACE_INC_DEC Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y), MAP_APPFONT)) -#define POS_TBX_PARA_SPACE_INC_DEC2 Point(LogicToPixel(Point(TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y2), MAP_APPFONT)) -#define POS_FT_PARA_INDENT Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y), MAP_APPFONT)) -#define POS_FT_PARA_INDENT2 Point(LogicToPixel(Point(FT_PARA_INDENT_X,FT_PARA_INDENT_Y2), MAP_APPFONT)) -#define POS_TBX_PARA_INDENT_INC_DEC Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y), MAP_APPFONT)) -#define POS_TBX_PARA_INDENT_INC_DEC2 Point(LogicToPixel(Point(TBX_PARA_INDENT_INC_DEC_X,TBX_PARA_INDENT_INC_DEC_Y2), MAP_APPFONT)) -#define POS_MBX_TOP_DIST Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y), MAP_APPFONT)) -#define POS_MBX_TOP_DIST2 Point(LogicToPixel(Point(MBX_TOP_DIST_X,MBX_TOP_DIST_Y2), MAP_APPFONT)) -#define POS_MBX_BOT_DIST Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y), MAP_APPFONT)) -#define POS_MBX_BOT_DIST2 Point(LogicToPixel(Point(MBX_BOT_DIST_X,MBX_BOT_DIST_Y2), MAP_APPFONT)) -#define POS_MBX_LEFT_DIST Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y), MAP_APPFONT)) -#define POS_MBX_LEFT_DIST2 Point(LogicToPixel(Point(MBX_LEFT_DIST_X,MBX_LEFT_DIST_Y2), MAP_APPFONT)) -#define POS_MBX_RIGHT_DIST Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y), MAP_APPFONT)) -#define POS_MBX_RIGHT_DIST2 Point(LogicToPixel(Point(MBX_RIGHT_DIST_X,MBX_RIGHT_DIST_Y2), MAP_APPFONT)) -#define POS_MBX_FLINE_DIST Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y), MAP_APPFONT)) -#define POS_MBX_FLINE_DIST2 Point(LogicToPixel(Point(MBX_FLINE_DIST_X,MBX_FLINE_DIST_Y2), MAP_APPFONT)) -#define POS_IMG_SPACE1 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y), MAP_APPFONT)) -#define POS_IMG_SPACE12 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE1_Y2), MAP_APPFONT)) -#define POS_IMG_SPACE2 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y), MAP_APPFONT)) -#define POS_IMG_SPACE22 Point(LogicToPixel(Point(IMG_SPACE_X,IMG_SPACE2_Y2), MAP_APPFONT)) -#define POS_IMG_INDENT1 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y), MAP_APPFONT)) -#define POS_IMG_INDENT12 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT1_Y2), MAP_APPFONT)) -#define POS_IMG_INDENT2 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y), MAP_APPFONT)) -#define POS_IMG_INDENT22 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT2_Y2), MAP_APPFONT)) -#define POS_IMG_INDENT3 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y), MAP_APPFONT)) -#define POS_IMG_INDENT32 Point(LogicToPixel(Point(IMG_INDENT_X,IMG_INDENT3_Y2), MAP_APPFONT)) -#define TBX_LINE_SPACE Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y), MAP_APPFONT)) -#define TBX_LINE_SPACE2 Point(LogicToPixel(Point(TBX_LINE_SPACE_X,TBX_LINE_SPACE_Y2), MAP_APPFONT)) - ParaPropertyPanel* ParaPropertyPanel::Create ( Window* pParent, const cssu::Reference<css::frame::XFrame>& rxFrame, @@ -133,118 +125,78 @@ void ParaPropertyPanel::HandleContextChange ( { case CombinedEnumContext(Application_Calc, Context_DrawText): mpTBxVertAlign->Show(); - mpTBxVertAlignBackground->Show(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Hide(); - mpTBxNumBulletBackground->Hide(); ReSize(false); mpTbxIndent_IncDec->Show(); - mpTbxIndent_IncDecBackground->Show(); mpTbxProDemote->Hide(); - mpTbxProDemoteBackground->Hide(); break; case CombinedEnumContext(Application_DrawImpress, Context_Draw): case CombinedEnumContext(Application_DrawImpress, Context_TextObject): case CombinedEnumContext(Application_DrawImpress, Context_Graphic): mpTBxVertAlign->Hide(); - mpTBxVertAlignBackground->Hide(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Show(); - mpTBxNumBulletBackground->Show(); ReSize(true); mpTbxIndent_IncDec->Hide(); - mpTbxIndent_IncDecBackground->Hide(); mpTbxProDemote->Show(); - mpTbxProDemoteBackground->Show(); break; case CombinedEnumContext(Application_DrawImpress, Context_DrawText): mpTBxVertAlign->Show(); - mpTBxVertAlignBackground->Show(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Show(); - mpTBxNumBulletBackground->Show(); ReSize(true); mpTbxIndent_IncDec->Hide(); - mpTbxIndent_IncDecBackground->Hide(); mpTbxProDemote->Show(); - mpTbxProDemoteBackground->Show(); break; case CombinedEnumContext(Application_DrawImpress, Context_Table): mpTBxVertAlign->Show(); - mpTBxVertAlignBackground->Show(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Show(); - mpTBxNumBulletBackground->Show(); ReSize(true); mpTbxIndent_IncDec->Hide(); - mpTbxIndent_IncDecBackground->Hide(); mpTbxProDemote->Show(); - mpTbxProDemoteBackground->Show(); break; case CombinedEnumContext(Application_WriterVariants, Context_Default): case CombinedEnumContext(Application_WriterVariants, Context_Text): mpTBxVertAlign->Hide(); - mpTBxVertAlignBackground->Hide(); mpTBxBackColor->Show(); - mpTBxBackColorBackground->Show(); mpTBxNumBullet->Show(); - mpTBxNumBulletBackground->Show(); ReSize(true); mpTbxIndent_IncDec->Show(); - mpTbxIndent_IncDecBackground->Show(); mpTbxProDemote->Hide(); - mpTbxProDemoteBackground->Hide(); break; case CombinedEnumContext(Application_WriterVariants, Context_Table): mpTBxVertAlign->Show(); - mpTBxVertAlignBackground->Show(); mpTBxBackColor->Show(); - mpTBxBackColorBackground->Show(); mpTBxNumBullet->Show(); - mpTBxNumBulletBackground->Show(); ReSize(true); mpTbxIndent_IncDec->Show(); - mpTbxIndent_IncDecBackground->Show(); mpTbxProDemote->Hide(); - mpTbxProDemoteBackground->Hide(); break; case CombinedEnumContext(Application_WriterVariants, Context_DrawText): mpTBxVertAlign->Show(); - mpTBxVertAlignBackground->Show(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Hide(); - mpTBxNumBulletBackground->Hide(); ReSize(false); mpTbxIndent_IncDec->Show(); - mpTbxIndent_IncDecBackground->Show(); mpTbxProDemote->Hide(); - mpTbxProDemoteBackground->Hide(); break; case CombinedEnumContext(Application_WriterVariants, Context_Annotation): mpTBxVertAlign->Hide(); - mpTBxVertAlignBackground->Hide(); mpTBxBackColor->Hide(); - mpTBxBackColorBackground->Hide(); mpTBxNumBullet->Hide(); - mpTBxNumBulletBackground->Hide(); ReSize(false); mpTbxIndent_IncDec->Show(); - mpTbxIndent_IncDecBackground->Show(); mpTbxProDemote->Hide(); - mpTbxProDemoteBackground->Hide(); break; case CombinedEnumContext(Application_Calc, Context_EditCell): @@ -288,63 +240,8 @@ ParaPropertyPanel::~ParaPropertyPanel() delete mpLnSPItem; } -void ParaPropertyPanel::ReSize(bool bSize) +void ParaPropertyPanel::ReSize(bool /* bSize */) { - if(bSize) - { - //Paragraph spacing - mpFTUL->SetPosPixel(POS_FT_PARA_SPACE); - mpTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC); - mpTopDist->SetPosPixel(POS_MBX_TOP_DIST); - mpBottomDist->SetPosPixel(POS_MBX_BOT_DIST); - //Indent - mpFTIndent->SetPosPixel(POS_FT_PARA_INDENT); - mpTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); - mpTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC); - mpLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST); - mpRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST); - mpFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST); - //Line spacing - mpLineSPTbx->SetPosPixel(TBX_LINE_SPACE); - //image - maFISpace1.SetPosPixel(POS_IMG_SPACE1); - maFISpace2.SetPosPixel(POS_IMG_SPACE2); - maFIndent1.SetPosPixel(POS_IMG_INDENT1); - maFIndent2.SetPosPixel(POS_IMG_INDENT2); - maFIndent3.SetPosPixel(POS_IMG_INDENT3); - Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT); - aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); - aSize.setWidth(GetOutputSizePixel().Width()); - SetSizePixel(aSize); - } - else - { - //Paragraph spacing - mpFTUL->SetPosPixel(POS_FT_PARA_SPACE2); - mpTbxUL_IncDec->SetPosPixel(POS_TBX_PARA_SPACE_INC_DEC2); - mpTopDist->SetPosPixel(POS_MBX_TOP_DIST2); - mpBottomDist->SetPosPixel(POS_MBX_BOT_DIST2); - //Indent - mpFTIndent->SetPosPixel(POS_FT_PARA_INDENT2); - mpTbxIndent_IncDec->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); - mpTbxProDemote->SetPosPixel(POS_TBX_PARA_INDENT_INC_DEC2); - mpLeftIndent->SetPosPixel(POS_MBX_LEFT_DIST2); - mpRightIndent->SetPosPixel(POS_MBX_RIGHT_DIST2); - mpFLineIndent->SetPosPixel(POS_MBX_FLINE_DIST2); - //Line spacing - mpLineSPTbx->SetPosPixel(TBX_LINE_SPACE2); - //image - maFISpace1.SetPosPixel(POS_IMG_SPACE12); - maFISpace2.SetPosPixel(POS_IMG_SPACE22); - maFIndent1.SetPosPixel(POS_IMG_INDENT12); - maFIndent2.SetPosPixel(POS_IMG_INDENT22); - maFIndent3.SetPosPixel(POS_IMG_INDENT32); - Size aSize(GetOutputSizePixel().Width(),PARA_SECTIONPAGE_HEIGHT_2); - aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) ); - aSize.setWidth(GetOutputSizePixel().Width()); - SetSizePixel(aSize); - } - if (mxSidebar.is()) mxSidebar->requestLayout(); } @@ -369,25 +266,30 @@ void ParaPropertyPanel::EndNumberingPopupMode (void) void ParaPropertyPanel::InitToolBoxAlign() { - mpAlignToolBox->SetItemImage(TOOLBOX_ITEM1, maLeftAlignControl.GetIcon()); - mpAlignToolBox->SetItemImage(TOOLBOX_ITEM2, maCenterAlignControl.GetIcon()); - mpAlignToolBox->SetItemImage(TOOLBOX_ITEM3, maRightAlignControl.GetIcon()); - mpAlignToolBox->SetItemImage(TOOLBOX_ITEM4, maJustifyAlignControl.GetIcon()); + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); + const sal_uInt16 nIdCenter = mpAlignToolBox->GetItemId(UNO_CENTERPARA); + const sal_uInt16 nIdRight = mpAlignToolBox->GetItemId(UNO_RIGHTPARA); + const sal_uInt16 nIdJustify = mpAlignToolBox->GetItemId(UNO_JUSTIFYPARA); + + mpAlignToolBox->SetItemImage(nIdLeft, maLeftAlignControl.GetIcon()); + mpAlignToolBox->SetItemImage(nIdCenter, maCenterAlignControl.GetIcon()); + mpAlignToolBox->SetItemImage(nIdRight, maRightAlignControl.GetIcon()); + mpAlignToolBox->SetItemImage(nIdJustify, maJustifyAlignControl.GetIcon()); Link aLink = LINK( this, ParaPropertyPanel, AlignStyleModifyHdl_Impl ); mpAlignToolBox->SetSelectHdl( aLink ); - Size aTbxSize (mpAlignToolBox->CalcWindowSizePixel()); - mpAlignToolBox->SetOutputSizePixel( aTbxSize ); } void ParaPropertyPanel::InitToolBoxVertAlign() { - mpTBxVertAlign->SetItemImage(IID_VERT_TOP, maVertTop.GetIcon()); - mpTBxVertAlign->SetItemImage(IID_VERT_CENTER, maVertCenter.GetIcon()); - mpTBxVertAlign->SetItemImage(IID_VERT_BOTTOM, maVertBottom.GetIcon()); + const sal_uInt16 nIdVertTop = mpTBxVertAlign->GetItemId(UNO_CELLVERTTOP); + const sal_uInt16 nIdVertCenter = mpTBxVertAlign->GetItemId(UNO_CELLVERTCENTER); + const sal_uInt16 nIdVertBottom = mpTBxVertAlign->GetItemId(UNO_CELLVERTBOTTOM); + + mpTBxVertAlign->SetItemImage(nIdVertTop, maVertTop.GetIcon()); + mpTBxVertAlign->SetItemImage(nIdVertCenter, maVertCenter.GetIcon()); + mpTBxVertAlign->SetItemImage(nIdVertBottom, maVertBottom.GetIcon()); mpTBxVertAlign->SetSelectHdl(LINK(this,ParaPropertyPanel,VertTbxSelectHandler)); - Size aTbxSize (mpTBxVertAlign->CalcWindowSizePixel()); - mpTBxVertAlign->SetOutputSizePixel( aTbxSize ); } @@ -402,64 +304,66 @@ void ParaPropertyPanel::InitToolBoxIndent() mpRightIndent->SetAccessibleName(mpRightIndent->GetQuickHelpText()); mpFLineIndent->SetAccessibleName(mpFLineIndent->GetQuickHelpText()); + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); + const sal_uInt16 nIdCenter = mpAlignToolBox->GetItemId(UNO_CENTERPARA); + const sal_uInt16 nIdRight = mpAlignToolBox->GetItemId(UNO_RIGHTPARA); + if( Application::GetSettings().GetLayoutRTL()) { - mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon()); - mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon()); + mpTbxIndent_IncDec->SetItemImage(nIdLeft, maIncIndentControl.GetIcon()); + mpTbxIndent_IncDec->SetItemImage(nIdCenter, maDecIndentControl.GetIcon()); } else { - mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM1, maIncIndentControl.GetIcon()); - mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM2, maDecIndentControl.GetIcon()); + mpTbxIndent_IncDec->SetItemImage(nIdLeft, maIncIndentControl.GetIcon()); + mpTbxIndent_IncDec->SetItemImage(nIdCenter, maDecIndentControl.GetIcon()); } - mpTbxIndent_IncDec->SetItemImage(TOOLBOX_ITEM3,maIndHang); + mpTbxIndent_IncDec->SetItemImage(nIdRight, maIndHang); + aLink = LINK( this, ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl ); mpTbxIndent_IncDec->SetSelectHdl(aLink); m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); - Size aTbxSize = mpTbxIndent_IncDec->CalcWindowSizePixel(); - mpTbxIndent_IncDec->SetOutputSizePixel( aTbxSize ); if( Application::GetSettings().GetLayoutRTL()) { - mpTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon()); - mpTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon()); + mpTbxProDemote->SetItemImage(nIdLeft, maOutLineLeftControl.GetIcon()); + mpTbxProDemote->SetItemImage(nIdCenter, maOutLineRightControl.GetIcon()); } else { - mpTbxProDemote->SetItemImage(TOOLBOX_ITEM1, maOutLineLeftControl.GetIcon()); - mpTbxProDemote->SetItemImage(TOOLBOX_ITEM2, maOutLineRightControl.GetIcon()); + mpTbxProDemote->SetItemImage(nIdLeft, maOutLineLeftControl.GetIcon()); + mpTbxProDemote->SetItemImage(nIdCenter, maOutLineRightControl.GetIcon()); } - mpTbxProDemote->SetItemImage(TOOLBOX_ITEM3,maIndHang); + mpTbxProDemote->SetItemImage(nIdRight, maIndHang); aLink = LINK( this, ParaPropertyPanel, ClickProDemote_Hdl_Impl ); mpTbxProDemote->SetSelectHdl(aLink); m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); - aTbxSize = mpTbxProDemote->CalcWindowSizePixel(); - mpTbxProDemote->SetOutputSizePixel( aTbxSize ); } void ParaPropertyPanel::InitToolBoxBGColor() { - mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, TBI_BACK_COLOR, mpTBxBackColor.get())); + const sal_uInt16 nIdBackColor = mpTBxBackColor->GetItemId(UNO_PARABACKCOLOR); - mpTBxBackColor->SetItemImage(TBI_BACK_COLOR, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor); - mpTBxBackColor->SetItemBits( TBI_BACK_COLOR, mpTBxBackColor->GetItemBits( TBI_BACK_COLOR ) | TIB_DROPDOWNONLY ); + mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_BACKGROUND_COLOR, nIdBackColor, mpTBxBackColor)); + + mpTBxBackColor->SetItemImage(nIdBackColor, GetDisplayBackground().GetColor().IsDark()? maImgBackColorHigh : maImgBackColor); + mpTBxBackColor->SetItemBits( nIdBackColor, mpTBxBackColor->GetItemBits( nIdBackColor ) | TIB_DROPDOWNONLY ); Link aLink = LINK(this, ParaPropertyPanel, ToolBoxBackColorDDHandler); mpTBxBackColor->SetDropdownClickHdl ( aLink ); mpTBxBackColor->SetSelectHdl ( aLink ); - Size aTbxSize (mpTBxBackColor->CalcWindowSizePixel()); - mpTBxBackColor->SetOutputSizePixel( aTbxSize ); } void ParaPropertyPanel::InitToolBoxBulletsNumbering() { - mpTBxNumBullet->SetItemImage(IID_BULLET, maBulletOnOff.GetIcon()); - mpTBxNumBullet->SetItemImage(IID_NUMBER, maNumberOnOff.GetIcon()); + const sal_uInt16 nIdBullet = mpTBxNumBullet->GetItemId(UNO_DEFAULTBULLET); + const sal_uInt16 nIdNumber = mpTBxNumBullet->GetItemId(UNO_DEFAULTNUMBERING); + + mpTBxNumBullet->SetItemImage(nIdBullet, maBulletOnOff.GetIcon()); + mpTBxNumBullet->SetItemImage(nIdNumber, maNumberOnOff.GetIcon()); mpTBxNumBullet->SetDropdownClickHdl(LINK(this,ParaPropertyPanel,NumBTbxDDHandler)); mpTBxNumBullet->SetSelectHdl(LINK(this,ParaPropertyPanel,NumBTbxSelectHandler)); - Size aTbxSize (mpTBxNumBullet->CalcWindowSizePixel()); - mpTBxNumBullet->SetOutputSizePixel( aTbxSize ); } void ParaPropertyPanel::InitToolBoxSpacing() { @@ -475,46 +379,33 @@ void ParaPropertyPanel::InitToolBoxSpacing() // handle the workaround for accessing the images of commands // ParaspaceIncrease and ParaspaceDecrease. // See issue 122446 for more details. + + const sal_uInt16 nIdParaSpaceInc = mpTbxUL_IncDec->GetItemId(UNO_PARASPACEINC); + const sal_uInt16 nIdParaSpaceDec = mpTbxUL_IncDec->GetItemId(UNO_PARASPACEDEC); mpTbxUL_IncDec->SetItemImage( - BT_TBX_UL_INC, - sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(BT_TBX_UL_INC), mxFrame)); + nIdParaSpaceInc, + sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(nIdParaSpaceInc), mxFrame)); mpTbxUL_IncDec->SetItemImage( - BT_TBX_UL_DEC, - sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(BT_TBX_UL_DEC), mxFrame)); + nIdParaSpaceDec, + sfx2::sidebar::Tools::GetImage(mpTbxUL_IncDec->GetItemCommand(nIdParaSpaceDec), mxFrame)); aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl ); mpTbxUL_IncDec->SetSelectHdl(aLink); m_eULSpaceUnit = maULSpaceControl.GetCoreMetric(); - Size aTbxSize = mpTbxUL_IncDec->CalcWindowSizePixel(); - mpTbxUL_IncDec->SetOutputSizePixel( aTbxSize ); } void ParaPropertyPanel::InitToolBoxLineSpacing() { Link aLink = LINK( this, ParaPropertyPanel, ClickLineSPDropDownHdl_Impl ); mpLineSPTbx->SetDropdownClickHdl( aLink ); mpLineSPTbx->SetSelectHdl( aLink ); //support keyinput "ENTER" - mpLineSPTbx->SetItemBits( TOOLBOX_ITEM1, mpLineSPTbx->GetItemBits( TOOLBOX_ITEM1 ) | TIB_DROPDOWNONLY ); - mpLineSPTbx->SetItemImage(TOOLBOX_ITEM1,maSpace3); - Size aTbxSize = mpLineSPTbx->CalcWindowSizePixel(); - mpLineSPTbx->SetOutputSizePixel( aTbxSize ); + + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); + mpLineSPTbx->SetItemBits( nIdLeft, mpLineSPTbx->GetItemBits( nIdLeft ) | TIB_DROPDOWNONLY ); + mpLineSPTbx->SetItemImage(nIdLeft, maSpace3); } void ParaPropertyPanel::initial() { - mpFTUL->SetBackground(Wallpaper()); - mpFTIndent->SetBackground(Wallpaper()); - maFISpace1.SetBackground(Wallpaper()); - maFISpace2.SetBackground(Wallpaper()); - maFIndent1.SetBackground(Wallpaper()); - maFIndent2.SetBackground(Wallpaper()); - maFIndent3.SetBackground(Wallpaper()); - - maFISpace1.SetImage(maSpace1); - maFISpace2.SetImage(maSpace2); - maFIndent1.SetImage(maIndent3); - maFIndent2.SetImage(maIndent2); - maFIndent3.SetImage(maIndent1); - GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_LEFT,sal_True,sal_False); GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_CENTER,sal_True,sal_False); GetBindings()->Invalidate(SID_ATTR_PARA_ADJUST_RIGHT,sal_True,sal_False); @@ -534,12 +425,10 @@ void ParaPropertyPanel::initial() mpTBxVertAlign->SetMpSubEditAccLableBy(&mpTBxVertAlign); mpTBxNumBullet->SetAccRelationLabeledBy(&mpTBxNumBullet); mpTBxBackColor->SetMpSubEditAccLableBy(&mpTBxBackColor); - mpFTUL->SetAccRelationLabeledBy(&mpFTUL); mpTbxUL_IncDec->SetAccRelationLabeledBy(&mpTbxUL_IncDec); mpTopDist->SetAccRelationLabeledBy(&mpTopDist); mpBottomDist->SetAccRelationLabeledBy(&mpBottomDist); mpLineSPTbx->SetAccRelationLabeledBy(&mpLineSPTbx); - mpFTIndent->SetAccRelationLabeledBy(&mpFTIndent); mpTbxIndent_IncDec->SetAccRelationLabeledBy(&mpTbxIndent_IncDec); mpTbxProDemote->SetAccRelationLabeledBy(&mpTbxProDemote); mpLeftIndent->SetAccRelationLabeledBy(&mpLeftIndent); @@ -618,26 +507,31 @@ IMPL_LINK(ParaPropertyPanel, VertTbxSelectHandler, ToolBox*, pToolBox) sal_uInt16 nId = pToolBox->GetCurItemId(); sal_uInt16 nSID = SID_TABLE_VERT_NONE; EndTracking(); + + const sal_uInt16 nIdVertTop = mpTBxVertAlign->GetItemId(UNO_CELLVERTTOP); + const sal_uInt16 nIdVertCenter = mpTBxVertAlign->GetItemId(UNO_CELLVERTCENTER); + const sal_uInt16 nIdVertBottom = mpTBxVertAlign->GetItemId(UNO_CELLVERTBOTTOM); + if (nId == 1) { nSID = SID_TABLE_VERT_NONE; - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } else if (nId == 2) { nSID = SID_TABLE_VERT_CENTER; - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } else if (nId == 3) { nSID = SID_TABLE_VERT_BOTTOM; - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_CHECK); } SfxBoolItem aBoolItem(nSID, sal_True); GetBindings()->GetDispatcher()->Execute(nSID, SFX_CALLMODE_RECORD, &aBoolItem, 0L); @@ -647,20 +541,24 @@ IMPL_LINK(ParaPropertyPanel, VertTbxSelectHandler, ToolBox*, pToolBox) void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) { + const sal_uInt16 nIdVertTop = mpTBxVertAlign->GetItemId(UNO_CELLVERTTOP); + const sal_uInt16 nIdVertCenter = mpTBxVertAlign->GetItemId(UNO_CELLVERTCENTER); + const sal_uInt16 nIdVertBottom = mpTBxVertAlign->GetItemId(UNO_CELLVERTBOTTOM); + if (eState < SFX_ITEM_DONTCARE) { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); - mpTBxVertAlign->EnableItem(IID_VERT_TOP, sal_False); - mpTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_False); - mpTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_False); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); + mpTBxVertAlign->EnableItem(nIdVertTop, sal_False); + mpTBxVertAlign->EnableItem(nIdVertCenter, sal_False); + mpTBxVertAlign->EnableItem(nIdVertBottom, sal_False); } else { - mpTBxVertAlign->EnableItem(IID_VERT_TOP, sal_True); - mpTBxVertAlign->EnableItem(IID_VERT_CENTER, sal_True); - mpTBxVertAlign->EnableItem(IID_VERT_BOTTOM, sal_True); + mpTBxVertAlign->EnableItem(nIdVertTop, sal_True); + mpTBxVertAlign->EnableItem(nIdVertCenter, sal_True); + mpTBxVertAlign->EnableItem(nIdVertBottom, sal_True); if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem))) { const SfxBoolItem* pItem= (const SfxBoolItem*)pState; @@ -670,44 +568,44 @@ void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, c { if (nSID == SID_TABLE_VERT_NONE) { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_CHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } else if (nSID == SID_TABLE_VERT_CENTER) { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_CHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } else if (nSID == SID_TABLE_VERT_BOTTOM) { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_CHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_CHECK); } } else { if (nSID == SID_TABLE_VERT_NONE) { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); } else if (nSID == SID_TABLE_VERT_CENTER) { - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); } else if (nSID == SID_TABLE_VERT_BOTTOM) { - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } } } else { - mpTBxVertAlign->SetItemState(IID_VERT_TOP, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_CENTER, STATE_NOCHECK); - mpTBxVertAlign->SetItemState(IID_VERT_BOTTOM, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertTop, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertCenter, STATE_NOCHECK); + mpTBxVertAlign->SetItemState(nIdVertBottom, STATE_NOCHECK); } } } @@ -715,9 +613,10 @@ void ParaPropertyPanel::VertStateChanged(sal_uInt16 nSID, SfxItemState eState, c IMPL_LINK(ParaPropertyPanel, ToolBoxBackColorDDHandler,ToolBox*, pToolBox) { + const sal_uInt16 nIdBackColor = mpTBxBackColor->GetItemId(UNO_PARABACKCOLOR); sal_uInt16 nId = pToolBox->GetCurItemId(); - OSL_ASSERT(nId == TBI_BACK_COLOR); - if(nId == TBI_BACK_COLOR) + OSL_ASSERT(nId == nIdBackColor); + if(nId == nIdBackColor) { pToolBox->SetItemDown( nId, true ); maBGColorPopup.Show(*pToolBox); @@ -770,59 +669,58 @@ void ParaPropertyPanel::SetBGColor ( //==================================for Paragraph Alignment===================== IMPL_LINK( ParaPropertyPanel, AlignStyleModifyHdl_Impl, ToolBox*, pBox ) { - switch (pBox->GetCurItemId()) - { - case BT_SUBSTLEFT: + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); + const sal_uInt16 nIdRight = mpAlignToolBox->GetItemId(UNO_RIGHTPARA); + const sal_uInt16 nIdCenter = mpAlignToolBox->GetItemId(UNO_CENTERPARA); + const sal_uInt16 nIdJustify = mpAlignToolBox->GetItemId(UNO_JUSTIFYPARA); + + const OUString aCommand(pBox->GetItemCommand(pBox->GetCurItemId())); + if( aCommand == UNO_LEFTPARA ) { - pBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); - pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + pBox->SetItemState(nIdLeft, STATE_CHECK); + pBox->SetItemState(nIdCenter, STATE_NOCHECK); + pBox->SetItemState(nIdRight, STATE_NOCHECK); + pBox->SetItemState(nIdJustify, STATE_NOCHECK); SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_LEFT, sal_True ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_LEFT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); } - break; - case BT_SUBSTCENTER: + else if( aCommand == UNO_CENTERPARA ) { - pBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); - pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + pBox->SetItemState(nIdCenter, STATE_CHECK); + pBox->SetItemState(nIdLeft, STATE_NOCHECK); + pBox->SetItemState(nIdRight, STATE_NOCHECK); + pBox->SetItemState(nIdJustify, STATE_NOCHECK); SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_CENTER, sal_True ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_CENTER, SFX_CALLMODE_RECORD, &aBoolItem, 0L); } - break; - case BT_SUBSTRIGHT: + else if( aCommand == UNO_RIGHTPARA ) { - pBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); - pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + pBox->SetItemState(nIdRight, STATE_CHECK); + pBox->SetItemState(nIdLeft, STATE_NOCHECK); + pBox->SetItemState(nIdCenter, STATE_NOCHECK); + pBox->SetItemState(nIdJustify, STATE_NOCHECK); SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_RIGHT, sal_True ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_RIGHT, SFX_CALLMODE_RECORD, &aBoolItem, 0L); } - break; - case BT_SUBSTJUSTIFY: + else if( aCommand == UNO_JUSTIFYPARA ) { - pBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); - pBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); - pBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); + pBox->SetItemState(nIdJustify, STATE_CHECK); + pBox->SetItemState(nIdLeft, STATE_NOCHECK); + pBox->SetItemState(nIdRight, STATE_NOCHECK); + pBox->SetItemState(nIdCenter, STATE_NOCHECK); SfxBoolItem aBoolItem( SID_ATTR_PARA_ADJUST_BLOCK, sal_True ); GetBindings()->GetDispatcher()->Execute(SID_ATTR_PARA_ADJUST_BLOCK, SFX_CALLMODE_RECORD, &aBoolItem, 0L); } - break; - } - return 0; } + //==================================for Paragraph Indent===================== IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl) { SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); - aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); + aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent, m_eLRSpaceUnit ) ); + aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); + aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); @@ -854,8 +752,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl) sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); aMargin.SetTxtLeft( (const long)nVal ); - aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); + aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); + aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); @@ -889,8 +787,8 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl) nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); aMargin.SetTxtLeft( (const long)nVal ); - aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); + aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); + aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); @@ -901,9 +799,9 @@ IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl) case ID_HANGING_INDENT: { SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); - aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); + aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent, m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); + aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); + aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ))*(-1) ); GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); @@ -930,9 +828,9 @@ IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl) case SD_HANGING_INDENT: { SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE ); - aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent.get(), m_eLRSpaceUnit ) ); - aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent.get(), m_eLRSpaceUnit ))*(-1) ); + aMargin.SetTxtLeft( (const long)GetCoreValue( *mpLeftIndent, m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) ); + aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) ); + aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ))*(-1) ); GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); } @@ -944,15 +842,15 @@ IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl) IMPL_LINK( ParaPropertyPanel, ClickLineSPDropDownHdl_Impl, ToolBox*, pBox ) { - + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); const sal_uInt16 nId = pBox->GetCurItemId(); - OSL_ASSERT(nId == TOOLBOX_ITEM1); - if(nId == TOOLBOX_ITEM1) + + OSL_ASSERT(nId == nIdLeft); + if(nId == nIdLeft) { pBox->SetItemDown( nId, true ); maLineSpacePopup.Rearrange(meLnSpState,m_eMetricUnit,mpLnSPItem,maContext); maLineSpacePopup.Show(*pBox); - } return (0L); } @@ -971,9 +869,9 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl) IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) { - switch (pControl->GetCurItemId()) - { - case BT_TBX_UL_INC: + const OUString aCommand(pControl->GetItemCommand(pControl->GetCurItemId())); + + if( aCommand == UNO_PARASPACEINC) { SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); @@ -990,11 +888,9 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); } - break; - case BT_TBX_UL_DEC: - { + else if( aCommand == UNO_PARASPACEDEC) + { SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); - if( maUpper >= UL_STEP ) { maUpper -= UL_STEP; @@ -1004,6 +900,7 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) } else aMargin.SetUpper( DEFAULT_VALUE ); + if( maLower >= UL_STEP ) { maLower -= UL_STEP; @@ -1016,9 +913,8 @@ IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) GetBindings()->GetDispatcher()->Execute( SID_ATTR_PARA_ULSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L); - } - break; - } + } + return( 0L ); } @@ -1104,6 +1000,11 @@ void ParaPropertyPanel::NotifyItemUpdate( void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { + const sal_uInt16 nIdLeft = mpAlignToolBox->GetItemId(UNO_LEFTPARA); + const sal_uInt16 nIdRight = mpAlignToolBox->GetItemId(UNO_RIGHTPARA); + const sal_uInt16 nIdCenter = mpAlignToolBox->GetItemId(UNO_CENTERPARA); + const sal_uInt16 nIdJustify = mpAlignToolBox->GetItemId(UNO_JUSTIFYPARA); + if( eState >= SFX_ITEM_AVAILABLE ) { const SfxBoolItem* pItem = (const SfxBoolItem*)pState; @@ -1114,52 +1015,52 @@ void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState { if(IsChecked) { - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_CHECK); - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_CHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_NOCHECK); } else - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_NOCHECK); } break; case SID_ATTR_PARA_ADJUST_CENTER: { if(IsChecked) { - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_CHECK); - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_CHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_NOCHECK); } else - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_NOCHECK); } break; case SID_ATTR_PARA_ADJUST_RIGHT: { if(IsChecked) { - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_CHECK); - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_CHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_NOCHECK); } else - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_NOCHECK); } break; case SID_ATTR_PARA_ADJUST_BLOCK: { if(IsChecked) { - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_CHECK); - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_CHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_NOCHECK); } else - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_NOCHECK); } break; } @@ -1172,16 +1073,16 @@ void ParaPropertyPanel::StateChangedAlignmentImpl( sal_uInt16 nSID, SfxItemState switch (nSID) { case SID_ATTR_PARA_ADJUST_LEFT: - mpAlignToolBox->SetItemState(BT_SUBSTLEFT,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdLeft,STATE_NOCHECK); break; case SID_ATTR_PARA_ADJUST_CENTER: - mpAlignToolBox->SetItemState(BT_SUBSTCENTER,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdCenter,STATE_NOCHECK); break; case SID_ATTR_PARA_ADJUST_RIGHT: - mpAlignToolBox->SetItemState(BT_SUBSTRIGHT,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdRight,STATE_NOCHECK); break; case SID_ATTR_PARA_ADJUST_BLOCK: - mpAlignToolBox->SetItemState(BT_SUBSTJUSTIFY,STATE_NOCHECK); + mpAlignToolBox->SetItemState(nIdJustify,STATE_NOCHECK); break; } } @@ -1229,6 +1130,8 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat break; } + const sal_uInt16 nIdHangingIndent = mpTbxIndent_IncDec->GetItemId(UNO_HANGINGINDENT); + const sal_uInt16 nIdHangingIndent2 = mpTbxIndent_IncDec->GetItemId(UNO_HANGINGINDENT2); if( pState && eState >= SFX_ITEM_AVAILABLE ) { SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState; @@ -1289,16 +1192,20 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat } mpTbxIndent_IncDec->Enable(); - mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True); + + const sal_uInt16 nIdIncrIndent = mpTbxIndent_IncDec->GetItemId(UNO_INCREMENTINDENT); + const sal_uInt16 nIdDecrIndent = mpTbxIndent_IncDec->GetItemId(UNO_DECREMENTINDENT); + + mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, sal_True); if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) { - mpTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True); - mpTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True); + mpTbxIndent_IncDec->EnableItem(nIdIncrIndent, sal_True); + mpTbxIndent_IncDec->EnableItem(nIdDecrIndent, sal_True); } - mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True); + mpTbxProDemote->EnableItem(nIdHangingIndent2, sal_True); } else if( eState == SFX_ITEM_DISABLED ) { @@ -1311,10 +1218,10 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) mpTbxIndent_IncDec->Disable(); else - mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); + mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, sal_False); // maTbxProDemote->Disable(); - mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); + mpTbxProDemote->EnableItem(nIdHangingIndent2, sal_False); } else { @@ -1326,8 +1233,8 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) ) mpTbxIndent_IncDec->Disable(); else - mpTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False); - mpTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False); + mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, sal_False); + mpTbxProDemote->EnableItem(nIdHangingIndent2, sal_False); } } @@ -1420,8 +1327,11 @@ void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eSt { // Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT // - namely SFX_ITEM_UNKNOWN and SFX_ITEM_DISABLED + const sal_uInt16 nIdIncrIndent = mpTbxIndent_IncDec->GetItemId(UNO_INCREMENTINDENT); + const sal_uInt16 nIdDecrIndent = mpTbxIndent_IncDec->GetItemId(UNO_DECREMENTINDENT); + mpTbxIndent_IncDec->EnableItem( - nSID == SID_INC_INDENT ? BT_TBX_INDENT_INC : BT_TBX_INDENT_DEC, + nSID == SID_INC_INDENT ? nIdIncrIndent : nIdDecrIndent, ( pState && eState == SFX_ITEM_UNKNOWN ) ? sal_True : sal_False ); } } @@ -1434,16 +1344,20 @@ void ParaPropertyPanel::StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState { const SfxBoolItem* pItem= (const SfxBoolItem*)pState; const sal_Bool aBool = (sal_Bool)pItem->GetValue(); + + const sal_uInt16 nIdNumber = mpTBxNumBullet->GetItemId(UNO_DEFAULTNUMBERING); + const sal_uInt16 nIdBullet = mpTBxNumBullet->GetItemId(UNO_DEFAULTBULLET); + if (nSID==FN_NUM_NUMBERING_ON) { mpTBxNumBullet->SetItemState( - IID_NUMBER, + nIdNumber, aBool ? STATE_CHECK : STATE_NOCHECK ); } else if (nSID==FN_NUM_BULLET_ON) { mpTBxNumBullet->SetItemState( - IID_BULLET, + nIdBullet, aBool ? STATE_CHECK : STATE_NOCHECK ); } } @@ -1548,37 +1462,9 @@ ParaPropertyPanel::ParaPropertyPanel(Window* pParent, const cssu::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, const cssu::Reference<css::ui::XSidebar>& rxSidebar) - : Control(pParent, SVX_RES(RID_SIDEBAR_PARA_PANEL)), - mpAlignToolBoxBackground(ControlFactory::CreateToolBoxBackground(this)), - mpAlignToolBox (ControlFactory::CreateToolBox(mpAlignToolBoxBackground.get(),SVX_RES(TBX_HORIZONTALALIGNMENT))), - mpTBxVertAlignBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTBxVertAlign (ControlFactory::CreateToolBox(mpTBxVertAlignBackground.get(),SVX_RES(TBX_VERT_ALIGN))), - mpTBxNumBulletBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTBxNumBullet (ControlFactory::CreateToolBox(mpTBxNumBulletBackground.get(),SVX_RES(TBX_NUM_BULLET))), - mpTBxBackColorBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTBxBackColor (ControlFactory::CreateToolBox(mpTBxBackColorBackground.get(),SVX_RES(TBX_BACK_COLOR))), - mpFTUL (new FixedText(this, SVX_RES(FT_SPACING))), - mpTbxUL_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTbxUL_IncDec (ControlFactory::CreateToolBox(mpTbxUL_IncDecBackground.get(),SVX_RES(TBX_UL_INC_DEC))), - mpTopDist (new SvxRelativeField(this, SVX_RES(MF_ABOVE_PARASPACING))), - mpBottomDist (new SvxRelativeField(this, SVX_RES(MF_BELOW_PARASPACING))), - mpLineSPTbxBackground(ControlFactory::CreateToolBoxBackground(this)), - mpLineSPTbx (ControlFactory::CreateToolBox(mpLineSPTbxBackground.get(),SVX_RES(TBX_LINESP))), - mpFTIndent (new FixedText(this, SVX_RES(FT_INDENT))), - mpTbxIndent_IncDecBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTbxIndent_IncDec (ControlFactory::CreateToolBox(mpTbxIndent_IncDecBackground.get(),SVX_RES(TBX_INDENT_INC_DEC))), - mpTbxProDemoteBackground(ControlFactory::CreateToolBoxBackground(this)), - mpTbxProDemote (ControlFactory::CreateToolBox(mpTbxProDemoteBackground.get(),SVX_RES(TBX_INDENT_PRO_DEMOTE))), - mpLeftIndent (new SvxRelativeField(this, SVX_RES(MF_BEFORE_INDENT))), - mpRightIndent (new SvxRelativeField(this, SVX_RES(MF_AFTER_INDENT))), - mpFLineIndent (new SvxRelativeField(this, SVX_RES(MF_FL_INDENT))), + : PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame), mpColorUpdater (), - maFISpace1 ( this, SVX_RES( FI_SPACE1)), - maFISpace2 ( this, SVX_RES( FI_SPACE2)), - maFIndent1 ( this, SVX_RES( FI_INDENT1)), - maFIndent2 ( this, SVX_RES( FI_INDENT2)), - maFIndent3 ( this, SVX_RES( FI_INDENT3)), maSpace1 (SVX_RES(IMG_SPACE1)), maSpace2 (SVX_RES(IMG_SPACE2)), maSpace3 (SVX_RES(IMG_SPACE3)), @@ -1634,8 +1520,23 @@ ParaPropertyPanel::ParaPropertyPanel(Window* pParent, maBGColorPopup(this, ::boost::bind(&ParaPropertyPanel::CreateBGColorPopupControl, this, _1)), mxSidebar(rxSidebar) { + //Alignment + get(mpAlignToolBox, "horizontalalignment"); + get(mpTBxVertAlign, "verticalalignment"); + //NumBullet&Backcolor + get(mpTBxNumBullet, "numberbullet"); + get(mpTBxBackColor, "backgroundcolor"); + //Paragraph spacing + get(mpTopDist, "aboveparaspacing"); + get(mpBottomDist, "belowparaspacing"); + get(mpTbxIndent_IncDec, "indent"); + get(mpLineSPTbx, "linespacing"); + get(mpTbxUL_IncDec, "paraspacing"); + get(mpLeftIndent, "beforetextindent"); + get(mpRightIndent, "aftertextindent"); + get(mpFLineIndent, "firstlineindent"); + initial(); - FreeResource(); } } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc index 4d8fe960005b..32464a7130b4 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc @@ -15,75 +15,55 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #include "svx/dialogs.hrc" -#define BT_SUBSTLEFT 1 -#define BT_SUBSTCENTER 2 -#define BT_SUBSTRIGHT 3 -#define BT_SUBSTJUSTIFY 4 -#define BT_BTX_LINESP 1 #define BT_TBX_INDENT_INC 1 #define BT_TBX_INDENT_DEC 2 -#define BT_TBX_UL_INC 1 -#define BT_TBX_UL_DEC 2 -#define ID_HANGING_INDENT 3 #define BT_TBX_INDENT_PROMOTE 1 #define BT_TBX_INDENT_DEMOTE 2 +#define ID_HANGING_INDENT 3 #define SD_HANGING_INDENT 3 #define MF_BEFORE_INDENT 2 #define MF_AFTER_INDENT 4 #define MF_FL_INDENT 6 -#define TBX_HORIZONTALALIGNMENT 5 -#define IMG_INDENT_HANG 15 -#define FT_INDENT 16 #define TBX_INDENT_INC_DEC 17 -#define FI_SPACE1 18 -#define FI_SPACE2 19 -#define FI_INDENT1 20 -#define FI_INDENT2 21 -#define FI_INDENT3 22 -#define IMG_SPACE3 23 -#define TBX_LINESP 25 -#define IMG_SPACE1 26 -#define IMG_INDENT1 27 -#define IMG_INDENT2 28 -#define IMG_SPACE2 29 -#define IMG_INDENT3 30 -#define FT_SPACING 31 -#define TBX_UL_INC_DEC 33 + #define MF_ABOVE_PARASPACING 32 #define MF_BELOW_PARASPACING 34 #define TBX_INDENT_PRO_DEMOTE 35 -#define TBX_VERT_ALIGN 40 -#define TBX_NUM_BULLET 44 #define IL_NUM_BULLET 45 #define FT_BACK_COLOR 47 -#define TBX_BACK_COLOR 48 -#define TBI_BACK_COLOR 49 -#define IMG_BACK_COLOR 50 -#define IMG_BACK_COLOR_H 51 #define IL_NUM_BULLET_RTL 52 //sym2_7380 -#define TBI_VERT_ALIGN_TOP 60 -#define TBI_VERT_ALIGN_CENTER 61 -#define TBI_VERT_ALIGN_BOT 62 -#define TBI_NUMBERING 63 -#define TBI_BULLET 64 + #define TBI_HOR_ALIGN_LEFT 65 #define TBI_HOR_ALIGN_CENTER 66 #define TBI_HOR_ALIGN_RIGHT 67 #define TBI_HOR_ALIGN_JUSTIFY 68 -#define TBI_INDENT_INC 69 -#define TBI_INDENT_DEC 70 -#define TBI_UL_INC 71 -#define TBI_UL_DEC 72 -//for vertical alignment -#define IID_VERT_TOP 1 -#define IID_VERT_CENTER 2 -#define IID_VERT_BOTTOM 3 - -//for numbering and bullett +//============================== Global Definitions ============================== +#define IMG_BACK_COLOR (RID_SVX_SIDEBAR_BEGIN + 0) +#define IMG_BACK_COLOR_H (RID_SVX_SIDEBAR_BEGIN + 1) +#define IMG_SPACE1 (RID_SVX_SIDEBAR_BEGIN + 2) +#define IMG_SPACE2 (RID_SVX_SIDEBAR_BEGIN + 3) +#define IMG_SPACE3 (RID_SVX_SIDEBAR_BEGIN + 4) +#define IMG_INDENT1 (RID_SVX_SIDEBAR_BEGIN + 5) +#define IMG_INDENT2 (RID_SVX_SIDEBAR_BEGIN + 6) +#define IMG_INDENT3 (RID_SVX_SIDEBAR_BEGIN + 7) +#define IMG_INDENT_HANG (RID_SVX_SIDEBAR_BEGIN + 8) +#define IMG_SPACING1 (RID_SVX_SIDEBAR_BEGIN + 9) +#define IMG_SPACING115 (RID_SVX_SIDEBAR_BEGIN + 10) +#define IMG_SPACING15 (RID_SVX_SIDEBAR_BEGIN + 11) +#define IMG_SPACING2 (RID_SVX_SIDEBAR_BEGIN + 12) +#define IMG_SEL_SPACING1 (RID_SVX_SIDEBAR_BEGIN + 13) +#define IMG_SEL_SPACING115 (RID_SVX_SIDEBAR_BEGIN + 14) +#define IMG_SEL_SPACING15 (RID_SVX_SIDEBAR_BEGIN + 15) +#define IMG_SEL_SPACING2 (RID_SVX_SIDEBAR_BEGIN + 16) +#define IMG_CUSTOM (RID_SVX_SIDEBAR_BEGIN + 17) +#define IMG_CUSTOM_GRAY (RID_SVX_SIDEBAR_BEGIN + 18) + +//for numbering and bullet #define IID_BULLET 1 #define IID_NUMBER 2 //============================== popup bullet and numbering & back color ========================= @@ -107,14 +87,6 @@ #define FT_CUSTOM 14 #define FT_LINE_SPACING 15 #define FT_OF 16 -#define IMG_SPACING1 18 -#define IMG_SPACING115 19 -#define IMG_SPACING15 20 -#define IMG_SPACING2 21 -#define IMG_SEL_SPACING1 23 -#define IMG_SEL_SPACING115 24 -#define IMG_SEL_SPACING15 25 -#define IMG_SEL_SPACING2 26 #define IMG_LPCUSTOMNOBORDER 27 #define FI_CUSTOM_NOBORDER_LSPACE 28 #define LINE_SPACING 29 @@ -122,8 +94,6 @@ #define STR_SPACING115 31 #define STR_SPACING15 32 #define STR_SPACING2 33 -#define IMG_CUSTOM 34 -#define IMG_CUSTOM_GRAY 35 #define STR_LCVALUE 36 #define STR_LS_SINGLE 37 #define STR_LS_115 38 @@ -233,14 +203,9 @@ #define TBX_HORI_ALIGN_Y SECTIONPAGE_MARGIN_VERTICAL_TOP #define TBX_VERT_ALIGN_X TBX_HORI_ALIGN_X + TBX_OUT_BORDER_OFFSET_X*2 + TOOLBOX_ITEM_WIDTH * 4 + CONTROL_SPACING_HORIZONTAL -#define TBX_VERT_ALIGN_Y TBX_HORI_ALIGN_Y -#define TBX_NUM_BULLET_X TBX_HORI_ALIGN_X #define TBX_NUM_BULLET_Y TBX_HORI_ALIGN_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 1 -#define TBX_BACK_COLOR_X TBX_HORI_ALIGN_X + TBX_OUT_BORDER_OFFSET_X*2 + TOOLBOX_ITEM_WIDTH * 3 + CONTROL_SPACING_HORIZONTAL -#define TBX_BACK_COLOR_Y TBX_NUM_BULLET_Y - #define FT_PARA_SPACE_X SECTIONPAGE_MARGIN_HORIZONTAL #define FT_PARA_SPACE_Y TBX_NUM_BULLET_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 3 #define FT_PARA_SPACE_Y2 TBX_HORI_ALIGN_Y + TOOLBOX_ITEM_HEIGHT + CONTROL_SPACING_VERTICAL - 2 @@ -250,7 +215,7 @@ #define TBX_PARA_SPACE_INC_DEC_Y2 FT_PARA_SPACE_Y2 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL #define FT_PARA_INDENT_X TBX_VERT_ALIGN_X -#define FT_PARA_INDENT_Y FT_PARA_SPACE_Y + #define FT_PARA_INDENT_Y2 FT_PARA_SPACE_Y2 #define TBX_PARA_INDENT_INC_DEC_X TBX_VERT_ALIGN_X @@ -280,14 +245,6 @@ #define MBX_FLINE_DIST_Y MBX_RIGHT_DIST_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL #define MBX_FLINE_DIST_Y2 MBX_RIGHT_DIST_Y2 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL -#define IMG_INDENT_X FT_PARA_INDENT_X - 4 -#define IMG_INDENT1_Y MBX_LEFT_DIST_Y - 1 -#define IMG_INDENT2_Y MBX_RIGHT_DIST_Y - 1 -#define IMG_INDENT3_Y MBX_FLINE_DIST_Y - 1 -#define IMG_INDENT1_Y2 MBX_LEFT_DIST_Y2 - 1 -#define IMG_INDENT2_Y2 MBX_RIGHT_DIST_Y2- 1 -#define IMG_INDENT3_Y2 MBX_FLINE_DIST_Y2- 1 - #define TBX_LINE_SPACE_X TBX_HORI_ALIGN_X #define TBX_LINE_SPACE_Y MBX_FLINE_DIST_Y #define TBX_LINE_SPACE_Y2 MBX_FLINE_DIST_Y2 diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 1eb4b038894a..8452ce74d066 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -23,6 +23,7 @@ #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <editeng/lspcitem.hxx> #include <svtools/ctrlbox.hxx> +#include <svx/sidebar/PanelLayout.hxx> #include <svx/tbxcolorupdate.hxx> #include <svx/relfld.hxx> #include <editeng/svxenum.hxx> @@ -56,7 +57,7 @@ class PopupControl; class PopupContainer; class ParaPropertyPanel - : public Control, + : public PanelLayout, public ::sfx2::sidebar::IContextChangeReceiver, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { @@ -95,31 +96,21 @@ private: ** ***********************************************************/ //Alignment - ::boost::scoped_ptr<Window> mpAlignToolBoxBackground; - ::boost::scoped_ptr<ToolBox> mpAlignToolBox; - ::boost::scoped_ptr<Window> mpTBxVertAlignBackground; - ::boost::scoped_ptr<ToolBox> mpTBxVertAlign; + ToolBox* mpAlignToolBox; + ToolBox* mpTBxVertAlign; //NumBullet&Backcolor - ::boost::scoped_ptr<Window> mpTBxNumBulletBackground; - ::boost::scoped_ptr<ToolBox> mpTBxNumBullet; - ::boost::scoped_ptr<Window> mpTBxBackColorBackground; - ::boost::scoped_ptr<ToolBox> mpTBxBackColor; + ToolBox* mpTBxNumBullet; + ToolBox* mpTBxBackColor; //Paragraph spacing - ::boost::scoped_ptr<FixedText> mpFTUL; - ::boost::scoped_ptr<Window> mpTbxUL_IncDecBackground; - ::boost::scoped_ptr<ToolBox> mpTbxUL_IncDec; - ::boost::scoped_ptr<SvxRelativeField> mpTopDist; - ::boost::scoped_ptr<SvxRelativeField> mpBottomDist; - ::boost::scoped_ptr<Window> mpLineSPTbxBackground; - ::boost::scoped_ptr<ToolBox> mpLineSPTbx; - ::boost::scoped_ptr<FixedText> mpFTIndent; - ::boost::scoped_ptr<Window> mpTbxIndent_IncDecBackground; - ::boost::scoped_ptr<ToolBox> mpTbxIndent_IncDec; - ::boost::scoped_ptr<Window> mpTbxProDemoteBackground; - ::boost::scoped_ptr<ToolBox> mpTbxProDemote; - ::boost::scoped_ptr<SvxRelativeField> mpLeftIndent; - ::boost::scoped_ptr<SvxRelativeField> mpRightIndent; - ::boost::scoped_ptr<SvxRelativeField> mpFLineIndent; + ToolBox* mpTbxUL_IncDec; + SvxRelativeField* mpTopDist; + SvxRelativeField* mpBottomDist; + ToolBox* mpLineSPTbx; + ToolBox* mpTbxIndent_IncDec; + ToolBox* mpTbxProDemote; + SvxRelativeField* mpLeftIndent; + SvxRelativeField* mpRightIndent; + SvxRelativeField* mpFLineIndent; ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater; @@ -128,11 +119,6 @@ private: ** Resources ** ***********************************************************/ - FixedImage maFISpace1; - FixedImage maFISpace2; - FixedImage maFIndent1; - FixedImage maFIndent2; - FixedImage maFIndent3; Image maSpace1; Image maSpace2; @@ -172,7 +158,7 @@ private: SfxMapUnit m_eULSpaceUnit; /**************************************************************** ** - ** Controll Items + ** Control Items ** *****************************************************************/ diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.src b/svx/source/sidebar/paragraph/ParaPropertyPanel.src index fa6009f1fe33..601ac7c933cd 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.src +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.src @@ -47,6 +47,43 @@ }; \ IdCount = { 2 ; }; +Image IMG_BACK_COLOR +{ + ImageBitmap = Bitmap{File = "symphony/sc_backgroundcolor.bmp";}; +}; +Image IMG_BACK_COLOR_H +{ + ImageBitmap = Bitmap{File = "symphony/sch_backgroundcolor.bmp";}; +}; +Image IMG_SPACE1 +{ + ImageBitmap = Bitmap{File = "symphony/spacing1.png";}; +}; +Image IMG_SPACE2 +{ + ImageBitmap = Bitmap{File = "symphony/spacing2.png";}; +}; +Image IMG_SPACE3 +{ + ImageBitmap = Bitmap{File = "symphony/spacing3.png";}; +}; +Image IMG_INDENT1 +{ + ImageBitmap = Bitmap{File = "symphony/Indent2.png";}; +}; +Image IMG_INDENT2 +{ + ImageBitmap = Bitmap{File = "symphony/Indent3.png";}; +}; +Image IMG_INDENT3 +{ + ImageBitmap = Bitmap{File = "symphony/Indent4.png";}; +}; +Image IMG_INDENT_HANG +{ + ImageBitmap = Bitmap{File = "symphony/Indent_Hanging.png";}; +}; + Control RID_SIDEBAR_PARA_PANEL { OutputSize = TRUE; @@ -56,163 +93,6 @@ Control RID_SIDEBAR_PARA_PANEL HelpID = HID_PROPERTYPANEL_PARA_SECTION ; Text = "Paragraph"; - ToolBox TBX_HORIZONTALALIGNMENT - { - Pos = MAP_APPFONT ( TBX_HORI_ALIGN_X , TBX_HORI_ALIGN_Y ); - Size = MAP_APPFONT ( ALIGNMENT_TBX_WIDTH*4 ,ALIGNMENT_TBX_HEIGHT); - SVLook = TRUE ; - Border = FALSE ; - HelpID = HID_PPROPERTYPANEL_PARA_TBX_HALIGN; - Text = "Horizontal Alignment"; - ItemList = - { - ToolBoxItem - { - Identifier = BT_SUBSTLEFT ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_LEFT; - Text [ en-US ] = "Align Left" ; - }; - ToolBoxItem - { - Identifier = BT_SUBSTCENTER ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_CENTER; - Text [ en-US ] = "Align Center" ; - }; - ToolBoxItem - { - Identifier = BT_SUBSTRIGHT ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_RIGHT; - Text [ en-US ] = "Align Right" ; - }; - ToolBoxItem - { - Identifier = BT_SUBSTJUSTIFY ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_HALIGN_JUSTIFY; - Text [ en-US ] = "Align Justified" ; - }; - }; - }; - ToolBox TBX_VERT_ALIGN - { - HelpID = HID_PPROPERTYPANEL_PARA_TBX_VALIGN; - SVLook = TRUE ; - Border = FALSE ; - Pos = MAP_APPFONT ( TBX_VERT_ALIGN_X, TBX_VERT_ALIGN_Y ) ; - Size = MAP_APPFONT ( TOOLBOX_ITEM_WIDTH * 3 , TOOLBOX_ITEM_HEIGHT) ; - TabStop = TRUE ; - Text = "Vertical Alignment"; - ItemList = - { - ToolBoxItem - { - Identifier = IID_VERT_TOP ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_TOP; - Text [ en-US ] = "Align Top" ; - }; - - ToolBoxItem - { - Identifier = IID_VERT_CENTER ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_CENTER; - Text [ en-US ] = "Align Center Vertically" ; - }; - - ToolBoxItem - { - Identifier = IID_VERT_BOTTOM ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_VALIGN_BOT; - Text [ en-US ] = "Align Bottom" ; - }; - }; - }; - - ToolBox TBX_NUM_BULLET - { - HelpID = HID_PPROPERTYPANEL_PARA_TBX_NUM_BULLET; - Border = FALSE ; - Pos = MAP_APPFONT ( TBX_NUM_BULLET_X , TBX_NUM_BULLET_Y ) ; - Size = MAP_APPFONT ( TOOLBOX_ITEM_DD_WIDTH * 2 , TOOLBOX_ITEM_HEIGHT) ; - TabStop = TRUE ; - Text = "Bullets and Numbering"; - ItemList = - { - ToolBoxItem - { - Identifier = IID_BULLET ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_BULLET ; - Text [ en-US ] = "Bullets" ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = IID_NUMBER ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_NUM ; - Text [ en-US ] = "Numbering" ; - DropDown = TRUE ; - }; - }; - }; - ToolBox TBX_BACK_COLOR - { - SVLook = TRUE ; - Pos = MAP_APPFONT (TBX_BACK_COLOR_X, TBX_BACK_COLOR_Y) ; - Size = MAP_APPFONT (TOOLBOX_WIDTH,TOOLBOX_HEIGHT ) ; - TabStop = TRUE ; - HelpID = HID_PPROPERTYPANEL_PARA_TBX_BACK_COLOR; - Text = "Paragraph Background Color" ; - ItemList = - { - ToolBoxItem - { - Identifier = TBI_BACK_COLOR ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_BACK_COLOR; - DropDown = TRUE ; - Text [ en-US ] = "Paragraph Background Color" ; - }; - }; - }; - FixedText FT_SPACING - { - Pos = MAP_APPFONT ( FT_PARA_SPACE_X, FT_PARA_SPACE_Y ); - Size = MAP_APPFONT ( FT_PARA_INDENT_X - 7 - FT_PARA_SPACE_X, _FIXED_TEXT_HEIGHT) ; - Text [ en-US ] = "~Spacing:"; - }; - ToolBox TBX_UL_INC_DEC - { - Pos = MAP_APPFONT ( TBX_PARA_SPACE_INC_DEC_X,TBX_PARA_SPACE_INC_DEC_Y ); - Size = MAP_APPFONT (ALIGNMENT_TBX_WIDTH*2,ALIGNMENT_TBX_HEIGHT); - SVLook = TRUE ; - Border = FALSE ; - HelpID = HID_PPROPERTYPANEL_PARA_TBX_INC_DEC ; - Text = "Spacing"; - ItemList = - { - ToolBoxItem - { - Identifier = BT_TBX_UL_INC ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_INC ; - Text [ en-US ] = "Increase Spacing" ; - - /** The next line should be - Command = ".uno:ParaspaceIncrease"; - The hack is necessary because the ParaspaceIncrease command is only - defined for Draw/Impress. It has to be defined in - GenericCommancs.xcu to be recognized. See issue 122446 for more details. - */ - Command = "private:graphicrepository/cmd/sc_paraspaceincrease.png"; - }; - ToolBoxItem - { - Identifier = BT_TBX_UL_DEC ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_DEC ; - Text [ en-US ] = "Decrease Spacing" ; - /** See above or issue 122446 why the following line is not - Command = ".uno:ParaspaceDecrease"; - */ - Command = "private:graphicrepository/cmd/sc_paraspacedecrease.png"; - }; - }; - }; MetricField MF_ABOVE_PARASPACING { HelpID = HID_POPUP_PS_ED_SBINDE_TOPDIST ; @@ -243,12 +123,6 @@ Control RID_SIDEBAR_PARA_PANEL Last = 999; SpinSize = 1; }; - FixedText FT_INDENT - { - Pos = MAP_APPFONT ( FT_PARA_INDENT_X, FT_PARA_INDENT_Y ); - Size = MAP_APPFONT ( _FIXED_TEXT_WIDTH + 50, _FIXED_TEXT_HEIGHT) ; - Text [ en-US ] = "~Indent:"; - }; ToolBox TBX_INDENT_INC_DEC { Pos = MAP_APPFONT ( TBX_PARA_INDENT_INC_DEC_X, TBX_PARA_INDENT_INC_DEC_Y ); @@ -364,54 +238,6 @@ Control RID_SIDEBAR_PARA_PANEL Last = 9999 ; SpinSize = 2 ; }; - ToolBox TBX_LINESP - { - Pos = MAP_APPFONT ( TBX_LINE_SPACE_X, TBX_LINE_SPACE_Y); - SVLook = TRUE ; - Border = FALSE ; - Size = MAP_APPFONT (TOOLBOX_WIDTH, TOOLBOX_HEIGHT); - HelpID = HID_PPROPERTYPANEL_PARA_TBX_LINESP ; - Text = "Line Spacing" ; - ItemList = - { - ToolBoxItem - { - Identifier = BT_BTX_LINESP ; - HelpID = HID_PPROPERTYPANEL_PARA_TBI_LINESP ; - Text [ en-US ] = "Line Spacing" ; - ItemBitmap = Bitmap - { - File = "symphony/lpsmall-spacing-1.png" ; - }; - DropDown = TRUE; - }; - }; - }; - FixedImage FI_INDENT1 - { - Pos = MAP_APPFONT( IMG_SPACE_X, IMG_SPACE1_Y ); - Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE ); - }; - FixedImage FI_INDENT2 - { - Pos = MAP_APPFONT( IMG_SPACE_X, IMG_SPACE2_Y ); - Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE ); - }; - FixedImage FI_INDENT3 - { - Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT1_Y ); - Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE ); - }; - FixedImage FI_SPACE1 - { - Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT2_Y ); - Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE ); - }; - FixedImage FI_SPACE2 - { - Pos = MAP_APPFONT( IMG_INDENT_X, IMG_INDENT3_Y ); - Size = MAP_APPFONT( IMAGE_SIZE, IMAGE_SIZE ); - }; ImageList IL_NUM_BULLET { @@ -426,43 +252,6 @@ Control RID_SIDEBAR_PARA_PANEL MaskColor = STD_MASKCOLOR ; SVX_PROPERTYPANEL_PARA_NUMBULLET_IDLIST_RTL }; - //end - Image IMG_BACK_COLOR - { - ImageBitmap = Bitmap{File = "symphony/sc_backgroundcolor.bmp";}; - }; - Image IMG_BACK_COLOR_H - { - ImageBitmap = Bitmap{File = "symphony/sch_backgroundcolor.bmp";}; - }; - Image IMG_SPACE1 - { - ImageBitmap = Bitmap{File = "symphony/spacing1.png";}; - }; - Image IMG_SPACE2 - { - ImageBitmap = Bitmap{File = "symphony/spacing2.png";}; - }; - Image IMG_SPACE3 - { - ImageBitmap = Bitmap{File = "symphony/spacing3.png";}; - }; - Image IMG_INDENT1 - { - ImageBitmap = Bitmap{File = "symphony/Indent2.png";}; - }; - Image IMG_INDENT2 - { - ImageBitmap = Bitmap{File = "symphony/Indent3.png";}; - }; - Image IMG_INDENT3 - { - ImageBitmap = Bitmap{File = "symphony/Indent4.png";}; - }; - Image IMG_INDENT_HANG - { - ImageBitmap = Bitmap{File = "symphony/Indent_Hanging.png";}; - }; }; //===========================================Back color page============================== @@ -575,6 +364,48 @@ Control RID_POPUPPANEL_PARAPAGE_NUMBERING }; //===========================================Line Space popup page============================== + +Image IMG_SPACING1 +{ + ImageBitmap = Bitmap{File = "symphony/lpspacing-1.png";}; +}; +Image IMG_SPACING115 +{ + ImageBitmap = Bitmap{File = "symphony/lpspacing-1_15.png";}; +}; +Image IMG_SPACING15 +{ + ImageBitmap = Bitmap{File = "symphony/lpspacing-1_5.png";}; +}; +Image IMG_SPACING2 +{ + ImageBitmap = Bitmap{File = "symphony/lpspacing-2.png";}; +}; +Image IMG_SEL_SPACING1 +{ + ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1.png";}; +}; +Image IMG_SEL_SPACING115 +{ + ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_15.png";}; +}; +Image IMG_SEL_SPACING15 +{ + ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_5.png";}; +}; +Image IMG_SEL_SPACING2 +{ + ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-2.png";}; +}; +Image IMG_CUSTOM +{ + ImageBitmap = Bitmap{File = "symphony/last_custom_common.png";}; +}; +Image IMG_CUSTOM_GRAY +{ + ImageBitmap = Bitmap{File = "symphony/last_custom_common_grey.png";}; +}; + Control RID_POPUPPANEL_PARAPAGE_LINESPACING { OutputSize = TRUE; @@ -665,46 +496,7 @@ Control RID_POPUPPANEL_PARAPAGE_LINESPACING Last = 9999; SpinSize = 2; }; - Image IMG_SPACING1 - { - ImageBitmap = Bitmap{File = "symphony/lpspacing-1.png";}; - }; - Image IMG_SPACING115 - { - ImageBitmap = Bitmap{File = "symphony/lpspacing-1_15.png";}; - }; - Image IMG_SPACING15 - { - ImageBitmap = Bitmap{File = "symphony/lpspacing-1_5.png";}; - }; - Image IMG_SPACING2 - { - ImageBitmap = Bitmap{File = "symphony/lpspacing-2.png";}; - }; - Image IMG_SEL_SPACING1 - { - ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1.png";}; - }; - Image IMG_SEL_SPACING115 - { - ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_15.png";}; - }; - Image IMG_SEL_SPACING15 - { - ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-1_5.png";}; - }; - Image IMG_SEL_SPACING2 - { - ImageBitmap = Bitmap{File = "symphony/lpselected-spacing-2.png";}; - }; - Image IMG_CUSTOM - { - ImageBitmap = Bitmap{File = "symphony/last_custom_common.png";}; - }; - Image IMG_CUSTOM_GRAY - { - ImageBitmap = Bitmap{File = "symphony/last_custom_common_grey.png";}; - }; + String STR_LS_SINGLE { Text [ en-US ] = "Line spacing: Single"; @@ -749,7 +541,6 @@ Control RID_POPUPPANEL_PARAPAGE_LINESPACING { Text [ en-US ] = "Last Custom Value"; }; - }; String RID_SVXSTR_NUMBULLET_NONE diff --git a/svx/uiconfig/ui/sidebarparagraph.ui b/svx/uiconfig/ui/sidebarparagraph.ui new file mode 100644 index 000000000000..b5b4a8f36f67 --- /dev/null +++ b/svx/uiconfig/ui/sidebarparagraph.ui @@ -0,0 +1,552 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkGrid" id="ParaPropertyPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_homogeneous">True</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkBox" id="box3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Paragraph</property> + <property name="spacing">12</property> + <child> + <object class="GtkToolbar" id="horizontalalignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Horizontal Alignment</property> + <property name="margin_right">31</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkToolButton" id="leftpara"> + <property name="width_request">25</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Left</property> + <property name="valign">start</property> + <property name="action_name">.uno:LeftPara</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="centerpara"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Center</property> + <property name="action_name">.uno:CenterPara</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="rightpara"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Right</property> + <property name="action_name">.uno:RightPara</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="substjustify"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Justified</property> + <property name="action_name">.uno:JustifyPara</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="verticalalignment"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Vertical Alignment</property> + <property name="margin_left">50</property> + <property name="hexpand">True</property> + <child> + <object class="GtkToolButton" id="cellverttop"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Top</property> + <property name="action_name">.uno:CellVertTop</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="cellvertcenter"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Center Vertically</property> + <property name="action_name">.uno:CellVertCenter</property> + <property name="label" translatable="yes">toolbutton2</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="cellvertbottom"> + <property name="width_request">25</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Align Bottom</property> + <property name="action_name">.uno:CellVertBottom</property> + <property name="label" translatable="yes">toolbutton3</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">4</property> + <property name="spacing">9</property> + <child> + <object class="GtkToolbar" id="numberbullet"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Bullets and Numbering</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkMenuToolButton" id="bullet"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Bullets</property> + <property name="is_important">True</property> + <property name="action_name">.uno:DefaultBullet</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="number"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Numbering</property> + <property name="halign">start</property> + <property name="margin_right">107</property> + <property name="is_important">True</property> + <property name="action_name">.uno:DefaultNumbering</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="backgroundcolor"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Paragraph Background Color</property> + <property name="margin_left">2</property> + <child> + <object class="GtkMenuToolButton" id="parabkcolor"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Paragraph Background Color</property> + <property name="halign">start</property> + <property name="valign">start</property> + <property name="margin_left">35</property> + <property name="action_name">.uno:ParaBackColor</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkBox" id="labels"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="spacinglabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Spacing:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="indentlabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="xalign">0.50999999046325684</property> + <property name="label" translatable="yes">_Indent:</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkToolbar" id="paraspacing"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Spacing</property> + <property name="margin_right">74</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkToolButton" id="paraspaceinc"> + <property name="width_request">25</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Increase Spacing</property> + <property name="action_name">.uno:ParaspaceIncrease</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="paraspacedec"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Decrease Spacing</property> + <property name="action_name">.uno:ParaSpaceDecrease</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="indent"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Indent</property> + <property name="margin_left">63</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkToolButton" id="increaseindent1"> + <property name="width_request">15</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Increase Indent</property> + <property name="action_name">.uno:IncrementIndent</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="decreaseindent1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Decrease Indent</property> + <property name="action_name">.uno:DecrementIndent</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="hangingindent1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="has_tooltip">True</property> + <property name="tooltip_text" translatable="yes">Switch to Hanging Indent</property> + <property name="action_name">.uno:HangingIndent</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="hangingindent2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Switch to Hanging Indent</property> + <property name="action_name">.uno:HangingIndent2</property> + <property name="label" translatable="yes">toolbutton3</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_bottom">5</property> + <child> + <object class="svxlo-SvxRelativeField" id="aboveparaspacing"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Above Paragraph Spacing</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="svxlo-SvxRelativeField" id="belowparaspacing"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">Below Paragraph Spacing</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="svxlo-SvxRelativeField" id="beforetextindent"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">75</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="svxlo-SvxRelativeField" id="aftertextindent"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">75</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="svxlo-SvxRelativeField" id="firstlineindent"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="margin_left">75</property> + <property name="hexpand">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="linespacing"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Line Spacing</property> + <property name="hexpand">True</property> + <child> + <object class="GtkMenuToolButton" id="setlinespacing"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Line Spacing</property> + <property name="action_name">.uno:LineSpacing</property> + <property name="label" translatable="yes">toolbutton1</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> +</interface> |