diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2014-12-07 01:18:06 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2014-12-07 14:48:18 +0200 |
commit | 74ef8a4148f7d8fdf0d40481f879cdd13b27aafb (patch) | |
tree | 04b152a2e75d94854cd06bffa8dea5b8dd8fb806 /svx | |
parent | 6521e61c4e0e39ed285188f50e0856e56d86e3e5 (diff) |
Introduce ParaspaceIncrease/Decrease commands in Writer and Calc
Change-Id: Ia8933697fd7bd827bb69c0976f13112eb2131888
Diffstat (limited to 'svx')
-rw-r--r-- | svx/sdi/svx.sdi | 47 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 77 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 2 | ||||
-rw-r--r-- | svx/uiconfig/ui/sidebarparagraph.ui | 8 |
4 files changed, 48 insertions, 86 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 565ee340d1f2..c312f1f9bf58 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -16167,3 +16167,50 @@ SfxVoidItem FormatCellBorders SID_CELL_FORMAT_BORDER GroupId = GID_FORMAT; ] +SfxVoidItem ParaspaceDecrease SID_PARASPACE_DECREASE +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +SfxVoidItem ParaspaceIncrease SID_PARASPACE_INCREASE +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index e6949e41339a..9d10e21750e6 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -44,16 +44,12 @@ const char UNO_PROMOTE[] = ".uno:Promote"; const char UNO_DEMOTE[] = ".uno:Demote"; const char UNO_HANGINGINDENT2[] = ".uno:HangingIndent2"; -const char UNO_PARASPACEINC[] = ".uno:ParaspaceIncrease"; -const char UNO_PARASPACEDEC[] = ".uno:ParaspaceDecrease"; - namespace svx {namespace sidebar { #define DEFAULT_VALUE 0 #define MAX_DURCH 5670 #define INDENT_STEP 706 -#define UL_STEP 58 #define MAX_SW 1709400 #define MAX_SC_SD 116220200 @@ -246,24 +242,6 @@ void ParaPropertyPanel::InitToolBoxSpacing() mpTopDist->SetAccessibleName(mpTopDist->GetQuickHelpText()); mpBottomDist->SetAccessibleName(mpBottomDist->GetQuickHelpText()); - - // Use a form of image loading that can handle both .uno:<command> - // and private:graphirepository... syntax. This is necessary to - // 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( - nIdParaSpaceInc, - sfx2::sidebar::Tools::GetImage("private:graphicrepository/cmd/sc_paraspaceincrease.png" /* i#122446 */, mxFrame)); - mpTbxUL_IncDec->SetItemImage( - nIdParaSpaceDec, - sfx2::sidebar::Tools::GetImage("private:graphicrepository/cmd/sc_paraspacedecrease.png" /* i#122446 */, mxFrame)); - - aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl ); - mpTbxUL_IncDec->SetSelectHdl(aLink); m_eULSpaceUnit = maULSpaceControl.GetCoreMetric(); } @@ -405,57 +383,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl) return 0L; } -IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl) -{ - const OUString aCommand(pControl->GetItemCommand(pControl->GetCurItemId())); - - if( aCommand == UNO_PARASPACEINC) - { - SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); - - maUpper += UL_STEP; - sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); - aMargin.SetUpper( (const sal_uInt16)nVal ); - - maLower += UL_STEP; - nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); - aMargin.SetLower( (const sal_uInt16)nVal ); - - GetBindings()->GetDispatcher()->Execute( - SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, &aMargin, 0L); - } - else if( aCommand == UNO_PARASPACEDEC) - { - SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE ); - if( maUpper >= UL_STEP ) - { - maUpper -= UL_STEP; - sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); - aMargin.SetUpper( (const sal_uInt16)nVal ); - } - else - aMargin.SetUpper( DEFAULT_VALUE ); - - if( maLower >= UL_STEP ) - { - maLower -= UL_STEP; - sal_Int64 nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); - nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit ); - aMargin.SetLower( (const sal_uInt16)nVal ); - } - else - aMargin.SetLower( DEFAULT_VALUE ); - - GetBindings()->GetDispatcher()->Execute( - SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, &aMargin, 0L); - } - - return( 0L ); -} - // for Paragraph State change void ParaPropertyPanel::NotifyItemUpdate( sal_uInt16 nSID, @@ -677,19 +604,16 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); nVal = mpBottomDist->Normalize( nVal ); mpBottomDist->SetValue( nVal, FUNIT_100TH_MM ); - mpTbxUL_IncDec->Enable(); } else if(eState == SfxItemState::DISABLED ) { mpTopDist->Disable(); mpBottomDist->Disable(); - mpTbxUL_IncDec->Disable(); } else { mpTopDist->SetEmptyFieldValue(); mpBottomDist->SetEmptyFieldValue(); - mpTbxUL_IncDec->Disable(); } } @@ -821,7 +745,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, get(mpTbxIndent_IncDec, "indent"); get(mpTbxProDemote, "promotedemote"); - get(mpTbxUL_IncDec, "paraspacing"); initial(); m_aMetricCtl.RequestUpdate(); diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 8d4782500ac0..c61c1c89be94 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -71,7 +71,6 @@ private: ToolBox* mpTBxNumBullet; ToolBox* mpTBxBackColor; //Paragraph spacing - ToolBox* mpTbxUL_IncDec; SvxRelativeField* mpTopDist; SvxRelativeField* mpBottomDist; ToolBox* mpTbxIndent_IncDec; @@ -120,7 +119,6 @@ private: DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*); DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*); DECL_LINK(ULSpaceHdl_Impl, void*); - DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*); void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); diff --git a/svx/uiconfig/ui/sidebarparagraph.ui b/svx/uiconfig/ui/sidebarparagraph.ui index b50ab98c5e7a..df0acc34561a 100644 --- a/svx/uiconfig/ui/sidebarparagraph.ui +++ b/svx/uiconfig/ui/sidebarparagraph.ui @@ -278,7 +278,7 @@ </packing> </child> <child> - <object class="GtkToolbar" id="paraspacing"> + <object class="sfxlo-SidebarToolBox" id="paraspacing"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="has_tooltip">True</property> @@ -286,12 +286,8 @@ <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 Paragraph Spacing</property> <property name="action_name">.uno:ParaspaceIncrease</property> <property name="use_underline">True</property> </object> @@ -304,8 +300,6 @@ <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 Paragraph Spacing</property> <property name="action_name">.uno:ParaspaceDecrease</property> <property name="use_underline">True</property> </object> |