summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-06 18:30:29 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:17:34 -0500
commit521b0631be55e952ccbfa19f77646a4720324aea (patch)
treee09e4ecfda2d1d08f0333895a41765717277f413
parent46ee2cf56b343881fb80fe58ecfe5601088996c0 (diff)
Improved loplugin:redundantcast, static_cast on arithmetic types: vcl
Change-Id: I5c85d3df578d0b7e9ffc54679b73a0ce35de8620 (cherry picked from commit e2a218114de3fd74848323238188c847a733d9b3) (cherry picked from commit d0f734ca4f37b97dced4f2ebc13c86a45e17afa5)
-rw-r--r--vcl/source/control/imp_listbox.cxx2
-rw-r--r--vcl/source/gdi/dibtools.cxx6
-rw-r--r--vcl/source/gdi/impgraph.cxx4
-rw-r--r--vcl/workben/vcldemo.cxx4
4 files changed, 8 insertions, 8 deletions
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 608b9faf5cb7..5031cdf790b7 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -1801,7 +1801,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32
OUString aStr(mpEntryList->GetEntryText(nPos));
if (!aStr.isEmpty())
{
- long nMaxWidth = std::max(static_cast< long >(mnMaxWidth), GetOutputSizePixel().Width() - 2 * mnBorder);
+ long nMaxWidth = std::max(mnMaxWidth, GetOutputSizePixel().Width() - 2 * mnBorder);
// a multiline entry should only be as wide a the window
if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine))
nMaxWidth = GetOutputSizePixel().Width() - 2 * mnBorder;
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 691ea1a03e4e..9d0fadb741bf 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -503,7 +503,7 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
{
// we can't trust arbitrary-sourced index based formats to have correct indexes, so we exclude the pal formats
// from raw read and force checking their colormap indexes
- bNative = ( ( static_cast< bool >(rAcc.IsBottomUp()) != bTopDown ) && !bRLE && !bTCMask && ( rAcc.GetScanlineSize() == nAlignedWidth ) );
+ bNative = ( ( rAcc.IsBottomUp() != bTopDown ) && !bRLE && !bTCMask && ( rAcc.GetScanlineSize() == nAlignedWidth ) );
break;
}
@@ -1232,7 +1232,7 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess*
// bitmaps is relatively recent.
// #i59239# discretize bitcount for aligned width to 1,4,8,24
// (other cases are not written below)
- const sal_uInt16 nBitCount(pAccAlpha ? 32 : discretizeBitcount(static_cast< sal_uInt16 >(rAcc.GetBitCount())));
+ const sal_uInt16 nBitCount(pAccAlpha ? 32 : discretizeBitcount(rAcc.GetBitCount()));
const sal_uLong nAlignedWidth(AlignedWidth4Bytes(rAcc.Width() * nBitCount));
bool bNative(false);
@@ -1418,7 +1418,7 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess&
// recent.
// #i59239# discretize bitcount to 1,4,8,24 (other cases
// are not written below)
- const sal_uInt16 nBitCount(pAccAlpha ? 32 : discretizeBitcount(static_cast< sal_uInt16 >(rAcc.GetBitCount())));
+ const sal_uInt16 nBitCount(pAccAlpha ? 32 : discretizeBitcount(rAcc.GetBitCount()));
aHeader.nBitCount = nBitCount;
aHeader.nSizeImage = rAcc.Height() * AlignedWidth4Bytes(rAcc.Width() * aHeader.nBitCount);
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 72b96fc397ff..b9daabe4f838 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -49,8 +49,8 @@
#define SYS_OS2METAFILE 0x00000005L
#define SYS_MACMETAFILE 0x00000006L
-#define GRAPHIC_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'G', 'R', 'F', '5' ))
-#define NATIVE_FORMAT_50 static_cast<sal_uInt32>(COMPAT_FORMAT( 'N', 'A', 'T', '5' ))
+#define GRAPHIC_FORMAT_50 COMPAT_FORMAT( 'G', 'R', 'F', '5' )
+#define NATIVE_FORMAT_50 COMPAT_FORMAT( 'N', 'A', 'T', '5' )
const sal_uInt32 nPdfMagic((sal_uInt32('p') << 24) | (sal_uInt32('d') << 16) | (sal_uInt32('f') << 8) | sal_uInt32('0'));
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 98e6b2da5b2e..6c190eeb9a86 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1660,7 +1660,7 @@ double DemoRenderer::getAndResetBenchmark(const RenderStyle style)
maRenderers[i]->sumTime = 0;
maRenderers[i]->countTime = 0;
}
- geomean = pow(geomean, static_cast<double>(1.0)/maRenderers.size());
+ geomean = pow(geomean, 1.0/maRenderers.size());
fprintf(stderr, "GEOMEAN_%s: %f\n", style == RENDER_THUMB ? "THUMB": "EXPANDED", geomean);
return geomean;
}
@@ -1810,7 +1810,7 @@ public:
double thumbGEOMEAN = mrRenderer.getAndResetBenchmark(RENDER_THUMB);
- fprintf(stderr, "GEOMEAN_TOTAL: %f\n", pow(thumbGEOMEAN * expandedGEOMEAN, static_cast<double>(0.5)));
+ fprintf(stderr, "GEOMEAN_TOTAL: %f\n", pow(thumbGEOMEAN * expandedGEOMEAN, 0.5));
Application::Quit();
}
};