summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-04 11:57:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-05 06:40:10 +0000
commit3d6c84f2d9683b23c14fa5bf50ca4425cf4ceb04 (patch)
treebc18d71a94b1a9015d45155ad79179e61e6aa3c0 /vcl
parentcedbc4031f26ea13b188a4ecc5b90cc9646095fb (diff)
loplugin:constantparam
Change-Id: I1996319e5b664dff95f7a9b2346aea6092d333ec Reviewed-on: https://gerrit.libreoffice.org/36070 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/listbox.cxx6
-rw-r--r--vcl/source/filter/FilterConfigItem.cxx34
-rw-r--r--vcl/source/gdi/gdimtf.cxx3
-rw-r--r--vcl/source/image/ImageTree.cxx5
-rw-r--r--vcl/source/window/layout.cxx4
-rw-r--r--vcl/source/window/menu.cxx6
-rw-r--r--vcl/source/window/splitwin.cxx7
7 files changed, 31 insertions, 34 deletions
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index c05c63b8dea2..4e3d9dc454b1 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -1339,12 +1339,12 @@ void ListBox::UserDraw( const UserDrawEvent& )
{
}
-void ListBox::DrawEntry(const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawTextAtImagePos)
+void ListBox::DrawEntry(const UserDrawEvent& rEvt)
{
if (rEvt.GetWindow() == mpImplLB->GetMainWindow())
- mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), bDrawImage, true/*bDrawText*/, bDrawTextAtImagePos );
+ mpImplLB->GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), true/*bDrawImage*/, true/*bDrawText*/, false/*bDrawTextAtImagePos*/ );
else if (rEvt.GetWindow() == mpImplWin)
- mpImplWin->DrawEntry(*rEvt.GetRenderContext(), bDrawImage, bDrawTextAtImagePos);
+ mpImplWin->DrawEntry(*rEvt.GetRenderContext(), true/*bDrawImage*/, false/*bDrawTextAtImagePos*/);
}
void ListBox::EnableUserDraw( bool bUserDraw )
diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx
index fd66345dfb1f..fc8ed69d9bae 100644
--- a/vcl/source/filter/FilterConfigItem.cxx
+++ b/vcl/source/filter/FilterConfigItem.cxx
@@ -189,26 +189,22 @@ void FilterConfigItem::WriteModifiedConfig()
}
}
-bool FilterConfigItem::ImplGetPropertyValue( Any& rAny, const Reference< XPropertySet >& rXPropSet, const OUString& rString, bool bTestPropertyAvailability )
+bool FilterConfigItem::ImplGetPropertyValue( Any& rAny, const Reference< XPropertySet >& rXPropSet, const OUString& rString )
{
bool bRetValue = true;
if ( rXPropSet.is() )
{
- if ( bTestPropertyAvailability )
+ bRetValue = false;
+ try
+ {
+ Reference< XPropertySetInfo >
+ aXPropSetInfo( rXPropSet->getPropertySetInfo() );
+ if ( aXPropSetInfo.is() )
+ bRetValue = aXPropSetInfo->hasPropertyByName( rString );
+ }
+ catch( css::uno::Exception& )
{
- bRetValue = false;
- try
- {
- Reference< XPropertySetInfo >
- aXPropSetInfo( rXPropSet->getPropertySetInfo() );
- if ( aXPropSetInfo.is() )
- bRetValue = aXPropSetInfo->hasPropertyByName( rString );
- }
- catch( css::uno::Exception& )
- {
-
- }
}
if ( bRetValue )
{
@@ -281,7 +277,7 @@ bool FilterConfigItem::ReadBool( const OUString& rKey, bool bDefault )
{
pPropVal->Value >>= bRetValue;
}
- else if ( ImplGetPropertyValue( aAny, xPropSet, rKey, true ) )
+ else if ( ImplGetPropertyValue( aAny, xPropSet, rKey ) )
{
aAny >>= bRetValue;
}
@@ -301,7 +297,7 @@ sal_Int32 FilterConfigItem::ReadInt32( const OUString& rKey, sal_Int32 nDefault
{
pPropVal->Value >>= nRetValue;
}
- else if ( ImplGetPropertyValue( aAny, xPropSet, rKey, true ) )
+ else if ( ImplGetPropertyValue( aAny, xPropSet, rKey ) )
{
aAny >>= nRetValue;
}
@@ -321,7 +317,7 @@ OUString FilterConfigItem::ReadString( const OUString& rKey, const OUString& rDe
{
pPropVal->Value >>= aRetValue;
}
- else if ( ImplGetPropertyValue( aAny, xPropSet, rKey, true ) )
+ else if ( ImplGetPropertyValue( aAny, xPropSet, rKey ) )
{
aAny >>= aRetValue;
}
@@ -342,7 +338,7 @@ void FilterConfigItem::WriteBool( const OUString& rKey, bool bNewValue )
if ( xPropSet.is() )
{
Any aAny;
- if ( ImplGetPropertyValue( aAny, xPropSet, rKey, true ) )
+ if ( ImplGetPropertyValue( aAny, xPropSet, rKey ) )
{
bool bOldValue(true);
if ( aAny >>= bOldValue )
@@ -375,7 +371,7 @@ void FilterConfigItem::WriteInt32( const OUString& rKey, sal_Int32 nNewValue )
{
Any aAny;
- if ( ImplGetPropertyValue( aAny, xPropSet, rKey, true ) )
+ if ( ImplGetPropertyValue( aAny, xPropSet, rKey ) )
{
sal_Int32 nOldValue = 0;
if ( aAny >>= nOldValue )
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 3c673b91e7c5..e8d86b8b018e 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2811,7 +2811,7 @@ SvStream& GDIMetaFile::Write( SvStream& rOStm )
return rOStm;
}
-bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent, BmpConversion eColorConversion, BmpScaleFlag nScaleFlag) const
+bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConversion, BmpScaleFlag nScaleFlag) const
{
// initialization seems to be complicated but is used to avoid rounding errors
ScopedVclPtrInstance< VirtualDevice > aVDev;
@@ -2820,6 +2820,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, sal_uInt32 nMaximumExtent
const Point aBRPix( aVDev->LogicToPixel( Point( GetPrefSize().Width() - 1, GetPrefSize().Height() - 1 ), GetPrefMapMode() ) );
Size aDrawSize( aVDev->LogicToPixel( GetPrefSize(), GetPrefMapMode() ) );
Size aSizePix( labs( aBRPix.X() - aTLPix.X() ) + 1, labs( aBRPix.Y() - aTLPix.Y() ) + 1 );
+ sal_uInt32 nMaximumExtent = 256;
if (!rBitmapEx.IsEmpty())
rBitmapEx.SetEmpty();
diff --git a/vcl/source/image/ImageTree.cxx b/vcl/source/image/ImageTree.cxx
index 0c9dcac957a6..109a955922f3 100644
--- a/vcl/source/image/ImageTree.cxx
+++ b/vcl/source/image/ImageTree.cxx
@@ -37,10 +37,9 @@ bool ImageTree::loadImage(OUString const & rName, OUString const & rStyle,
return mpImplImageTree->loadImage(rName, rStyle, rBitmap, bLocalized, eFlags);
}
-bool ImageTree::loadDefaultImage(OUString const & rStyle, BitmapEx& rBitmap,
- const ImageLoadFlags eFlags)
+bool ImageTree::loadDefaultImage(OUString const & rStyle, BitmapEx& rBitmap)
{
- return mpImplImageTree->loadDefaultImage(rStyle, rBitmap, eFlags);
+ return mpImplImageTree->loadDefaultImage(rStyle, rBitmap, ImageLoadFlags::NONE);
}
css::uno::Reference<css::container::XNameAccess> ImageTree::getNameAccess()
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index d5a61d4e42f0..54cbb04dcb7b 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2527,8 +2527,8 @@ void MessageDialog::set_secondary_text(const OUString &rSecondaryString)
}
}
-VclVPaned::VclVPaned(vcl::Window *pParent, WinBits nStyle)
- : VclContainer(pParent, nStyle)
+VclVPaned::VclVPaned(vcl::Window *pParent)
+ : VclContainer(pParent, WB_HIDE | WB_CLIPCHILDREN)
, m_pSplitter(VclPtr<Splitter>::Create(this, WB_VSCROLL))
, m_nPosition(-1)
{
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 866c0f03ca6c..6f24bfb72229 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -195,7 +195,7 @@ void Menu::dispose()
mpLayoutData = nullptr;
// Native-support: destroy SalMenu
- ImplSetSalMenu( nullptr );
+ ImplClearSalMenu();
pStartedFrom.clear();
pWindow.clear();
@@ -2353,11 +2353,11 @@ OUString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
return OUString();
}
-void Menu::ImplSetSalMenu( SalMenu *pSalMenu )
+void Menu::ImplClearSalMenu()
{
if( mpSalMenu )
ImplGetSVData()->mpDefInst->DestroyMenu( mpSalMenu );
- mpSalMenu = pSalMenu;
+ mpSalMenu = nullptr;
}
bool Menu::GetSystemMenuData( SystemMenuData* pData ) const
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 883fa98c3c61..867a81529ec4 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1607,7 +1607,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos )
}
}
-void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, long nEx, bool bTest ) const
+void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const
{
long nSplitSize = mpMainSet->mnSplitSize-1;
if (mbFadeOut || mbFadeIn)
@@ -1623,6 +1623,7 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, long nEx, bool bTe
nCenterEx += ((mnDX-mnLeftBorder-mnRightBorder)-nButtonSize)/2;
else
nCenterEx += ((mnDY-mnTopBorder-mnBottomBorder)-nButtonSize)/2;
+ long nEx = 0;
if ( nCenterEx > 0 )
nEx += nCenterEx;
@@ -1680,7 +1681,7 @@ void SplitWindow::ImplGetFadeInRect( tools::Rectangle& rRect, bool bTest ) const
tools::Rectangle aRect;
if ( mbFadeIn )
- ImplGetButtonRect( aRect, 0, bTest );
+ ImplGetButtonRect( aRect, bTest );
rRect = aRect;
}
@@ -1690,7 +1691,7 @@ void SplitWindow::ImplGetFadeOutRect( tools::Rectangle& rRect, bool ) const
tools::Rectangle aRect;
if ( mbFadeOut )
- ImplGetButtonRect( aRect, 0, false );
+ ImplGetButtonRect( aRect, false );
rRect = aRect;
}