[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sw/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 12 17:26:28 UTC 2019


 sw/source/uibase/uiview/viewtab.cxx |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 891cd63392262dd7be27f30b0f31687c005a2703
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Nov 12 16:28:04 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Nov 12 18:24:35 2019 +0100

    jsdialogs: send .uno:ULSpacing updates
    
    Change-Id: I061868a0cf9163624026dc1ff164af3d98923aa6
    Reviewed-on: https://gerrit.libreoffice.org/82529
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index d978d6a7451b..96c322aa5d33 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -56,6 +56,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>
 
@@ -1578,6 +1581,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
             {


More information about the Libreoffice-commits mailing list