include/svx/svxids.hrc | 4 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu | 16 -- officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 16 ++ sc/sdi/drtxtob.sdi | 2 sc/source/ui/drawfunc/drtxtob.cxx | 38 ++++ sd/inc/app.hrc | 3 sd/sdi/sdraw.sdi | 52 ------ svx/sdi/svx.sdi | 47 ++++++ svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 77 ---------- svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 2 svx/uiconfig/ui/sidebarparagraph.ui | 8 - sw/sdi/_annotsh.sdi | 11 + sw/sdi/_viewsh.sdi | 12 + sw/sdi/drwtxtsh.sdi | 12 + sw/source/uibase/shells/annotsh.cxx | 46 +++++ sw/source/uibase/shells/drwtxtex.cxx | 43 +++++ sw/source/uibase/uiview/viewtab.cxx | 55 ++++++- sw/uiconfig/swriter/toolbar/textobjectbar.xml | 3 18 files changed, 278 insertions(+), 169 deletions(-)
New commits: commit e91104ee1654b104a0a9a75c3e0147549f3a3325 Author: Maxim Monastirsky <[email protected]> Date: Sun Dec 7 01:38:02 2014 +0200 Revert "fdo#81475 Writer doesn't have ParaspaceIncrease/Decrease commands" Now that we have these commands in place. This reverts commit 503379fa0b06b66ab6f2bbedc73cdcb056545330. diff --git a/sw/uiconfig/swriter/toolbar/textobjectbar.xml b/sw/uiconfig/swriter/toolbar/textobjectbar.xml index 7f4f048..77bc1ef 100644 --- a/sw/uiconfig/swriter/toolbar/textobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/textobjectbar.xml @@ -53,6 +53,9 @@ <toolbar:toolbaritem xlink:href=".uno:SpacePara15" toolbar:visible="false"/> <toolbar:toolbaritem xlink:href=".uno:SpacePara2" toolbar:visible="false"/> <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:ParaspaceIncrease" toolbar:helpid="27346" toolbar:visible="false"/> + <toolbar:toolbaritem xlink:href=".uno:ParaspaceDecrease" toolbar:helpid="27347" toolbar:visible="false"/> + <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:DefaultBullet"/> <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering"/> <toolbar:toolbaritem xlink:href=".uno:IncrementIndent"/> commit 74ef8a4148f7d8fdf0d40481f879cdd13b27aafb Author: Maxim Monastirsky <[email protected]> Date: Sun Dec 7 01:18:06 2014 +0200 Introduce ParaspaceIncrease/Decrease commands in Writer and Calc Change-Id: Ia8933697fd7bd827bb69c0976f13112eb2131888 diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 23a9df5..beaf54f 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -1002,9 +1002,11 @@ //UUUU #define SID_OFFER_IMPORT ( SID_SVX_START + 1143 ) #define SID_DRAWINGLAYER_FILLSTYLES ( SID_SVX_START + 1144) +#define SID_PARASPACE_INCREASE ( SID_SVX_START + 1145 ) +#define SID_PARASPACE_DECREASE ( SID_SVX_START + 1146 ) // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE (SID_DRAWINGLAYER_FILLSTYLES + 1) +#define SID_SVX_FIRSTFREE (SID_PARASPACE_DECREASE + 1) // Overflow check for slot IDs diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi index 903f6ee..9a77b17 100644 --- a/sc/sdi/drtxtob.sdi +++ b/sc/sdi/drtxtob.sdi @@ -92,6 +92,8 @@ interface TableDrawText SID_ATTR_PARA_LINESPACE_10 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_PARA_LINESPACE_15 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_PARA_LINESPACE_20 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] + SID_PARASPACE_INCREASE [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] + SID_PARASPACE_DECREASE [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_SET_SUPER_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_SET_SUB_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_CHAR_KERNING [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 06f5d7b..4f7637b 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -761,6 +761,31 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) } break; + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: + { + SvxULSpaceItem aULSpace( + static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) ); + sal_uInt16 nUpper = aULSpace.GetUpper(); + sal_uInt16 nLower = aULSpace.GetLower(); + + if ( nSlot == SID_PARASPACE_INCREASE ) + { + nUpper += 100; + nLower += 100; + } + else + { + nUpper = std::max< sal_Int16 >( nUpper - 100, 0 ); + nLower = std::max< sal_Int16 >( nLower - 100, 0 ); + } + + aULSpace.SetUpper( nUpper ); + aULSpace.SetLower( nLower ); + aNewAttr.Put( aULSpace ); + } + break; + default: bSet = false; } @@ -1023,9 +1048,20 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) aULSP.SetWhich(SID_ATTR_PARA_ULSPACE); rDestSet.Put(aULSP); Invalidate(SID_ATTR_PARA_ULSPACE); + Invalidate(SID_PARASPACE_INCREASE); + Invalidate(SID_PARASPACE_DECREASE); eState = aAttrSet.GetItemState( EE_PARA_ULSPACE ); - if ( eState == SfxItemState::DONTCARE ) + if( eState >= SfxItemState::DEFAULT ) + { + if ( !aULSP.GetUpper() && !aULSP.GetLower() ) + rDestSet.DisableItem( SID_PARASPACE_DECREASE ); + } + else + { + rDestSet.DisableItem( SID_PARASPACE_INCREASE ); + rDestSet.DisableItem( SID_PARASPACE_DECREASE ); rDestSet.InvalidateItem(SID_ATTR_PARA_ULSPACE); + } // Zeilenabstand diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc index 2130577..a39734f 100644 --- a/sd/inc/app.hrc +++ b/sd/inc/app.hrc @@ -360,8 +360,7 @@ #define SID_EXPAND_PAGE (SID_SD_START+343) #define SID_SUMMARY_PAGE (SID_SD_START+344) #define SID_LEAVE_ALL_GROUPS (SID_SD_START+345) -#define SID_PARASPACE_INCREASE (SID_SD_START+346) -#define SID_PARASPACE_DECREASE (SID_SD_START+347) +// free #define SID_SLIDE_MASTERPAGE (SID_SD_START+348) #define SID_HANDOUT_MASTERPAGE (SID_SD_START+349) #define SID_NOTES_MASTERPAGE (SID_SD_START+350) diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index a397d02..1de1319 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -4897,58 +4897,6 @@ SfxStringItem PageStatus SID_STATUS_PAGE GroupId = GID_VIEW; ] -SfxBoolItem 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; - - Readonly = FALSE, - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_FORMAT; -] - -SfxBoolItem 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; - - Readonly = FALSE, - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_FORMAT; -] - SfxBoolItem PickThrough SID_PICK_THROUGH [ diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 565ee34..c312f1f 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 e6949e4..9d10e21 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 8d47825..c61c1c8 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 b50ab98..df0acc3 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> diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi index 15f03ad..232388c 100644 --- a/sw/sdi/_annotsh.sdi +++ b/sw/sdi/_annotsh.sdi @@ -198,6 +198,17 @@ interface _Annotation StateMethod = GetState ; ] + SID_PARASPACE_INCREASE + [ + ExecMethod = Exec; + StateMethod = GetState; + ] + SID_PARASPACE_DECREASE + [ + ExecMethod = Exec; + StateMethod = GetState; + ] + FN_INSERT_STRING [ ExecMethod = Exec ; diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 357894c..5e35f90 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -427,6 +427,18 @@ interface BaseTextEditView StateMethod = StateTabWin ; ] + SID_PARASPACE_INCREASE + [ + ExecMethod = ExecTabWin; + StateMethod = StateTabWin; + ] + + SID_PARASPACE_DECREASE + [ + ExecMethod = ExecTabWin; + StateMethod = StateTabWin; + ] + SID_ATTR_PAGE_COLUMN [ ExecMethod = ExecTabWin ; diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi index 20bba4f..53ed911 100644 --- a/sw/sdi/drwtxtsh.sdi +++ b/sw/sdi/drwtxtsh.sdi @@ -211,6 +211,18 @@ interface TextDrawText StateMethod = GetState ; ] + SID_PARASPACE_INCREASE + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + + SID_PARASPACE_DECREASE + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + SID_ATTR_PARA_LINESPACE // api: [ ExecMethod = Execute ; diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 250b73b..b41a607 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -193,6 +193,31 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) sal_uInt16 nEEWhich = 0; switch (nSlot) { + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: + { + SvxULSpaceItem aULSpace( + static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) ); + sal_uInt16 nUpper = aULSpace.GetUpper(); + sal_uInt16 nLower = aULSpace.GetLower(); + + if ( nSlot == SID_PARASPACE_INCREASE ) + { + nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 ); + nLower = std::min< sal_uInt16 >( nLower + 57, 5670 ); + } + else + { + nUpper = std::max< sal_Int16 >( nUpper - 57, 0 ); + nLower = std::max< sal_Int16 >( nLower - 57, 0 ); + } + + aULSpace.SetUpper( nUpper ); + aULSpace.SetLower( nLower ); + aNewAttr.Put( aULSpace ); + rReq.Done(); + } + break; case SID_ATTR_PARA_LRSPACE: { SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(rReq. @@ -659,18 +684,31 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) } break; case SID_ATTR_PARA_ULSPACE: + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: { SfxItemState eState = aEditAttr.GetItemState( EE_PARA_ULSPACE ); if( eState >= SfxItemState::DEFAULT ) { SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) ); - aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); - rSet.Put(aULSpace); + if ( !aULSpace.GetUpper() && !aULSpace.GetLower() ) + rSet.DisableItem( SID_PARASPACE_DECREASE ); + else if ( aULSpace.GetUpper() >= 5670 && aULSpace.GetLower() >= 5670 ) + rSet.DisableItem( SID_PARASPACE_INCREASE ); + if ( nSlotId == SID_ATTR_PARA_ULSPACE ) + { + aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); + rSet.Put(aULSpace); + } } else - rSet.InvalidateItem(nSlotId); + { + rSet.DisableItem( SID_PARASPACE_INCREASE ); + rSet.DisableItem( SID_PARASPACE_DECREASE ); + rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE ); + } } - break; + break; case SID_ATTR_CHAR_FONT: case SID_ATTR_CHAR_FONTHEIGHT: case SID_ATTR_CHAR_WEIGHT: diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 1104ea6..eb1b039 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -242,7 +242,31 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) rReq.Done(); } break; + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: + { + SvxULSpaceItem aULSpace( + static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) ); + sal_uInt16 nUpper = aULSpace.GetUpper(); + sal_uInt16 nLower = aULSpace.GetLower(); + + if ( nSlot == SID_PARASPACE_INCREASE ) + { + nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 ); + nLower = std::min< sal_uInt16 >( nLower + 57, 5670 ); + } + else + { + nUpper = std::max< sal_Int16 >( nUpper - 57, 0 ); + nLower = std::max< sal_Int16 >( nLower - 57, 0 ); + } + aULSpace.SetUpper( nUpper ); + aULSpace.SetLower( nLower ); + aNewAttr.Put( aULSpace ); + rReq.Done(); + } + break; case SID_ATTR_PARA_LINESPACE_10: { SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL); @@ -695,16 +719,29 @@ ASK_ADJUST: } break; case SID_ATTR_PARA_ULSPACE: + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: { SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE); if( eState >= SfxItemState::DEFAULT ) { SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) ); - aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); - rSet.Put(aULSpace); + if ( !aULSpace.GetUpper() && !aULSpace.GetLower() ) + rSet.DisableItem( SID_PARASPACE_DECREASE ); + else if ( aULSpace.GetUpper() >= 5670 && aULSpace.GetLower() >= 5670 ) + rSet.DisableItem( SID_PARASPACE_INCREASE ); + if ( nSlotId == SID_ATTR_PARA_ULSPACE ) + { + aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); + rSet.Put(aULSpace); + } } else - rSet.InvalidateItem(nSlotId); + { + rSet.DisableItem( SID_PARASPACE_INCREASE ); + rSet.DisableItem( SID_PARASPACE_DECREASE ); + rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE ); + } nSlotId = 0; } break; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index d34fd73..e8d99b1 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -751,7 +751,40 @@ void SwView::ExecTabWin( SfxRequest& rReq ) rSh.SetAttrItem( aParaMargin ); } break; + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: + { + SfxItemSet aULSpaceSet( GetPool(), RES_UL_SPACE, RES_UL_SPACE ); + rSh.GetCurAttr( aULSpaceSet ); + SvxULSpaceItem aULSpace( + static_cast< const SvxULSpaceItem& >( aULSpaceSet.Get( RES_UL_SPACE ) ) ); + sal_uInt16 nUpper = aULSpace.GetUpper(); + sal_uInt16 nLower = aULSpace.GetLower(); + + if ( nSlot == SID_PARASPACE_INCREASE ) + { + nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 ); + nLower = std::min< sal_uInt16 >( nLower + 57, 5670 ); + } + else + { + nUpper = std::max< sal_Int16 >( nUpper - 57, 0 ); + nLower = std::max< sal_Int16 >( nLower - 57, 0 ); + } + aULSpace.SetUpper( nUpper ); + aULSpace.SetLower( nLower ); + + SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); + if( pColl && pColl->IsAutoUpdateFmt() ) + { + aULSpaceSet.Put( aULSpace ); + rSh.AutoUpdatePara( pColl, aULSpaceSet ); + } + else + rSh.SetAttrItem( aULSpace ); + } + break; case SID_RULER_BORDERS_VERTICAL: case SID_RULER_BORDERS: if ( pReqArgs ) @@ -1253,15 +1286,29 @@ void SwView::StateTabWin(SfxItemSet& rSet) } case SID_ATTR_PARA_ULSPACE: + case SID_PARASPACE_INCREASE: + case SID_PARASPACE_DECREASE: { SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE)); - aUL.SetWhich(nWhich); - SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE); if( e >= SfxItemState::DEFAULT ) - rSet.Put( aUL ); + { + if ( !aUL.GetUpper() && !aUL.GetLower() ) + rSet.DisableItem( SID_PARASPACE_DECREASE ); + else if ( aUL.GetUpper() >= 5670 && aUL.GetLower() >= 5670 ) + rSet.DisableItem( SID_PARASPACE_INCREASE ); + if ( nWhich == SID_ATTR_PARA_ULSPACE ) + { + aUL.SetWhich( SID_ATTR_PARA_ULSPACE ); + rSet.Put( aUL ); + } + } else - rSet.InvalidateItem(nWhich); + { + rSet.DisableItem( SID_PARASPACE_INCREASE ); + rSet.DisableItem( SID_PARASPACE_DECREASE ); + rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE ); + } } break; commit 6521e61c4e0e39ed285188f50e0856e56d86e3e5 Author: Yousuf Philips <[email protected]> Date: Tue Dec 2 13:34:10 2014 +0400 make increase/decrease paragraph spacing uno commands globally accessible Change-Id: I08e6c56598a92afcc21455704e01bda2212d3998 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu index a3fc21d..50f58af 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu @@ -419,22 +419,6 @@ <value>1</value> </prop> </node> - <node oor:name=".uno:ParaspaceIncrease" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Increase Spacing</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> - <node oor:name=".uno:ParaspaceDecrease" oor:op="replace"> - <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Decrease Spacing</value> - </prop> - <prop oor:name="Properties" oor:type="xs:int"> - <value>1</value> - </prop> - </node> <node oor:name=".uno:SlideMasterPage" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">~Slide Master</value> diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index f3877c4..18b359c 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -89,6 +89,22 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:ParaspaceIncrease" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Increase Paragraph Spacing</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ParaspaceDecrease" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Decrease Paragraph Spacing</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:ArrowShapes" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Block Arrows</value> _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
