summaryrefslogtreecommitdiffstats
path: root/vcl/generic/glyphs
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-29 12:05:03 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-05-29 12:05:03 +0200
commit696f96f34b9e4cc384ecb3481b018301f493fc23 (patch)
treefc3bdedfa171e02a20fea868187979e90a57c8e3 /vcl/generic/glyphs
parentloplugin:redundantcast: const_cast to same type (diff)
downloadcore-696f96f34b9e4cc384ecb3481b018301f493fc23.tar.gz
core-696f96f34b9e4cc384ecb3481b018301f493fc23.zip
loplugin:redundantcast: const_cast to same type
Change-Id: I610fd4cf9339fd5c18eb77e7c94ffd0f99e9b125
Diffstat (limited to 'vcl/generic/glyphs')
-rw-r--r--vcl/generic/glyphs/glyphcache.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx
index 50042c297b92..c15e5485aff9 100644
--- a/vcl/generic/glyphs/glyphcache.cxx
+++ b/vcl/generic/glyphs/glyphcache.cxx
@@ -218,13 +218,9 @@ ServerFont* GlyphCache::CacheFont( const FontSelectPattern& rFontSelData )
void GlyphCache::UncacheFont( ServerFont& rServerFont )
{
- // the interface for rServerFont must be const because a
- // user who wants to release it only got const ServerFonts.
- // The caching algorithm needs a non-const object
- ServerFont* pFont = const_cast<ServerFont*>( &rServerFont );
- if( (pFont->Release() <= 0) && (mnMaxSize <= mnBytesUsed) )
+ if( (rServerFont.Release() <= 0) && (mnMaxSize <= mnBytesUsed) )
{
- mpCurrentGCFont = pFont;
+ mpCurrentGCFont = &rServerFont;
GarbageCollect();
}
}