[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/svx svx/sdi sw/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 25 10:55:43 UTC 2020


 include/svx/svxids.hrc              |    7 ++++---
 svx/sdi/svx.sdi                     |    4 ++--
 sw/source/uibase/uiview/viewtab.cxx |   16 +++++++++++-----
 3 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit 472ab1cad9d7565572877f30709029606c86dc54
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Jun 1 16:03:34 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jun 25 12:55:11 2020 +0200

    lok: add "Remove" param to .uno:ChangeTabStop
    
    Change-Id: Ic6b71c0bb6177eb10f5be4197d77c5db5f5884a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95330
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 8d0b7e5b2f6773f4b3feb75f1ac73ea1a26609f7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97091
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 8d4030ec0285..4951af004d23 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -533,12 +533,13 @@ class SvxSetItem;
 #define SID_TABSTOP_ADD_OR_CHANGE                       ( SID_SVX_START + 581 )
 #define SID_TABSTOP_ATTR_INDEX                          ( SID_SVX_START + 582 )
 #define SID_TABSTOP_ATTR_POSITION                       ( SID_SVX_START + 583 )
-#define SID_PARAGRAPH_FIRST_LINE_INDENT                 ( SID_SVX_START + 584 )
-#define SID_PARAGRAPH_LEFT_INDENT                       ( SID_SVX_START + 585 )
-#define SID_PARAGRAPH_RIGHT_INDENT                      ( SID_SVX_START + 586 )
+#define SID_TABSTOP_ATTR_REMOVE                         ( SID_SVX_START + 584 )
 
 // CAUTION! Range <587 .. 587> used by EditEngine (!)
 
+#define SID_PARAGRAPH_FIRST_LINE_INDENT                 ( SID_SVX_START + 588 )
+#define SID_PARAGRAPH_LEFT_INDENT                       ( SID_SVX_START + 589 )
+#define SID_PARAGRAPH_RIGHT_INDENT                      ( SID_SVX_START + 590 )
 
 // CAUTION! Range <591 .. 591> used by EditEngine (!)
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 17f4b27f9dbf..64531a736a69 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -7209,7 +7209,8 @@ SfxVoidItem RulerChangeState SID_RULER_CHANGE_STATE
 
 SfxVoidItem ChangeTabStop SID_TABSTOP_ADD_OR_CHANGE
     (SfxInt32Item Index SID_TABSTOP_ATTR_INDEX,
-     SfxInt32Item Position SID_TABSTOP_ATTR_POSITION)
+     SfxInt32Item Position SID_TABSTOP_ATTR_POSITION,
+     SfxBoolItem  Remove SID_TABSTOP_ATTR_REMOVE)
 [
     AutoUpdate = FALSE,
     FastCall = TRUE,
@@ -7219,7 +7220,6 @@ SfxVoidItem ChangeTabStop SID_TABSTOP_ADD_OR_CHANGE
     RecordAbsolute = FALSE,
     RecordPerSet;
 
-
     AccelConfig = FALSE,
     MenuConfig = FALSE,
     ToolBoxConfig = FALSE,
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index cb8662580fa3..7a2f8c852625 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -663,8 +663,12 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
         {
             const auto aIndexItem = static_cast<const SfxInt32Item&>(pReqArgs->Get(SID_TABSTOP_ATTR_INDEX));
             const auto aPositionItem = static_cast<const SfxInt32Item&>(pReqArgs->Get(SID_TABSTOP_ATTR_POSITION));
+            const auto aRemoveItem = static_cast<const SfxBoolItem&>(pReqArgs->Get(SID_TABSTOP_ATTR_REMOVE));
             const sal_Int32 nIndex = aIndexItem.GetValue();
             const sal_Int32 nPosition = aPositionItem.GetValue();
+            const bool bRemove = aRemoveItem.GetValue();
+
+
 
             SfxItemSet aItemSet(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>{});
             rSh.GetCurAttr(aItemSet);
@@ -688,12 +692,14 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
                 {
                     SvxTabStop aTabStop = aTabStopItem.At(nIndex);
                     aTabStopItem.Remove(nIndex);
-                    aTabStop.GetTabPos() = nPosition;
-                    aTabStopItem.Insert(aTabStop);
-
-                    SvxTabStop aSwTabStop(0, SvxTabAdjust::Default);
-                    aTabStopItem.Insert(aSwTabStop);
+                    if (!bRemove)
+                    {
+                        aTabStop.GetTabPos() = nPosition;
+                        aTabStopItem.Insert(aTabStop);
 
+                        SvxTabStop aSwTabStop(0, SvxTabAdjust::Default);
+                        aTabStopItem.Insert(aSwTabStop);
+                    }
                     const SvxTabStopItem& rDefaultTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
                     MakeDefTabs(GetTabDist(rDefaultTabs), aTabStopItem);
                 }


More information about the Libreoffice-commits mailing list