diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2019-03-27 18:40:37 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-03-28 09:50:45 +0100 |
commit | 6f41502b82fa108246b7547d9da3c6bf6b42f72f (patch) | |
tree | 876507e2a5b0bf52e2864025add61fb560df25b5 /sd/source/ui | |
parent | 4fda02a8310dbb42b504f379e3f2f594391b16cb (diff) |
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 <vmiklos@collabora.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/func/fudraw.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuoltext.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuparagr.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 53 |
6 files changed, 63 insertions, 0 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 272c0ceee90d..142188e5414c 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -970,6 +970,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 3d5cdaae3ea3..c43afe218495 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -123,6 +123,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 fc55682275e9..b4430486834d 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -434,6 +434,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 898643cb79e3..2cdd86ad58a2 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -130,6 +130,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: { |