include/svx/ruler.hxx | 2 ++ svx/source/dialog/svxruler.cxx | 14 ++++++++++++++ sw/source/uibase/shells/textsh1.cxx | 5 +++-- 3 files changed, 19 insertions(+), 2 deletions(-)
New commits: commit ea63519d88fa111001fd2043e786b54d2f285de1 Author: Tor Lillqvist <[email protected]> AuthorDate: Tue Feb 4 15:38:46 2020 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Feb 5 14:03:34 2020 +0100 tdf#128468: Add SvxRuler::MoveTabstop() and use it Change-Id: If223bde1ae5161da821530d36e50a971c62f6944 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87977 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Tor Lillqvist <[email protected]> diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx index f456d6a7ec2f..11909eb6e602 100644 --- a/include/svx/ruler.hxx +++ b/include/svx/ruler.hxx @@ -279,6 +279,8 @@ public: void SetTabsRelativeToIndent( bool bRel ); void SetValues(RulerChangeType type, long value); long GetPageWidth() const; + + void MoveTabstop(int nTabstop, int nAmount); }; #endif diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 8fa6a67df992..ff3b7b6bbca7 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1732,6 +1732,20 @@ void SvxRuler::UpdateParaContents_Impl( SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP); } +void SvxRuler::MoveTabstop(int nTabstop, int nAmount) +{ + SAL_INFO("svx", "MoveTabstop(" << nTabstop << "," << nAmount << ")"); + + if (nTabstop < 0 || nTabstop >= mxTabStopItem->Count()) + return; + + SvxTabStop aTabstop = mxTabStopItem->At(nTabstop); + mxTabStopItem->Remove(nTabstop); + aTabstop.GetTabPos() += nAmount; + mxTabStopItem->Insert(aTabstop); + pBindings->GetDispatcher()->ExecuteList(SID_ATTR_TABSTOP, SfxCallMode::RECORD, { mxTabStopItem.get() }); +} + void SvxRuler::DragBorders() { /* Dragging of Borders (Tables and other columns) */ diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 2ce3d6c7bbb8..b3fc13963a99 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1571,8 +1571,9 @@ void SwTextShell::Execute(SfxRequest &rReq) const SfxInt32Item* pAmount = rReq.GetArg<SfxInt32Item>(FN_PARAM_2); if (!pIndex || !pAmount) break; - SAL_INFO("sw.ui", "MoveTabstop(" << pIndex->GetValue() << "," << pAmount->GetValue() << ")"); - // To be implemented + auto &rRuler = GetView().GetHRuler(); + rRuler.MoveTabstop(pIndex->GetValue(), pAmount->GetValue()); + rRuler.ForceUpdate(); } break; default: _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
