diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-05-29 12:05:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-05-29 12:05:03 +0200 |
commit | 696f96f34b9e4cc384ecb3481b018301f493fc23 (patch) | |
tree | fc3bdedfa171e02a20fea868187979e90a57c8e3 /vcl | |
parent | 148953244fc8d741ef84ef777ad566ae80edd28a (diff) |
loplugin:redundantcast: const_cast to same type
Change-Id: I610fd4cf9339fd5c18eb77e7c94ffd0f99e9b125
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkPicker.cxx | 2 |
4 files changed, 5 insertions, 9 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(); } } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 4edae11f6abe..34bc5505404b 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1668,7 +1668,7 @@ ImplDelData::~ImplDelData() if( !mbDel && mpWindow ) { // the window still exists but we were not removed - const_cast<vcl::Window*>(mpWindow.get())->ImplRemoveDel( this ); + mpWindow.get()->ImplRemoveDel( this ); mpWindow = NULL; } } diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index c19acc0535f6..e7626e347f82 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -697,7 +697,7 @@ void ImpGraphic::ImplSetPrefSize( const Size& rPrefSize ) if(maSvgData.get() && maEx.IsEmpty()) { // use maEx as local buffer for rendered svg - const_cast< ImpGraphic* >(this)->maEx = maSvgData->getReplacement(); + maEx = maSvgData->getReplacement(); } // #108077# Push through pref size to animation object, diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx index 4aaa69fabcd8..c7a30e9852a0 100644 --- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx @@ -47,7 +47,7 @@ OUString SalGtkPicker::uritounicode(const gchar* pIn) if (!pIn) return OUString(); - OUString sURL( const_cast<const sal_Char *>(pIn), strlen(pIn), + OUString sURL( pIn, strlen(pIn), RTL_TEXTENCODING_UTF8 ); INetURLObject aURL(sURL); |