[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Sep 8 11:47:14 PDT 2011


 sc/source/core/data/global.cxx |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 7d307d9c8bde7da89683bab9566e681e55e8bf36
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Thu Sep 8 14:42:01 2011 -0400

    Bring the default row height back to the 3.4 level.
    
    Until we find a better solution, let's at least bring the values
    back to the 3.4 level.
    
    In 3.4 I have nDefFontHeight = 225 and nStdRowHeight = 256.  This
    change make those values the minimum values.

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index a48431e..26046de 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -139,8 +139,8 @@ SvNumberFormatter* ScGlobal::pEnglishFormatter = NULL;
 double          ScGlobal::nScreenPPTX           = 96.0;
 double          ScGlobal::nScreenPPTY           = 96.0;
 
-sal_uInt16          ScGlobal::nDefFontHeight        = 240;
-sal_uInt16          ScGlobal::nStdRowHeight         = 257;
+sal_uInt16          ScGlobal::nDefFontHeight        = 225;
+sal_uInt16          ScGlobal::nStdRowHeight         = 256;
 
 long            ScGlobal::nLastRowHeightExtra   = 0;
 long            ScGlobal::nLastColWidthExtra    = STD_EXTRA_WIDTH;
@@ -624,14 +624,19 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
     Font aDefFont;
     pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow);        // font color doesn't matter here
     aVirtWindow.SetFont(aDefFont);
-    nDefFontHeight = (sal_uInt16) aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()),
-                                MAP_TWIP).Height();
+    sal_uInt16 nTest = static_cast<sal_uInt16>(
+        aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height());
+
+    if (nTest > nDefFontHeight)
+        nDefFontHeight = nTest;
 
     const SvxMarginItem* pMargin = (const SvxMarginItem*)&pPattern->GetItem(ATTR_MARGIN);
 
-    nStdRowHeight = (sal_uInt16) ( nDefFontHeight +
-                                pMargin->GetTopMargin() + pMargin->GetBottomMargin()
-                                - STD_ROWHEIGHT_DIFF );
+    nTest = static_cast<sal_uInt16>(
+        nDefFontHeight + pMargin->GetTopMargin() + pMargin->GetBottomMargin() - STD_ROWHEIGHT_DIFF);
+
+    if (nTest > nStdRowHeight)
+        nStdRowHeight = nTest;
 }
 
 void ScGlobal::Clear()


More information about the Libreoffice-commits mailing list