sw/source/uibase/shells/txtattr.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
New commits: commit c6cf2bec7148e403e2ee9592b4410cc73bad8f46 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Nov 12 12:31:10 2019 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Nov 12 13:26:19 2019 +0100 jsdialogs: send .uno:LeftRightParaMargin updates Change-Id: I22aef6ac57c94893bf2e73ea2901ed8bc074076e Reviewed-on: https://gerrit.libreoffice.org/82501 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index d83db9144420..70ef0ba431f7 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -38,6 +38,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> @@ -722,6 +725,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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits