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

Khaled Hosny khaledhosny at eglug.org
Thu Jan 12 22:29:39 UTC 2017


 vcl/win/gdi/salfont.cxx |   28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

New commits:
commit 349a3c073391842e94ee83345e9c2f38339be1d7
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Thu Jan 12 08:51:39 2017 +0200

    Drop unused struct members
    
    Change-Id: I37aea9a2a40ab0e9642709de3b9e935bee9a6a53
    Reviewed-on: https://gerrit.libreoffice.org/32986
    Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
    Tested-by: Khaled Hosny <khaledhosny at eglug.org>

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 9860d5f..d1332ae8 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -335,10 +335,7 @@ struct ImplEnumInfo
     HDC                 mhDC;
     PhysicalFontCollection* mpList;
     OUString*           mpName;
-    LOGFONTA*           mpLogFontA;
-    LOGFONTW*           mpLogFontW;
-    UINT                mnPreferredCharSet;
-    bool                mbPrinter;
+    LOGFONTW*           mpLogFont;
     int                 mnFontCount;
 };
 
@@ -1049,12 +1046,12 @@ int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe,
         {
             OUString aName = OUString(reinterpret_cast<const sal_Unicode*>(pLogFont->elfLogFont.lfFaceName));
             pInfo->mpName = &aName;
-            memcpy( pInfo->mpLogFontW->lfFaceName, pLogFont->elfLogFont.lfFaceName, (aName.getLength()+1)*sizeof( wchar_t ) );
-            pInfo->mpLogFontW->lfCharSet = pLogFont->elfLogFont.lfCharSet;
-            EnumFontFamiliesExW( pInfo->mhDC, pInfo->mpLogFontW, SalEnumFontsProcExW,
-                                 reinterpret_cast<LPARAM>(pInfo), 0 );
-            pInfo->mpLogFontW->lfFaceName[0] = '\0';
-            pInfo->mpLogFontW->lfCharSet = DEFAULT_CHARSET;
+            memcpy(pInfo->mpLogFont->lfFaceName, pLogFont->elfLogFont.lfFaceName, (aName.getLength()+1)*sizeof(wchar_t));
+            pInfo->mpLogFont->lfCharSet = pLogFont->elfLogFont.lfCharSet;
+            EnumFontFamiliesExW(pInfo->mhDC, pInfo->mpLogFont, SalEnumFontsProcExW,
+                                reinterpret_cast<LPARAM>(pInfo), 0);
+            pInfo->mpLogFont->lfFaceName[0] = '\0';
+            pInfo->mpLogFont->lfCharSet = DEFAULT_CHARSET;
             pInfo->mpName = nullptr;
         }
     }
@@ -1326,21 +1323,12 @@ void WinSalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection )
     aInfo.mhDC          = getHDC();
     aInfo.mpList        = pFontCollection;
     aInfo.mpName        = nullptr;
-    aInfo.mpLogFontA    = nullptr;
-    aInfo.mpLogFontW    = nullptr;
-    aInfo.mbPrinter     = mbPrinter;
     aInfo.mnFontCount   = 0;
 
-    aInfo.mnPreferredCharSet = DEFAULT_CHARSET;
-    DWORD nCP = GetACP();
-    CHARSETINFO aCharSetInfo;
-    if ( TranslateCharsetInfo( reinterpret_cast<DWORD*>((sal_IntPtr)nCP), &aCharSetInfo, TCI_SRCCODEPAGE ) )
-        aInfo.mnPreferredCharSet = aCharSetInfo.ciCharset;
-
     LOGFONTW aLogFont;
     memset( &aLogFont, 0, sizeof( aLogFont ) );
     aLogFont.lfCharSet = DEFAULT_CHARSET;
-    aInfo.mpLogFontW = &aLogFont;
+    aInfo.mpLogFont = &aLogFont;
     EnumFontFamiliesExW( getHDC(), &aLogFont,
         SalEnumFontsProcExW, reinterpret_cast<LPARAM>(&aInfo), 0 );
 


More information about the Libreoffice-commits mailing list