summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-09-06 15:39:01 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-09-07 06:49:12 +0000
commit673b436c3592c5747f3dce4947168d6fa3ba45ea (patch)
treee5711bd1da76e9a554954f7275784fca4429c29f /vcl
parent702496391b2b9ef53f83752b34feb3c33d7fb4e9 (diff)
loplugin:constantparam in vcl
Change-Id: I0cae8e5de1170dec4c82df7f1f5377143a079876 Reviewed-on: https://gerrit.libreoffice.org/28686 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/BitmapTest.cxx4
-rw-r--r--vcl/source/control/field.cxx4
-rw-r--r--vcl/source/filter/graphicfilter.cxx6
-rw-r--r--vcl/source/font/fontcharmap.cxx7
-rw-r--r--vcl/source/gdi/bitmap3.cxx8
-rw-r--r--vcl/source/gdi/bitmapex.cxx4
-rw-r--r--vcl/source/gdi/impvect.cxx24
-rw-r--r--vcl/source/gdi/impvect.hxx5
-rw-r--r--vcl/source/outdev/text.cxx2
-rw-r--r--vcl/source/window/layout.cxx9
10 files changed, 31 insertions, 42 deletions
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 6823cfb4e28d..35b31fdf7fb5 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -128,7 +128,7 @@ void BitmapTest::testScale()
{
SvFileStream aStream(OUString("~/scale_before.png"), StreamMode::WRITE | StreamMode::TRUNC);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
- rFilter.compressAsPNG(aBitmap24Bit, aStream, 9);
+ rFilter.compressAsPNG(aBitmap24Bit, aStream);
}
aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
@@ -144,7 +144,7 @@ void BitmapTest::testScale()
{
SvFileStream aStream(OUString("~/scale_after.png"), StreamMode::WRITE | StreamMode::TRUNC);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
- rFilter.compressAsPNG(aBitmap24Bit, aStream, 9);
+ rFilter.compressAsPNG(aBitmap24Bit, aStream);
}
}
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 96e1f3cebb2d..9ed2710ff3f6 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -366,9 +366,9 @@ void ImplUpdateSeparators( const OUString& rOldDecSep, const OUString& rNewDecSe
} // namespace
-FormatterBase::FormatterBase( Edit* pField )
+FormatterBase::FormatterBase()
{
- mpField = pField;
+ mpField = nullptr;
mpLocaleDataWrapper = nullptr;
mbReformat = false;
mbStrictFormat = false;
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 27fb8a20a23b..72c2dcbd167e 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -2291,13 +2291,11 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa
return nRes;
}
-sal_uInt16 GraphicFilter::compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream, sal_uInt32 nCompression)
+sal_uInt16 GraphicFilter::compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream)
{
- nCompression = MinMax(nCompression, 0, 100);
-
css::uno::Sequence< css::beans::PropertyValue > aFilterData(1);
aFilterData[0].Name = "Compression";
- aFilterData[0].Value <<= nCompression;
+ aFilterData[0].Value <<= (sal_uInt32) 9;
sal_uInt16 nFilterFormat = GetExportFormatNumberForShortName("PNG");
return ExportGraphic(rGraphic, OUString(), rOutputStream, nFilterFormat, &aFilterData);
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx
index c1055928641f..61e2323703b9 100644
--- a/vcl/source/font/fontcharmap.cxx
+++ b/vcl/source/font/fontcharmap.cxx
@@ -23,11 +23,10 @@
#include <set>
CmapResult::CmapResult( bool bSymbolic,
- const sal_UCS4* pRangeCodes, int nRangeCount,
- const int* pStartGlyphs, const sal_uInt16* pExtraGlyphIds )
+ const sal_UCS4* pRangeCodes, int nRangeCount )
: mpRangeCodes( pRangeCodes)
-, mpStartGlyphs( pStartGlyphs)
-, mpGlyphIds( pExtraGlyphIds)
+, mpStartGlyphs( nullptr)
+, mpGlyphIds( nullptr)
, mnRangeCount( nRangeCount)
, mbSymbolic( bSymbolic)
, mbRecoded( false)
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 98ede1450b47..32dd2ccee67a 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -2104,14 +2104,14 @@ void Bitmap::ImplMedianCut( sal_uLong* pColBuf, BitmapPalette& rPal,
}
}
-bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly, BmpVectorizeFlags nFlags )
+bool Bitmap::Vectorize( tools::PolyPolygon& rPolyPoly )
{
- return ImplVectorizer::ImplVectorize( *this, rPolyPoly, nFlags );
+ return ImplVectorizer::ImplVectorize( *this, rPolyPoly );
}
-bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress )
+bool Bitmap::Vectorize( GDIMetaFile& rMtf, sal_uInt8 cReduce, const Link<long,void>* pProgress )
{
- return ImplVectorizer::ImplVectorize( *this, rMtf, cReduce, nFlags, pProgress );
+ return ImplVectorizer::ImplVectorize( *this, rMtf, cReduce, pProgress );
}
bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 53b38e41da7f..4547cd377dab 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -476,13 +476,13 @@ bool BitmapEx::ReduceColors( sal_uInt16 nNewColorCount )
return !!aBitmap && aBitmap.ReduceColors( nNewColorCount, BMP_REDUCE_POPULAR );
}
-bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor, bool bExpandTransparent )
+bool BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent )
{
bool bRet = false;
if( !!aBitmap )
{
- bRet = aBitmap.Expand( nDX, nDY, pInitColor );
+ bRet = aBitmap.Expand( nDX, nDY );
if( bRet && ( eTransparent == TransparentType::Bitmap ) && !!aMask )
{
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index b33ef2744ab0..7f0559a43209 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -51,7 +51,7 @@ class ImplChain;
namespace ImplVectorizer
{
ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor );
- void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, BmpVectorizeFlags nFlags );
+ void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce );
bool ImplGetChain( ImplVectMap* pMap, const Point& rStartPt, ImplChain& rChain );
bool ImplIsUp( ImplVectMap* pMap, long nY, long nX );
void ImplLimitPolyPoly( tools::PolyPolygon& rPolyPoly );
@@ -632,7 +632,7 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr )
namespace ImplVectorizer {
bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress )
+ sal_uInt8 cReduce, const Link<long,void>* pProgress )
{
bool bRet = false;
@@ -688,15 +688,14 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
if( xMap )
{
aPolyPoly.Clear();
- ImplCalculate( xMap.get(), aPolyPoly, cReduce, nFlags );
+ ImplCalculate( xMap.get(), aPolyPoly, cReduce );
xMap.reset();
if( aPolyPoly.Count() )
{
ImplLimitPolyPoly( aPolyPoly );
- if( nFlags & BmpVectorizeFlags::ReduceEdges )
- aPolyPoly.Optimize( PolyOptimizeFlags::EDGES );
+ aPolyPoly.Optimize( PolyOptimizeFlags::EDGES );
if( aPolyPoly.Count() )
{
@@ -734,8 +733,7 @@ bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
}
bool ImplVectorize( const Bitmap& rMonoBmp,
- tools::PolyPolygon& rPolyPoly,
- BmpVectorizeFlags nFlags )
+ tools::PolyPolygon& rPolyPoly )
{
std::unique_ptr<Bitmap> xBmp(new Bitmap( rMonoBmp ));
BitmapReadAccess* pRAcc;
@@ -752,12 +750,11 @@ bool ImplVectorize( const Bitmap& rMonoBmp,
if( xMap )
{
rPolyPoly.Clear();
- ImplCalculate( xMap.get(), rPolyPoly, 0, nFlags );
+ ImplCalculate( xMap.get(), rPolyPoly, 0 );
xMap.reset();
ImplLimitPolyPoly( rPolyPoly );
- if( nFlags & BmpVectorizeFlags::ReduceEdges )
- rPolyPoly.Optimize( PolyOptimizeFlags::EDGES );
+ rPolyPoly.Optimize( PolyOptimizeFlags::EDGES );
// #i14895#:setting the correct direction for polygons
// that represent holes and non-holes; non-hole polygons
@@ -938,7 +935,7 @@ ImplVectMap* ImplExpand( BitmapReadAccess* pRAcc, const Color& rColor )
return pMap;
}
-void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce, BmpVectorizeFlags nFlags )
+void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8 cReduce )
{
const long nWidth = pMap->Width(), nHeight= pMap->Height();
@@ -966,10 +963,7 @@ void ImplCalculate( ImplVectMap* pMap, tools::PolyPolygon& rPolyPoly, sal_uInt8
aChain.ImplBeginAdd( aStartPt );
ImplGetChain( pMap, aStartPt, aChain );
- if( nFlags & BmpVectorizeFlags::Inner )
- aChain.ImplEndAdd( bInner ? VECT_POLY_INLINE_INNER : VECT_POLY_INLINE_OUTER );
- else
- aChain.ImplEndAdd( bInner ? VECT_POLY_OUTLINE_INNER : VECT_POLY_OUTLINE_OUTER );
+ aChain.ImplEndAdd( bInner ? VECT_POLY_OUTLINE_INNER : VECT_POLY_OUTLINE_OUTER );
const tools::Polygon& rPoly = aChain.ImplGetPoly();
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index 2a756887606d..3ed5b8eb1d97 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -27,9 +27,8 @@ namespace tools { class PolyPolygon; }
namespace ImplVectorizer
{
bool ImplVectorize( const Bitmap& rColorBmp, GDIMetaFile& rMtf,
- sal_uInt8 cReduce, BmpVectorizeFlags nFlags, const Link<long,void>* pProgress );
- bool ImplVectorize( const Bitmap& rMonoBmp, tools::PolyPolygon& rPolyPoly,
- BmpVectorizeFlags nFlags );
+ sal_uInt8 cReduce, const Link<long,void>* pProgress );
+ bool ImplVectorize( const Bitmap& rMonoBmp, tools::PolyPolygon& rPolyPoly );
};
#endif
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 8dfd44ddf2fe..6c8137328bda 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2782,7 +2782,7 @@ bool OutputDevice::GetTextOutlines( basegfx::B2DPolyPolygonVector& rVector,
Bitmap aBmp( aVDev->GetBitmap(Point(0, 0), aSize));
tools::PolyPolygon aPolyPoly;
- bool bVectorized = aBmp.Vectorize(aPolyPoly, BmpVectorizeFlags::Outer | BmpVectorizeFlags::ReduceEdges);
+ bool bVectorized = aBmp.Vectorize(aPolyPoly);
if( !bVectorized )
bSuccess = false;
else
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 56a2ac38cf0f..5324558a02d5 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1805,8 +1805,8 @@ IMPL_LINK_TYPED( VclExpander, ClickHdl, CheckBox&, rBtn, void )
maExpandedHdl.Call(*this);
}
-VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent, WinBits nStyle)
- : VclBin(pParent, nStyle)
+VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent)
+ : VclBin(pParent, WB_HIDE | WB_CLIPCHILDREN | WB_AUTOHSCROLL | WB_AUTOVSCROLL | WB_TABSTOP)
, m_bUserManagedScrolling(false)
, m_pVScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_VERT))
, m_pHScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_HORZ))
@@ -2179,9 +2179,8 @@ MessageDialog::MessageDialog(vcl::Window* pParent, WinBits nStyle)
MessageDialog::MessageDialog(vcl::Window* pParent,
const OUString &rMessage,
VclMessageType eMessageType,
- VclButtonsType eButtonsType,
- WinBits nStyle)
- : Dialog(pParent, nStyle)
+ VclButtonsType eButtonsType)
+ : Dialog(pParent, WB_MOVEABLE | WB_3DLOOK | WB_CLOSEABLE)
, m_eButtonsType(eButtonsType)
, m_eMessageType(eMessageType)
, m_pGrid(nullptr)