summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-05-29 12:05:03 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-02-05 23:03:50 -0500
commit4c98d6f84fbc85086c41d87b83f2399df6435395 (patch)
treef6b764fd72ef11e7ccd03515a940600ab13097f3 /vcl
parent6708e59deea3839d058b89f0ec3c0ccf97d72000 (diff)
loplugin:redundantcast: const_cast to same type
Change-Id: I610fd4cf9339fd5c18eb77e7c94ffd0f99e9b125 (cherry picked from commit 696f96f34b9e4cc384ecb3481b018301f493fc23)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/glyphs/glyphcache.cxx8
-rw-r--r--vcl/source/app/svapp.cxx2
-rw-r--r--vcl/source/gdi/impgraph.cxx2
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkPicker.cxx2
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 c261a37895ae..97621a5b1c87 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1669,7 +1669,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 feafc3f01dee..72abc23f84f2 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 5f715ad7d2c5..8d7661177132 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -49,7 +49,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);