[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - 2 commits - svtools/source sw/source

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 5 16:21:50 UTC 2019


 svtools/source/control/ruler.cxx  |    1 +
 sw/source/uibase/misc/swruler.cxx |   20 +++++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit e5d7d211ab668503f4691b4b30b36e66c3b31260
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Dec 3 18:44:45 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 5 17:21:00 2019 +0100

    Add a comment telling what "frame margin" means here
    
    Change-Id: Ie6d088217c066ec3091fb28925947175cf62634f
    (cherry picked from commit 21b68c4cd7ce108cf334607ced0b20e7b5914c20)
    (cherry picked from commit 51794501045a6f8b0f6f1c04b6aee2e28647b4ea)
    Reviewed-on: https://gerrit.libreoffice.org/84539
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 0263deacac31..0d047cec5737 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -116,6 +116,7 @@ private:
     long       nNullOff;
     long       nMargin1;
     long       nMargin2;
+    // In this context, "frame margin" means paragraph margins (indents)
     long       nLeftFrameMargin;
     long       nRightFrameMargin;
     RulerMarginStyle nMargin1Style;
commit bbf4e379a2b3c81718d84017f1d6d7d2f6742a09
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Dec 4 15:00:15 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 5 17:20:38 2019 +0100

    Add comment about confusion in SwCommentRuler::CreateJsonNotification()
    
    No code changes.
    
    (cherry picked from commit 5b6d23dcd0f2f779b4bbffe7f427a7c397f41c95)
    
    Change-Id: Ibc46b3e55038e84f2ad80ff12b277b2e2c77a4ce
    (cherry picked from commit 0fb2b9b23ac3d082251217b3478917b387fe162c)
    Reviewed-on: https://gerrit.libreoffice.org/84540
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index 874ab6e81e1e..e18d2a69323e 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -257,10 +257,28 @@ const std::string SwCommentRuler::CreateJsonNotification()
 {
     boost::property_tree::ptree jsonNotif;
 
+    // Note that GetMargin1(), GetMargin2(), GetNullOffset(), and GetPageOffset() return values in
+    // pixels. Not twips. So "converting" the returned values with convertTwipToMm100() is quite
+    // wrong. (Also, even if the return values actually were in twips, it is questionable why we
+    // would want to pass them in mm100, as all other length values in the LOKit protocol apparently
+    // are in twips.)
+
+    // Anyway, as the consuming code in Online mostly seems to work anyway, it is likely that it
+    // would work as well even if the values in pixels were passed without a bogus "conversion" to
+    // mm100. But let's keep this as is for now.
+
+    // Also note that in desktop LibreOffice, these pixel values for the ruler of course change as
+    // one changes the zoom level. (Can be seen if one temporarily modifies the NotifyKit() function
+    // below to call this CreateJsonNotification() function and print its result in all cases even
+    // without LibreOfficeKit::isActive().) But in both web-based Online and in the iOS app, the
+    // zoom level from the point of view of this code here apparently does not change even if one
+    // zooms from the Online code's point of view.
     jsonNotif.put("margin1", convertTwipToMm100(GetMargin1()));
     jsonNotif.put("margin2", convertTwipToMm100(GetMargin2()));
     jsonNotif.put("leftOffset", convertTwipToMm100(GetNullOffset()));
     jsonNotif.put("pageOffset", convertTwipToMm100(GetPageOffset()));
+
+    // GetPageWidth() on the other hand does return a value in twips.
     jsonNotif.put("pageWidth", convertTwipToMm100(GetPageWidth()));
 
     RulerUnitData aUnitData = GetCurrentRulerUnit();


More information about the Libreoffice-commits mailing list