diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-12 16:28:04 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2019-11-12 18:24:19 +0100 |
commit | 1c8ce0b30beb5d2a0e6a47e1d61689470608b78e (patch) | |
tree | 3cf636561c7387c40639b76d579e21fdb7b18ef6 /sw | |
parent | db13ed2efa924cee6acd0699f2676175419da5ad (diff) |
jsdialogs: send .uno:ULSpacing updates
Change-Id: I061868a0cf9163624026dc1ff164af3d98923aa6
Reviewed-on: https://gerrit.libreoffice.org/82531
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 378070794a53..f52cf5617664 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -61,6 +61,9 @@ #include <cntfrm.hxx> #include <ndtxt.hxx> #include <pam.hxx> +#include <comphelper/lok.hxx> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <editeng/itemtype.hxx> #include <IDocumentSettingAccess.hxx> @@ -1581,6 +1584,24 @@ void SwView::StateTabWin(SfxItemSet& rSet) aUL.SetWhich( nWhich ); rSet.Put( aUL ); } + + if (comphelper::LibreOfficeKit::isActive()) + { + // TODO: set correct unit + MapUnit eTargetUnit = MapUnit::MapInch; + + OUString sUpper = GetMetricText(aUL.GetUpper(), + MapUnit::MapTwip, eTargetUnit, nullptr); + + OUString sLower = GetMetricText(aUL.GetLower(), + MapUnit::MapTwip, eTargetUnit, nullptr); + + OUString sPayload = ".uno:ULSpacing={\"upper\": \"" + sUpper + + "\", \"lower\": \"" + sLower + "\"}"; + + GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, + OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US).getStr()); + } } else { |