[Libreoffice-commits] core.git: Branch 'feature/cib_contract57c' - vcl/win

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 28 09:35:51 UTC 2019


Rebased ref, commits from common ancestor:
commit 5cc94657e68c66d81cca1d41d937ef89016325b7
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Mar 26 15:08:12 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Mar 28 10:34:58 2019 +0100

    Fix windows build
    
    After 54ac2b203a6dd974c0153996ba67b26d585e98e1
    
    Change-Id: I805415dfa75568d843fceb5a79b637aac337ffd4

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index b0158f9154d5..f3d0cf97811e 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -932,6 +932,7 @@ void WinSalGraphics::SetFont( const FontSelectPattern* pFont, int nFallbackLevel
     // WinSalGraphics::GetEmbedFontData does not set mpFontInstance
     // since it is interested in font file data only.
     mpWinFontEntry[ nFallbackLevel ] = reinterpret_cast<WinFontInstance*>( pFont->mpFontInstance.get() );
+    WinFontInstance *pFontInstance = static_cast<WinFontInstance*>(pFont->mpFontInstance.get());
 
     HFONT hOldFont = nullptr;
     HFONT hNewFont = pFontInstance ? pFontInstance->GetHFONT() : nullptr;
@@ -970,7 +971,6 @@ void WinSalGraphics::SetFont( const FontSelectPattern* pFont, int nFallbackLevel
             }
             if (mpWinFontEntry[i])
             {
-                GetWinFontEntry(i)->Release();
                 mpWinFontEntry[i] = nullptr;
             }
             mfFontScale[i] = 1.0;
@@ -1363,7 +1363,7 @@ void WinSalGraphics::ClearDevFontCache()
 
 bool WinSalGraphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect)
 {
-    WinFontInstance* pFont = mpWinFontEntry[rGlyph.mnFallbackLevel];
+    rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.mnFallbackLevel];
     HFONT hNewFont = pFont ? pFont->GetHFONT() : mhFonts[rGlyph.mnFallbackLevel];
     float fFontScale = pFont ? pFont->GetScale() : mfFontScale[rGlyph.mnFallbackLevel];
 
@@ -1572,7 +1572,7 @@ bool WinSalGraphics::GetGlyphOutline(const GlyphItem& rGlyph,
     // rescaling needed for the tools::PolyPolygon conversion
     if( rB2DPolyPoly.count() )
     {
-        WinFontInstance *pFont = mpWinFontEntry[rGlyph.mnFallbackLevel];
+        rtl::Reference<WinFontInstance> pFont = mpWinFontEntry[rGlyph.mnFallbackLevel];
         float fFontScale = pFont ? pFont->GetScale() : mfFontScale[rGlyph.mnFallbackLevel];
         const double fFactor(fFontScale/256);
         rB2DPolyPoly.transform(basegfx::utils::createScaleB2DHomMatrix(fFactor, fFactor));


More information about the Libreoffice-commits mailing list