summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-16 08:49:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-16 08:42:37 +0000
commitf0f973da8560e16cba85d2c9465c3a8c4c0ebbb3 (patch)
tree0b6d78c3b16acc698dee15d83422a924be71097f /vcl/source/gdi
parent6eb91bdf75fe0085584efa6abf955c14c7acb9fd (diff)
loplugin:constantparams in vcl/
also some improvements to the plugin Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871 Reviewed-on: https://gerrit.libreoffice.org/23289 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/animate.cxx6
-rw-r--r--vcl/source/gdi/gfxlink.cxx17
-rw-r--r--vcl/source/gdi/metaact.cxx4
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter.cxx4
-rw-r--r--vcl/source/gdi/print3.cxx10
-rw-r--r--vcl/source/gdi/salgdilayout.cxx4
7 files changed, 20 insertions, 29 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 6f1779e72f49..fd9260f5c9be 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -558,7 +558,7 @@ bool Animation::Convert( BmpConversion eConversion )
return bRet;
}
-bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
+bool Animation::ReduceColors( sal_uInt16 nNewColorCount )
{
DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" );
@@ -569,9 +569,9 @@ bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce )
bRet = true;
for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i )
- bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, eReduce );
+ bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, BMP_REDUCE_POPULAR );
- maBitmapEx.ReduceColors( nNewColorCount, eReduce );
+ maBitmapEx.ReduceColors( nNewColorCount, BMP_REDUCE_POPULAR );
}
else
bRet = false;
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 291fe59e34cb..fc2790dbfe4c 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -46,26 +46,17 @@ GfxLink::GfxLink( const GfxLink& rGfxLink ) :
ImplCopy( rGfxLink );
}
-GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType, bool bOwns ) :
+GfxLink::GfxLink( sal_uInt8* pBuf, sal_uInt32 nSize, GfxLinkType nType ) :
mpImpData( new ImpGfxLink )
{
- DBG_ASSERT( (pBuf != nullptr && nSize) || (!bOwns && nSize == 0),
+ DBG_ASSERT( pBuf != nullptr && nSize,
"GfxLink::GfxLink(): empty/NULL buffer given" );
meType = nType;
mnBufSize = nSize;
mpSwap = nullptr;
mnUserId = 0UL;
-
- if( bOwns )
- mpBuf = new ImpBuffer( pBuf );
- else if( nSize )
- {
- mpBuf = new ImpBuffer( nSize );
- memcpy( mpBuf->mpBuffer, pBuf, nSize );
- }
- else
- mpBuf = nullptr;
+ mpBuf = new ImpBuffer( pBuf );
}
GfxLink::~GfxLink()
@@ -295,7 +286,7 @@ SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink)
pBuf = new sal_uInt8[ nSize ];
rIStream.Read( pBuf, nSize );
- rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType, true );
+ rGfxLink = GfxLink( pBuf, nSize, (GfxLinkType) nType );
rGfxLink.SetUserId( nUserId );
if( bMapAndSizeValid )
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 0d05aa7de5e5..7bfa151fe3ec 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -3164,9 +3164,9 @@ void MetaRefPointAction::Read( SvStream& rIStm, ImplMetaReadData* )
ReadPair( rIStm, maRefPoint ).ReadCharAsBool( mbSet );
}
-MetaCommentAction::MetaCommentAction( sal_Int32 nValue ) :
+MetaCommentAction::MetaCommentAction() :
MetaAction ( MetaActionType::COMMENT ),
- mnValue ( nValue )
+ mnValue ( 0 )
{
ImplInitDynamicData( nullptr, 0UL );
}
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 96072615719c..fd1addf02c7f 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -615,14 +615,14 @@ void PDFExtOutDevData::PlayGlobalActions( PDFWriter& rWriter )
all actions will be played after the last page was recorded
*/
//--->i56629
-sal_Int32 PDFExtOutDevData::CreateNamedDest(const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType )
+sal_Int32 PDFExtOutDevData::CreateNamedDest(const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr )
{
mpGlobalSyncData->mActions.push_back( PDFExtOutDevDataSync::CreateNamedDest );
mpGlobalSyncData->mParaOUStrings.push_back( sDestName );
mpGlobalSyncData->mParaRects.push_back( rRect );
mpGlobalSyncData->mParaMapModes.push_back( mrOutDev.GetMapMode() );
mpGlobalSyncData->mParaInts.push_back( nPageNr == -1 ? mnPage : nPageNr );
- mpGlobalSyncData->mParaDestAreaTypes.push_back( eType );
+ mpGlobalSyncData->mParaDestAreaTypes.push_back( PDFWriter::XYZ );
return mpGlobalSyncData->mCurId++;
}
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 1a84a6358607..5bf4bb29623e 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -445,9 +445,9 @@ PDFOutputStream::~PDFOutputStream()
{
}
-void PDFWriter::AddStream( const OUString& rMimeType, PDFOutputStream* pStream, bool bCompress )
+void PDFWriter::AddStream( const OUString& rMimeType, PDFOutputStream* pStream )
{
- xImplementation->addStream( rMimeType, pStream, bCompress );
+ xImplementation->addStream( rMimeType, pStream, false/*bCompress*/ );
}
std::set< PDFWriter::ErrorCode > PDFWriter::GetErrors()
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 2f35a3bbc062..1633dab15045 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -202,7 +202,7 @@ public:
}
bool isFixedPageSize() const
{ return mbPapersizeFromSetup; }
- PrinterController::PageSize modifyJobSetup( const css::uno::Sequence< css::beans::PropertyValue >& i_rProps, bool bNoNUP );
+ PrinterController::PageSize modifyJobSetup( const css::uno::Sequence< css::beans::PropertyValue >& i_rProps );
void resetPaperToLastConfigured();
};
@@ -855,7 +855,7 @@ bool PrinterController::setupPrinter( vcl::Window* i_pParent )
return bRet;
}
-PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const css::uno::Sequence< css::beans::PropertyValue >& i_rProps, bool bNoNUP )
+PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( const css::uno::Sequence< css::beans::PropertyValue >& i_rProps )
{
PrinterController::PageSize aPageSize;
aPageSize.aSize = mxPrinter->GetPaperSize();
@@ -890,7 +890,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
if( aSetSize.Width && aSetSize.Height )
{
Size aSetPaperSize( aSetSize.Width, aSetSize.Height );
- Size aRealPaperSize( getRealPaperSize( aSetPaperSize, bNoNUP ) );
+ Size aRealPaperSize( getRealPaperSize( aSetPaperSize, true/*bNoNUP*/ ) );
if( aRealPaperSize != aCurSize )
aIsSize = aSetSize;
}
@@ -900,7 +900,7 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
aPageSize.aSize.Width() = aIsSize.Width;
aPageSize.aSize.Height() = aIsSize.Height;
- Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, bNoNUP ) );
+ Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, true/*bNoNUP*/ ) );
if( aRealPaperSize != aCurSize )
mxPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
@@ -990,7 +990,7 @@ PrinterController::PageSize PrinterController::getPageFile( int i_nUnfilteredPag
mpImplData->mxPrinter->SetMapMode( aMapMode );
// modify job setup if necessary
- PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm, true );
+ PrinterController::PageSize aPageSize = mpImplData->modifyJobSetup( aPageParm );
o_rMtf.SetPrefSize( aPageSize.aSize );
o_rMtf.SetPrefMapMode( aMapMode );
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 4ac52a1307e0..9c2d221193f3 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -498,14 +498,14 @@ bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradi
void SalGraphics::CopyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight,
- sal_uInt16 nFlags, const OutputDevice *pOutDev )
+ const OutputDevice *pOutDev )
{
if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
mirror( nDestX, nSrcWidth, pOutDev );
mirror( nSrcX, nSrcWidth, pOutDev );
}
- copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, nFlags );
+ copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, SAL_COPYAREA_WINDOWINVALIDATE );
}
void SalGraphics::CopyBits( const SalTwoRect& rPosAry,