[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - include/svx svx/source sw/inc sw/sdi sw/source
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 6 07:16:54 UTC 2021
include/svx/ruler.hxx | 2 ++
svx/source/dialog/svxruler.cxx | 14 ++++++++++++++
sw/inc/cmdid.h | 3 ++-
sw/sdi/_textsh.sdi | 6 ++++++
sw/sdi/swriter.sdi | 17 +++++++++++++++++
sw/source/uibase/shells/textsh1.cxx | 11 +++++++++++
6 files changed, 52 insertions(+), 1 deletion(-)
New commits:
commit 6b56196094e063c3c30d1ec13b1d3f9d1927af9b
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Feb 4 15:38:46 2020 +0200
Commit: Tor Lillqvist <tml at iki.fi>
CommitDate: Tue Apr 6 10:09:27 2021 +0300
tdf#128468: Add SvxRuler::MoveTabstop() and use it
Change-Id: If223bde1ae5161da821530d36e50a971c62f6944
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87977
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94225
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index c0b587cdc583..7e116e6185d8 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -278,6 +278,8 @@ public:
void SetTabsRelativeToIndent( bool bRel );
void SetValues(RulerChangeType type, tools::Long value);
tools::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 66457d3bca1e..c89b603abaad 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1665,6 +1665,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 f46567e66096..72068a2045c4 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1578,8 +1578,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:
commit 5e8265667f2e271620010868532b676c0e82265f
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Feb 3 15:03:50 2020 +0200
Commit: Tor Lillqvist <tml at iki.fi>
CommitDate: Tue Apr 6 10:06:24 2021 +0300
tdf#128468: Add new UNO command "MoveTabstop"
Work in progress. Implementation still incomplete.
The stuff I added in the .sdi files is mostly copy-paste without any
deeper understanding.
Change-Id: Iad36c20e963c9df19645a04ca4a0d9bf81f3839a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87873
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
(cherry picked from commit 00db5444b2126dbf48a7ef65e702dd4b10d4f941)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94223
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 49d6e607f943..27ac3ddd8f17 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -480,7 +480,8 @@
#define FN_FORMAT_APPLY_DEFAULT (FN_FORMAT2 + 157)
#define FN_FORMAT_APPLY_TEXTBODY (FN_FORMAT2 + 158)
#define FN_REMOVE_DIRECT_CHAR_FORMATS (FN_FORMAT2 + 159)
-//free (160)
+
+#define FN_MOVE_TABSTOP (FN_FORMAT2 + 160)
// Region: Extras
#define FN_LINE_NUMBERING_DLG (FN_EXTRA + 2 ) /* */
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index e0bcfff65360..25b14fe886f2 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1554,6 +1554,12 @@ interface BaseText
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+ FN_MOVE_TABSTOP
+ [
+ ExecMethod = Execute ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
+
SID_TRANSLITERATE_SENTENCE_CASE
[
ExecMethod = ExecTransliteration;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 9a03663dc19d..f8445e8eba6d 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -8141,3 +8141,20 @@ SfxUInt32Item TableColumWidth SID_ATTR_TABLE_COLUMN_WIDTH
ToolBoxConfig = FALSE,
GroupId = SfxGroupId::Table;
]
+
+SfxVoidItem MoveTabstop FN_MOVE_TABSTOP
+(SfxInt32Item Tabstop FN_PARAM_1, SfxInt32Item Amount FN_PARAM_2)
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index c5e7389be77c..f46567e66096 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1572,6 +1572,16 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SetInsMode( bOldIns );
}
break;
+ case FN_MOVE_TABSTOP:
+ {
+ const SfxInt32Item* pIndex = rReq.GetArg<SfxInt32Item>(FN_PARAM_1);
+ 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
+ }
+ break;
default:
OSL_ENSURE(false, "wrong dispatcher");
return;
More information about the Libreoffice-commits
mailing list