[Libreoffice-commits] core.git: vcl/inc vcl/win

Khaled Hosny (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 20 02:09:29 UTC 2019


 vcl/inc/win/salgdi.h    |    2 +-
 vcl/win/gdi/salfont.cxx |   16 ++++------------
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 362b872305d3b3500ef6f0823e5d30433dcfe48e
Author:     Khaled Hosny <khaledhosny at eglug.org>
AuthorDate: Thu Jun 20 02:13:04 2019 +0200
Commit:     Khaled Hosny <khaledhosny at eglug.org>
CommitDate: Thu Jun 20 04:08:25 2019 +0200

    Remove leftover from bitmap fonts support on Windows
    
    The condition "nFontType & RASTER_FONTTYPE" can never be true since we reject
    such fonts, so nHeight is always zero and we can simplify the code a bit
    accordingly.
    
    Change-Id: Ib3a19777909e16367c8168e86e474c1a5ee64a5b
    Reviewed-on: https://gerrit.libreoffice.org/74400
    Tested-by: Jenkins
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 7dc859a1a551..23f201fea6fa 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -59,7 +59,7 @@ class WinFontFace : public PhysicalFontFace
 {
 public:
     explicit                WinFontFace( const FontAttributes&,
-                                int nFontHeight, BYTE eWinCharSet,
+                                BYTE eWinCharSet,
                                 BYTE nPitchAndFamily  );
     virtual                 ~WinFontFace() override;
 
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 181bbcec633b..fcdbb6484dda 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -559,16 +559,10 @@ static FontAttributes WinFont2DevFontAttributes( const ENUMLOGFONTEXW& rEnumFont
 
 
 static rtl::Reference<WinFontFace> ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
-                                         const NEWTEXTMETRICW* pMetric,
-                                         DWORD nFontType )
+                                         const NEWTEXTMETRICW* pMetric)
 {
-    int nHeight = 0;
-    if ( nFontType & RASTER_FONTTYPE )
-        nHeight = pMetric->tmHeight - pMetric->tmInternalLeading;
-
     rtl::Reference<WinFontFace> pData = new WinFontFace(
         WinFont2DevFontAttributes(*pLogFont, *pMetric),
-        nHeight,
         pLogFont->elfLogFont.lfCharSet,
         pMetric->tmPitchAndFamily );
 
@@ -613,7 +607,7 @@ void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont )
 }
 
 WinFontFace::WinFontFace( const FontAttributes& rDFS,
-    int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
+    BYTE eWinCharSet, BYTE nPitchAndFamily )
 :   PhysicalFontFace( rDFS ),
     mnId( 0 ),
     mbFontCapabilitiesRead( false ),
@@ -622,8 +616,6 @@ WinFontFace::WinFontFace( const FontAttributes& rDFS,
     mbAliasSymbolsHigh( false ),
     mbAliasSymbolsLow( false )
 {
-    SetBitmapSize( 0, nHeight );
-
     if( eWinCharSet == SYMBOL_CHARSET )
     {
         if( (nPitchAndFamily & TMPF_TRUETYPE) != 0 )
@@ -1052,7 +1044,7 @@ static int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
             return 1;
         }
 
-        rtl::Reference<WinFontFace> pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType );
+        rtl::Reference<WinFontFace> pData = ImplLogMetricToDevFontDataW(pLogFont, &(pMetric->ntmTm));
         pData->SetFontId( sal_IntPtr( pInfo->mnFontCount++ ) );
 
         pInfo->mpList->Add( pData.get() );
@@ -1222,7 +1214,7 @@ bool WinSalGraphics::AddTempDevFont( PhysicalFontCollection* pFontCollection,
         aDFS.maMapName = aFontName;
     */
 
-    rtl::Reference<WinFontFace> pFontData = new WinFontFace( aDFA, 0,
+    rtl::Reference<WinFontFace> pFontData = new WinFontFace(aDFA,
         sal::static_int_cast<BYTE>(DEFAULT_CHARSET),
         sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
     pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData.get()) );


More information about the Libreoffice-commits mailing list