summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@gmail.com>2020-05-06 12:04:39 +0300
committerTomaž Vajngerl <quikee@gmail.com>2020-05-08 12:37:16 +0200
commit15adfafee5b48d6f88a0b970c50e5c5bc77a4ab1 (patch)
treee258d6f23aeb2902d010f76c5d5045c9b44e5048 /sw/source
parent3eed23154170fcb8d313ff079d61c9701b77eefa (diff)
tdf#111535 - Add First-line indent, paragraph indent, and tab spaces/Core part
Change-Id: Ib340e74646299c344dd770977497f59a030c86f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93165 Tested-by: Jenkins Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 7be532cd29b4..0c2995e0b56d 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -693,7 +693,34 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
}
}
break;
+ case SID_PARAGRAPH_CHANGE_STATE:
+ {
+ const SfxPoolItem *fLineIndent, *pLeftIndent, *pRightIndent;
+ if (pReqArgs)
+ {
+ SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );
+ rSh.GetCurAttr( aLRSpaceSet );
+ SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( RES_LR_SPACE ) );
+ if (pReqArgs->GetItemState(SID_PARAGRAPH_FIRST_LINE_INDENT,true,&fLineIndent) == SfxItemState::SET)
+ {
+ const OUString ratio = static_cast<const SfxStringItem*>(fLineIndent)->GetValue();
+ aParaMargin.SetTextFirstLineOffset(nPageWidth * ratio.toFloat());
+ }
+ else if (pReqArgs->GetItemState(SID_PARAGRAPH_LEFT_INDENT,true,&pLeftIndent) == SfxItemState::SET)
+ {
+ const OUString ratio = static_cast<const SfxStringItem*>(pLeftIndent)->GetValue();
+ aParaMargin.SetLeft(nPageWidth * ratio.toFloat());
+ }
+ else if (pReqArgs->GetItemState(SID_PARAGRAPH_RIGHT_INDENT,true,&pRightIndent) == SfxItemState::SET)
+ {
+ const OUString ratio = static_cast<const SfxStringItem*>(pRightIndent)->GetValue();
+ aParaMargin.SetRight(nPageWidth * ratio.toFloat());
+ }
+ rSh.SetAttrItem(aParaMargin);
+ }
+ break;
+ }
case SID_HANGING_INDENT:
{
SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} );