[Libreoffice-commits] core.git: include/tools sw/source

Jan Holesovsky kendy at collabora.com
Thu May 18 16:04:59 UTC 2017


 include/tools/mapunit.hxx         |   14 ++++----------
 sw/source/core/inc/rootfrm.hxx    |    3 +++
 sw/source/core/layout/newfrm.cxx  |    2 +-
 sw/source/core/layout/pagechg.cxx |    6 ++----
 4 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit 1be2684512e5ad21526c65ee04acf2c71a8691b6
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu May 18 13:25:31 2017 +0200

    sw lok: Make the default for the Web view larger.
    
    Change-Id: I943711e084adcfa0af2a79cf83d5c3e1b6dc45e6
    Reviewed-on: https://gerrit.libreoffice.org/37758
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/tools/mapunit.hxx b/include/tools/mapunit.hxx
index 334e2f5202bf..2209f4d35261 100644
--- a/include/tools/mapunit.hxx
+++ b/include/tools/mapunit.hxx
@@ -34,20 +34,14 @@ enum class MapUnit
     LASTENUMDUMMY // used as an error return
 };
 
-inline sal_Int64 convertTwipToMm100(sal_Int64 n)
+constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
 {
-    if (n >= 0)
-        return (n*127+36)/72;
-    else
-        return (n*127-36)/72;
+    return (n >= 0)? (n*127+36)/72: (n*127-36)/72;
 }
 
-inline sal_Int64 convertMm100ToTwip(sal_Int64 n)
+constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
 {
-    if (n >= 0)
-        return (n*72+63)/127;
-    else
-        return (n*72-63)/127;
+    return (n >= 0)? (n*72+63)/127: (n*72-63)/127;
 }
 
 #endif
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 15efe013af46..66a3e590a490 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -96,6 +96,9 @@ class SwRootFrame: public SwLayoutFrame
     static bool           s_isInPaint; // Protection against double Paints
     static bool           s_isNoVirDev;// No virt. Device for SystemPaints
 
+    /// Width of the HTML / Web document if not defined otherwise: 20cm.
+    static constexpr sal_Int64 MIN_BROWSE_WIDTH = convertMm100ToTwip(20000);
+
     bool    mbCheckSuperfluous   :1; // Search for empty Pages?
     bool    mbIdleFormat         :1; // Trigger Idle Formatter?
     bool    mbBrowseWidthValid   :1; // Is mnBrowseWidth valid?
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index e1a96cd25ac1..b5785c4b0330 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -464,7 +464,7 @@ SwRootFrame::SwRootFrame( SwFrameFormat *pFormat, SwViewShell * pSh ) :
     mbIsNewLayout( true ),
     mbCallbackActionEnabled ( false ),
     mbLayoutFreezed ( false ),
-    mnBrowseWidth( MM50*4 ), //2cm minimum
+    mnBrowseWidth(MIN_BROWSE_WIDTH),
     mpTurbo( nullptr ),
     mpLastPage( nullptr ),
     mpCurrShell( pSh ),
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 9f61fab99771..906566892ecc 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1604,10 +1604,8 @@ void SwRootFrame::ImplCalcBrowseWidth()
 
     mbBrowseWidthValid = true;
     SwViewShell *pSh = getRootFrame()->GetCurrShell();
-    mnBrowseWidth = pSh
-                    ? MINLAY + 2 * pSh->GetOut()->
-                                PixelToLogic( pSh->GetBrowseBorder() ).Width()
-                    : 5000;
+    mnBrowseWidth = (!comphelper::LibreOfficeKit::isActive() && pSh)? MINLAY + 2 * pSh->GetOut()-> PixelToLogic( pSh->GetBrowseBorder() ).Width(): MIN_BROWSE_WIDTH;
+
     do
     {
         if ( pFrame->IsInTab() )


More information about the Libreoffice-commits mailing list