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 6f7151609db48fcc2d74c7419952a6298c83c2e2
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Tue Feb 4 15:38:46 2020 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Mon May 18 08:47:58 2020 +0200

    tdf#128468: Add SvxRuler::MoveTabstop() and use it
    
    Change-Id: If223bde1ae5161da821530d36e50a971c62f6944
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87977
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94225
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index b27b49ca1b27..8fa3b303b696 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -278,6 +278,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 556d3438587d..d6d12035d1a0 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1671,6 +1671,20 @@ void SvxRuler::UpdateParaContents_Impl(
     SetIndents(INDENT_COUNT, mpIndents.data() + 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 3735ca48af65..c434501cb346 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1582,8 +1582,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
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to