[Libreoffice-commits] core.git: cui/source desktop/source sd/source svx/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 16 09:33:01 UTC 2021


 cui/source/tabpages/page.cxx                   |    3 ++-
 desktop/source/lib/init.cxx                    |    2 +-
 sd/source/ui/sidebar/SlideBackground.hxx       |    2 --
 svx/source/dialog/hdft.cxx                     |    5 ++++-
 sw/source/uibase/sidebar/PageMarginControl.hxx |    5 ++++-
 5 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit a6ca6215a5ec82e833ebfcd2ebd4455cb504fd8e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Aug 16 10:31:55 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Aug 16 11:32:15 2021 +0200

    Use o3tl::toTwips to define MINBODY
    
    This changes its value from 56 to the proper 57.
    
    See 9be17c52b7c565758088b8020a543d7b840e31a7, which had
    changed the previous 5-mm value to the incorrectly rounded
    1-mm value; and cefce1a247a4674c5726a31b61571eab16328a0b,
    which had unified the other places mentioning i19922.
    
    Change-Id: I7186320b4c1a2a65a6f728ed8bafcbf0eb45c4cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120441
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 29d8f85b918a..ab79d9fadb10 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <memory>
+#include <o3tl/unit_conversion.hxx>
 #include <sfx2/objsh.hxx>
 #include <sfx2/printer.hxx>
 #include <sfx2/viewsh.hxx>
@@ -60,7 +61,7 @@
 // static ----------------------------------------------------------------
 
 // #i19922# - tdf#126051 see svx/source/dialog/hdft.cxx and sw/source/uibase/sidebar/PageMarginControl.hxx
-const tools::Long MINBODY = 56;  // 1mm in twips rounded
+constexpr tools::Long MINBODY = o3tl::toTwips(1, o3tl::Length::mm); // 1mm in twips rounded
 
 const WhichRangesContainer SvxPageDescPage::pRanges(
     svl::Items<
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 18ee858c72c0..916f2cc9ea14 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -808,7 +808,7 @@ void ExecuteOrientationChange()
 
     // 1mm in twips rounded
     // This should be in sync with MINBODY in sw/source/uibase/sidebar/PageMarginControl.hxx
-    constexpr tools::Long MINBODY = 56;
+    constexpr tools::Long MINBODY = o3tl::toTwips(1, o3tl::Length::mm);
 
     css::uno::Reference< css::document::XUndoManager > mxUndoManager(
                 getUndoManager( SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) );
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 9cb3e448b112..e060053aa450 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -39,8 +39,6 @@ class XFillGradientItem;
 class XFillBitmapItem;
 class XFillHatchItem;
 
-const tools::Long MINBODY = 284;
-
 namespace sd::sidebar {
 
 class SlideBackground :
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 40956cdc6572..6bf8f0668b95 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/unit_conversion.hxx>
 #include <svl/itemiter.hxx>
 #include <sfx2/objsh.hxx>
 #include <svx/svxids.hrc>
@@ -48,7 +51,7 @@ using namespace com::sun::star;
 
 // Word 97 incompatibility (#i19922#)
 // #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and sw/source/uibase/sidebar/PageMarginControl.hxx
-const tools::Long MINBODY = 56;  // 1mm in twips rounded
+constexpr tools::Long MINBODY = o3tl::toTwips(1, o3tl::Length::mm); // 1mm in twips rounded
 
 // default distance to Header or footer
 const tools::Long DEF_DIST_WRITER = 500;    // 5mm (Writer)
diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx
index 88e2d0e11e97..aa199dd4adde 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.hxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.hxx
@@ -19,6 +19,9 @@
 #ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
 #define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINCONTROL_HXX
 
+#include <sal/config.h>
+
+#include <o3tl/unit_conversion.hxx>
 #include <svtools/toolbarmenu.hxx>
 
 #define SWPAGE_NARROW_VALUE    720
@@ -28,7 +31,7 @@
 #define SWPAGE_WIDE_VALUE3     1800
 
 // #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and svx/source/dialog/hdft.cxx
-const tools::Long MINBODY = 56;  // 1mm in twips rounded
+constexpr tools::Long MINBODY = o3tl::toTwips(1, o3tl::Length::mm); // 1mm in twips rounded
 
 class PageMarginPopup;
 


More information about the Libreoffice-commits mailing list