sd/sdi/drtxtob.sdi | 12 +++++++++ sd/source/ui/func/fudraw.cxx | 2 + sd/source/ui/func/fuoltext.cxx | 2 + sd/source/ui/func/fuparagr.cxx | 2 + sd/source/ui/func/futext.cxx | 2 + sd/source/ui/view/drtxtob.cxx | 2 + sd/source/ui/view/drtxtob1.cxx | 53 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+)
New commits: commit f71fe05e37a96e35537cd212fbc331794707f91d Author: Gülşah Köse <gulsah.k...@collabora.com> AuthorDate: Wed Mar 27 18:40:37 2019 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sun May 10 21:55:31 2020 +0200 Implement sidebar increase/decrease indent buttons on Impress Change-Id: Ie7c115e041a6dee7b5e5d938ad3fbf37cf9bc89b Reviewed-on: https://gerrit.libreoffice.org/69840 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> (cherry picked from commit 6f41502b82fa108246b7547d9da3c6bf6b42f72f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93527 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi index a317ee8eec09..6e29a20899ef 100644 --- a/sd/sdi/drtxtob.sdi +++ b/sd/sdi/drtxtob.sdi @@ -191,6 +191,18 @@ shell TextObjectBar StateMethod = GetAttrState; ] + SID_INC_INDENT + [ + ExecMethod = Execute; + StateMethod = GetAttrState; + ] + + SID_DEC_INDENT + [ + ExecMethod = Execute; + StateMethod = GetAttrState; + ] + SID_ATTR_PARA_LRSPACE [ ExecMethod = Execute ; diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 2ecc44fe0a20..aa2f218231e9 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -968,6 +968,8 @@ bool FuDraw::cancel() bReturn = true; SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings(); + rBindings.Invalidate( SID_DEC_INDENT ); + rBindings.Invalidate( SID_INC_INDENT ); rBindings.Invalidate( SID_PARASPACE_INCREASE ); rBindings.Invalidate( SID_PARASPACE_DECREASE ); } diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx index 5d53b3aa09f5..adfd2b3ef121 100644 --- a/sd/source/ui/func/fuoltext.cxx +++ b/sd/source/ui/func/fuoltext.cxx @@ -72,6 +72,8 @@ static const sal_uInt16 SidArray[] = { SID_SET_SUPER_SCRIPT, SID_SET_SUB_SCRIPT, SID_HYPERLINK_GETLINK, + SID_DEC_INDENT, + SID_INC_INDENT, SID_PARASPACE_INCREASE, SID_PARASPACE_DECREASE, SID_STATUS_PAGE, diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index 703d3cf87558..ad1e66432233 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -141,6 +141,8 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) SID_ATTR_PARA_LINESPACE_20, SID_ATTR_PARA_ULSPACE, SID_ATTR_PARA_LRSPACE, + SID_DEC_INDENT, + SID_INC_INDENT, SID_ATTR_PARA_LEFT_TO_RIGHT, SID_ATTR_PARA_RIGHT_TO_LEFT, SID_RULER_TEXT_RIGHT_TO_LEFT, diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 294d3c6a53e2..6fca64946b08 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -125,6 +125,8 @@ static const sal_uInt16 SidArray[] = { SID_ATTR_TRANSFORM_AUTOWIDTH, // 10310 SID_ATTR_TRANSFORM_AUTOHEIGHT, // 10311 //Added SID_HYPERLINK_GETLINK, // 10361 + SID_DEC_INDENT, // 10461 + SID_INC_INDENT, // 10462 SID_CHARMAP, // 10503 SID_TEXTDIRECTION_LEFT_TO_RIGHT, // 10907 SID_TEXTDIRECTION_TOP_TO_BOTTOM, // 10908 diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index fa0e40d1461f..caa6283d303d 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -435,6 +435,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) rSet.DisableItem( SID_ATTR_PARA_LINESPACE_10 ); rSet.DisableItem( SID_ATTR_PARA_LINESPACE_15 ); rSet.DisableItem( SID_ATTR_PARA_LINESPACE_20 ); + rSet.DisableItem( SID_DEC_INDENT ); + rSet.DisableItem( SID_INC_INDENT ); rSet.DisableItem( SID_PARASPACE_INCREASE ); rSet.DisableItem( SID_PARASPACE_DECREASE ); rSet.DisableItem( SID_TEXTDIRECTION_TOP_TO_BOTTOM ); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 4d3124643d06..b62c32e915b1 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -169,6 +169,59 @@ void TextObjectBar::Execute( SfxRequest &rReq ) } break; + case SID_INC_INDENT: + case SID_DEC_INDENT: + { + if( pOLV ) + { + ESelection aSel = pOLV->GetSelection(); + aSel.Adjust(); + sal_Int32 nStartPara = aSel.nStartPara; + sal_Int32 nEndPara = aSel.nEndPara; + if( !aSel.HasRange() ) + { + nStartPara = 0; + nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1; + } + for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ ) + { + SfxStyleSheet* pStyleSheet = nullptr; + if (pOLV->GetOutliner() != nullptr) + pStyleSheet = pOLV->GetOutliner()->GetStyleSheet(nPara); + if (pStyleSheet != nullptr) + { + SfxItemSet aAttr( pStyleSheet->GetItemSet() ); + SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( nPara ) ); + aAttr.Put( aTmpSet, false ); + const SvxLRSpaceItem& rItem = aAttr.Get( EE_PARA_LRSPACE ); + std::unique_ptr<SvxLRSpaceItem> pNewItem(static_cast<SvxLRSpaceItem*>(rItem.Clone())); + + long nLeft = pNewItem->GetLeft(); + if( nSlot == SID_INC_INDENT ) + nLeft += 1000; + else + { + nLeft -= 1000; + nLeft = std::max<long>( nLeft, 0 ); + } + pNewItem->SetLeftValue( static_cast<sal_uInt16>(nLeft) ); + + SfxItemSet aNewAttrs( aAttr ); + aNewAttrs.Put( *pNewItem ); + pNewItem.reset(); + pOLV->GetOutliner()->SetParaAttribs( nPara, aNewAttrs ); + } + } + } + rReq.Done(); + + Invalidate(); + // to refresh preview (in outline mode), slot has to be invalidated: + mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true ); + + } + break; + case SID_PARASPACE_INCREASE: case SID_PARASPACE_DECREASE: { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits