diff options
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx | 13 | ||||
-rw-r--r-- | vcl/inc/generic/glyphcache.hxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi3.cxx | 8 |
3 files changed, 19 insertions, 5 deletions
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index bc3c544ad896..826b4cc2a380 100644 --- a/vcl/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx @@ -410,9 +410,22 @@ ImplServerFontEntry::ImplServerFontEntry( FontSelectPattern& rFSD ) // ----------------------------------------------------------------------- +void ImplServerFontEntry::SetServerFont(ServerFont* p) +{ + if (p == mpServerFont) + return; + if (mpServerFont) + mpServerFont->Release(); + mpServerFont = p; + if (mpServerFont) + mpServerFont->AddRef(); +} + ImplServerFontEntry::~ImplServerFontEntry() { // TODO: remove the ServerFont here instead of in the GlyphCache + if (mpServerFont) + mpServerFont->Release(); } // ======================================================================= diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 655f2cdfbfa9..14af1d36e4d3 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -224,6 +224,7 @@ public: private: friend class GlyphCache; friend class ServerFontLayout; + friend class ImplServerFontEntry; friend class X11SalGraphics; void AddRef() const { ++mnRefCount; } @@ -301,7 +302,7 @@ private: public: ImplServerFontEntry( FontSelectPattern& ); virtual ~ImplServerFontEntry(); - void SetServerFont( ServerFont* p) { mpServerFont = p; } + void SetServerFont(ServerFont* p); void HandleFontOptions(); }; diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index beaf8fd9d68b..21089cc82d5b 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -194,10 +194,10 @@ bool X11SalGraphics::setFont( const FontSelectPattern *pEntry, int nFallbackLeve // apply font specific-hint settings if needed // TODO: also disable it for reference devices - if( !bPrinter_ ) - { - ImplServerFontEntry* pSFE = static_cast<ImplServerFontEntry*>( pEntry->mpFontEntry ); - pSFE->HandleFontOptions(); + if( !bPrinter_ ) + { + ImplServerFontEntry* pSFE = static_cast<ImplServerFontEntry*>( pEntry->mpFontEntry ); + pSFE->HandleFontOptions(); } return true; |