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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 09:37:00 UTC 2018


 vcl/inc/win/salgdi.h        |    2 +-
 vcl/win/gdi/salfont.cxx     |   30 +++++++++++++++---------------
 vcl/win/window/salframe.cxx |    2 +-
 3 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 5f1451f0b0b3184b85ae357f90e9a01a3c51d278
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Aug 21 09:07:27 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 22 11:36:36 2018 +0200

    arg is never null
    
    Change-Id: Ifde85786e9e0b0d9c1bdb1163b7c4a0889005323
    Reviewed-on: https://gerrit.libreoffice.org/59386
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index c55193e255e9..0540b66b34f7 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -402,7 +402,7 @@ public:
 // Init/Deinit Graphics
 void    ImplUpdateSysColorEntries();
 int     ImplIsSysColorEntry( Color nColor );
-void    ImplGetLogFontFromFontSelect( HDC, const FontSelectPattern*,
+void    ImplGetLogFontFromFontSelect( HDC, const FontSelectPattern&,
             const PhysicalFontFace*, LOGFONTW& );
 
 #define MAX_64KSALPOINTS    ((((sal_uInt16)0xFFFF)-8)/sizeof(POINTS))
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 526f924b18d7..969cefd17279 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -185,7 +185,7 @@ bool WinGlyphFallbackSubstititution::HasMissingChars(PhysicalFontFace* pFace, OU
         const FontSelectPattern aFSD( *pFace, aSize, static_cast<float>(aSize.Height()), 0, false );
         // construct log font
         LOGFONTW aLogFont;
-        ImplGetLogFontFromFontSelect( mhDC, &aFSD, pFace, aLogFont );
+        ImplGetLogFontFromFontSelect( mhDC, aFSD, pFace, aLogFont );
 
         // create HFONT from log font
         HFONT hNewFont = ::CreateFontIndirectW( &aLogFont );
@@ -760,7 +760,7 @@ int CALLBACK SalEnumQueryFontProcExW( const LOGFONTW*,
 }
 
 void ImplGetLogFontFromFontSelect( HDC hDC,
-                                   const FontSelectPattern* pFont,
+                                   const FontSelectPattern& rFont,
                                    const PhysicalFontFace* pFontFace,
                                    LOGFONTW& rLogFont )
 {
@@ -768,7 +768,7 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
     if (pFontFace)
         aName = pFontFace->GetFamilyName();
     else
-        aName = pFont->GetFamilyName().getToken( 0, ';' );
+        aName = rFont.GetFamilyName().getToken( 0, ';' );
 
     UINT nNameLen = aName.getLength();
     if ( nNameLen > (sizeof( rLogFont.lfFaceName )/sizeof( wchar_t ))-1 )
@@ -784,9 +784,9 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
     }
     else
     {
-        rLogFont.lfCharSet = pFont->IsSymbolFont() ? SYMBOL_CHARSET : DEFAULT_CHARSET;
-        rLogFont.lfPitchAndFamily = ImplPitchToWin( pFont->GetPitch() )
-                                  | ImplFamilyToWin( pFont->GetFamilyType() );
+        rLogFont.lfCharSet = rFont.IsSymbolFont() ? SYMBOL_CHARSET : DEFAULT_CHARSET;
+        rLogFont.lfPitchAndFamily = ImplPitchToWin( rFont.GetPitch() )
+                                  | ImplFamilyToWin( rFont.GetFamilyType() );
     }
 
     static BYTE nDefaultQuality = NONANTIALIASED_QUALITY;
@@ -798,26 +798,26 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
             nDefaultQuality = DEFAULT_QUALITY;
     }
 
-    rLogFont.lfWeight          = ImplWeightToWin( pFont->GetWeight() );
-    rLogFont.lfHeight          = static_cast<LONG>(-pFont->mnHeight);
-    rLogFont.lfWidth           = static_cast<LONG>(pFont->mnWidth);
+    rLogFont.lfWeight          = ImplWeightToWin( rFont.GetWeight() );
+    rLogFont.lfHeight          = static_cast<LONG>(-rFont.mnHeight);
+    rLogFont.lfWidth           = static_cast<LONG>(rFont.mnWidth);
     rLogFont.lfUnderline       = 0;
     rLogFont.lfStrikeOut       = 0;
-    rLogFont.lfItalic          = BYTE(pFont->GetItalic() != ITALIC_NONE);
-    rLogFont.lfEscapement      = pFont->mnOrientation;
+    rLogFont.lfItalic          = BYTE(rFont.GetItalic() != ITALIC_NONE);
+    rLogFont.lfEscapement      = rFont.mnOrientation;
     rLogFont.lfOrientation     = rLogFont.lfEscapement;
     rLogFont.lfClipPrecision   = CLIP_DEFAULT_PRECIS;
     rLogFont.lfQuality         = nDefaultQuality;
     rLogFont.lfOutPrecision    = OUT_TT_PRECIS;
-    if ( pFont->mnOrientation )
+    if ( rFont.mnOrientation )
         rLogFont.lfClipPrecision |= CLIP_LH_ANGLES;
 
     // disable antialiasing if requested
-    if ( pFont->mbNonAntialiased )
+    if ( rFont.mbNonAntialiased )
         rLogFont.lfQuality = NONANTIALIASED_QUALITY;
 
     // select vertical mode if requested and available
-    if ( pFont->mbVertical && nNameLen )
+    if ( rFont.mbVertical && nNameLen )
     {
         // vertical fonts start with an '@'
         memmove( &rLogFont.lfFaceName[1], &rLogFont.lfFaceName[0],
@@ -857,7 +857,7 @@ HFONT WinSalGraphics::ImplDoSetFont(FontSelectPattern const & i_rFont,
         hdcScreen = GetDC(nullptr);
 
     LOGFONTW aLogFont;
-    ImplGetLogFontFromFontSelect( getHDC(), &i_rFont, i_pFontFace, aLogFont );
+    ImplGetLogFontFromFontSelect( getHDC(), i_rFont, i_pFontFace, aLogFont );
 
     // #i47675# limit font requests to MAXFONTHEIGHT
     // TODO: share MAXFONTHEIGHT font instance
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 6fcb54638628..b2e8bb190578 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2180,7 +2180,7 @@ static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pCont
                 // specified by this font name; but it seems to decide whether
                 // to use that font's horizontal or vertical variant based on a
                 // '@' in front of this font name.
-                ImplGetLogFontFromFontSelect(hDC, &pContext->mpFont->GetFontSelectPattern(),
+                ImplGetLogFontFromFontSelect(hDC, pContext->mpFont->GetFontSelectPattern(),
                                              nullptr, aLogFont);
                 ReleaseDC( pFrame->mhWnd, hDC );
                 ImmSetCompositionFontW( hIMC, &aLogFont );


More information about the Libreoffice-commits mailing list