summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@gmail.com>2020-05-06 12:04:39 +0300
committerAndras Timar <andras.timar@collabora.com>2020-06-19 11:29:51 +0200
commitdb84e4b40e3ad8656738baeaa9e2036c038a8fa3 (patch)
treebeb9958b1171329ed1f4bb7cb569575730d0d2d0 /sw
parent77f7b1ba3ccb8b43abde5ac873723909676b65a7 (diff)
tdf#111535 - Add First-line indent, paragraph indent, and tab spaces/Core part
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> (cherry picked from commit 15adfafee5b48d6f88a0b970c50e5c5bc77a4ab1) Change-Id: Ib340e74646299c344dd770977497f59a030c86f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96611 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/sdi/_viewsh.sdi4
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx27
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index b4c3803e0a0d..50a40e84c9ab 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -635,6 +635,10 @@ interface BaseTextEditView
[
ExecMethod = ExecTabWin;
]
+ SID_PARAGRAPH_CHANGE_STATE // status()
+ [
+ ExecMethod = ExecTabWin;
+ ]
// from here Export = FALSE;
FID_SEARCH_ON // status()
[
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 6a70fb9e6397..f4d85a249846 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -702,7 +702,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.SetTextFirstLineOfst(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>{} );