Kaydet (Commit) 673b436c authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:constantparam in vcl

Change-Id: I0cae8e5de1170dec4c82df7f1f5377143a079876
Reviewed-on: https://gerrit.libreoffice.org/28686Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 70249639
......@@ -1590,9 +1590,9 @@ SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( vcl:
AbstractPasswordToOpenModifyDialog * AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog(
vcl::Window * pParent,
sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify )
sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify )
{
VclPtrInstance<PasswordToOpenModifyDialog> pDlg( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify );
VclPtrInstance<PasswordToOpenModifyDialog> pDlg( pParent, 0, nMaxPasswdLen, bIsPasswordToModify );
return new AbstractPasswordToOpenModifyDialog_Impl( pDlg );
}
......
......@@ -628,7 +628,7 @@ public:
virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId ) override;
virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override;
virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override;
virtual AbstractScreenshotAnnotationDlg* CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override;
};
......
......@@ -85,7 +85,7 @@ public:
virtual VclAbstractDialog* CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId ) = 0;
// creates instance of PasswordToOpenModifyDialog from cui
virtual AbstractPasswordToOpenModifyDialog* CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
virtual AbstractPasswordToOpenModifyDialog* CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0;
// creates instance of ScreenshotAnnotationDlg from cui
virtual AbstractScreenshotAnnotationDlg* CreateScreenshotAnnotationDlg(
......
......@@ -609,15 +609,10 @@ public:
@param rPolyPoly
The resulting PolyPolygon
@param nFlags
Whether the inline or the outline of the color areas should be
represented by the polygon
@return true, if the operation was completed successfully.
*/
bool Vectorize(
tools::PolyPolygon& rPolyPoly,
BmpVectorizeFlags nFlags );
tools::PolyPolygon& rPolyPoly );
/** Convert the bitmap to a meta file
......@@ -631,10 +626,6 @@ public:
@param cReduce
If non-null, minimal size of bound rects for individual polygons. Smaller ones are ignored.
@param nFlags
Whether the inline or the outline of the color areas should be
represented by the polygon
@param pProgress
A callback for showing the progress of the vectorization
......@@ -643,7 +634,6 @@ public:
bool Vectorize(
GDIMetaFile& rMtf,
sal_uInt8 cReduce,
BmpVectorizeFlags nFlags = BmpVectorizeFlags::Inner,
const Link<long,void>* pProgress = nullptr );
/** Change various global color characteristics
......
......@@ -144,9 +144,6 @@ public:
@param nDY
Number of scanlines to pad at the bottom border of the bitmap
@param pInitColor
Color to use for padded pixel
@param bExpandTransparent
Whether to expand the transparency color or not.
......@@ -156,7 +153,6 @@ public:
*/
bool Expand(
sal_uLong nDX, sal_uLong nDY,
const Color* pInitColor = nullptr,
bool bExpandTransparent = false );
/** Copy a rectangular area from another bitmap
......
......@@ -56,7 +56,7 @@ protected:
bool IsDefaultLocale() const { return mbDefaultLocale; }
public:
explicit FormatterBase( Edit* pField = nullptr );
explicit FormatterBase();
virtual ~FormatterBase();
const LocaleDataWrapper& GetLocaleDataWrapper() const;
......
......@@ -152,8 +152,7 @@ class VCL_PLUGIN_PUBLIC CmapResult
{
public:
explicit CmapResult( bool bSymbolic = false,
const sal_uInt32* pRangeCodes = nullptr, int nRangeCount = 0,
const int* pStartGlyphs = nullptr, const sal_uInt16* pGlyphIds = nullptr );
const sal_uInt32* pRangeCodes = nullptr, int nRangeCount = 0 );
const sal_uInt32* mpRangeCodes;
const int* mpStartGlyphs;
......
......@@ -315,7 +315,7 @@ public:
GraphicFilter* pFilter = nullptr,
sal_uInt16* pDeterminedFormat = nullptr );
sal_uInt16 compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream, sal_uInt32 nCompression);
sal_uInt16 compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream);
};
#endif // INCLUDED_VCL_GRAPHICFILTER_HXX
......
......@@ -203,8 +203,8 @@ enum VclButtonBoxStyle
class VCL_DLLPUBLIC VclButtonBox : public VclBox
{
public:
VclButtonBox(vcl::Window *pParent, int nSpacing)
: VclBox(pParent, false, nSpacing)
VclButtonBox(vcl::Window *pParent)
: VclBox(pParent, false, 0/*nSpacing*/)
, m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE)
{
}
......@@ -235,7 +235,7 @@ class VCL_DLLPUBLIC VclVButtonBox : public VclButtonBox
{
public:
VclVButtonBox(vcl::Window *pParent)
: VclButtonBox(pParent, 0)
: VclButtonBox(pParent)
{
m_bVerticalContainer = true;
}
......@@ -274,7 +274,7 @@ class VCL_DLLPUBLIC VclHButtonBox : public VclButtonBox
{
public:
VclHButtonBox(vcl::Window *pParent)
: VclButtonBox(pParent, 0)
: VclButtonBox(pParent)
{
m_bVerticalContainer = false;
}
......@@ -485,7 +485,7 @@ private:
class VCL_DLLPUBLIC VclScrolledWindow : public VclBin
{
public:
VclScrolledWindow(vcl::Window *pParent, WinBits nStyle = WB_HIDE | WB_CLIPCHILDREN | WB_AUTOHSCROLL | WB_AUTOVSCROLL | WB_TABSTOP );
VclScrolledWindow(vcl::Window *pParent );
virtual ~VclScrolledWindow() { disposeOnce(); }
virtual void dispose() override;
virtual vcl::Window *get_child() override;
......@@ -513,8 +513,8 @@ private:
class VCL_DLLPUBLIC VclViewport : public VclBin
{
public:
VclViewport(vcl::Window *pParent, WinBits nStyle = WB_HIDE | WB_CLIPCHILDREN)
: VclBin(pParent, nStyle)
VclViewport(vcl::Window *pParent)
: VclBin(pParent, WB_HIDE | WB_CLIPCHILDREN)
{
}
protected:
......@@ -664,8 +664,7 @@ public:
MessageDialog(vcl::Window* pParent,
const OUString &rMessage,
VclMessageType eMessageType = VclMessageType::Error,
VclButtonsType eButtonsType = VCL_BUTTONS_OK,
WinBits nStyle = WB_MOVEABLE | WB_3DLOOK | WB_CLOSEABLE);
VclButtonsType eButtonsType = VCL_BUTTONS_OK);
MessageDialog(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription);
virtual bool set_property(const OString &rKey, const OString &rValue) override;
virtual short Execute() override;
......
......@@ -159,7 +159,7 @@ void SdVectorizeDlg::Calculate( Bitmap& rBmp, GDIMetaFile& rMtf )
if( !!aTmp )
{
const Link<long,void> aPrgsHdl( LINK( this, SdVectorizeDlg, ProgressHdl ) );
aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), BmpVectorizeFlags::Outer | BmpVectorizeFlags::ReduceEdges, &aPrgsHdl );
aTmp.Vectorize( rMtf, (sal_uInt8) m_pMtReduce->GetValue(), &aPrgsHdl );
if( m_pCbFillHoles->IsChecked() )
{
......
......@@ -342,7 +342,7 @@ BitmapEx ChangePlaceholderTag::createOverlayImage( int nHighlight )
const Rectangle aRectSrc( Point( 0, 0 ), aSize );
aRet = *(getButtonImage((nHighlight == 0) ? 4 : 0, bLarge));
aRet.Expand( aSize.Width(), aSize.Height(), nullptr, true );
aRet.Expand( aSize.Width(), aSize.Height(), true );
aRet.CopyPixel( Rectangle( Point( aSize.Width(), 0 ), aSize ), aRectSrc, getButtonImage((nHighlight == 1) ? 5 : 1, bLarge) );
aRet.CopyPixel( Rectangle( Point( 0, aSize.Height() ), aSize ), aRectSrc, getButtonImage((nHighlight == 2) ? 6 : 2, bLarge) );
......
......@@ -198,7 +198,7 @@ bool GraphicHelper::getThumbnailFormatFromGDI_Impl(GDIMetaFile* pMetaFile, const
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
if (rFilter.compressAsPNG(aResultBitmap, *pStream.get(), 9) != GRFILTER_OK)
if (rFilter.compressAsPNG(aResultBitmap, *pStream.get()) != GRFILTER_OK)
return false;
pStream->Flush();
......
......@@ -242,12 +242,9 @@ sal_Int16 SvFilterOptionsDialog::execute()
}
if ( nFormat < nFilterCount )
{
FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), nullptr, meFieldUnit );
aFltCallDlgPara.aFilterData = maFilterDataSequence;
std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() ));
aFltCallDlgPara.pResMgr = pResMgr.get();
FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), pResMgr.get(), meFieldUnit );
aFltCallDlgPara.aFilterData = maFilterDataSequence;
aFltCallDlgPara.aFilterExt = aGraphicFilter.GetExportFormatShortName( nFormat );
bool bIsPixelFormat( aGraphicFilter.IsExportPixelFormat( nFormat ) );
if ( ScopedVclPtrInstance<ExportDialog>( aFltCallDlgPara, mxContext, mxSourceDocument, mbExportSelection, bIsPixelFormat )->Execute() == RET_OK )
......
......@@ -528,7 +528,7 @@ executePasswordDialog(
const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length
VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create();
AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify );
AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, nMaxPasswdLen, bIsPasswordToModify );
std::unique_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp );
rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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)
......
......@@ -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,
......
......@@ -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 )
{
......
......@@ -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();
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment