[Libreoffice-commits] core.git: sw/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 12 13:22:25 UTC 2019
sw/source/uibase/shells/txtattr.cxx | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
New commits:
commit 669f4480dd49dd95a75e5413903bad31b799e93c
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Nov 12 12:31:10 2019 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Nov 12 14:21:05 2019 +0100
jsdialogs: send .uno:LeftRightParaMargin updates
Change-Id: I22aef6ac57c94893bf2e73ea2901ed8bc074076e
Reviewed-on: https://gerrit.libreoffice.org/82501
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
(cherry picked from commit c6cf2bec7148e403e2ee9592b4410cc73bad8f46)
Reviewed-on: https://gerrit.libreoffice.org/82506
Tested-by: Jenkins
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index 2e42c12c7898..737a1e094e41 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -39,6 +39,9 @@
#include <editeng/frmdiritem.hxx>
#include <editeng/cmapitem.hxx>
#include <paratr.hxx>
+#include <comphelper/lok.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <editeng/itemtype.hxx>
#include <fmtinfmt.hxx>
#include <docsh.hxx>
@@ -752,6 +755,28 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
SvxLRSpaceItem aLR = aCoreSet.Get( RES_LR_SPACE );
aLR.SetWhich(nSlot);
rSet.Put(aLR);
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // TODO: set correct unit
+ MapUnit eTargetUnit = MapUnit::MapInch;
+
+ OUString sLeft = GetMetricText(aLR.GetLeft(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ OUString sRight = GetMetricText(aLR.GetRight(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ OUString sFirstline = GetMetricText(aLR.GetTextFirstLineOfst(),
+ MapUnit::MapTwip, eTargetUnit, nullptr);
+
+ OUString sPayload = ".uno:LeftRightParaMargin={\"left\": \"" + sLeft +
+ "\", \"right\": \"" + sRight +
+ "\", \"firstline\": \"" + sFirstline + "\"}";
+
+ GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+ OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr());
+ }
}
else
rSet.InvalidateItem(nSlot);
More information about the Libreoffice-commits
mailing list