summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-27 14:05:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-28 08:54:42 +0200
commitef531e85d95fe18d553bce1a6926d24c08ffe2bf (patch)
treeb913745a48020c9b1cbaedfc95fdd216b95a98ae /toolkit
parent1eee0abd459a508a6dcf9e71cbf2c1be3725faa7 (diff)
loplugin:oncevar in test..tools
Change-Id: I7b3ccc8f227100ff7fedeaca96a12f135da60bab Reviewed-on: https://gerrit.libreoffice.org/39326 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxprinter.cxx3
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx16
-rw-r--r--toolkit/source/controls/roadmapentry.cxx3
-rw-r--r--toolkit/source/controls/unocontrolbase.cxx5
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx3
5 files changed, 8 insertions, 22 deletions
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index b2f3ac103bba..6fe73f2ab59c 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -280,14 +280,13 @@ sal_Bool VCLXPrinter::start( const OUString& /*rJobName*/, sal_Int16 /*nCopies*/
{
::osl::MutexGuard aGuard( Mutex );
- bool bDone = true;
if (mxPrinter.get())
{
maInitJobSetup = mxPrinter->GetJobSetup();
mxListener.reset(new vcl::OldStylePrintAdaptor(mxPrinter));
}
- return bDone;
+ return true;
}
void VCLXPrinter::end( )
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index b874493e233a..1589c8e3ff12 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1628,21 +1628,16 @@ void ControlContainerBase::ImplModelPropertiesChanged( const Sequence< PropertyC
{
if( !isDesignMode() && !mbCreatingCompatiblePeer )
{
- OUString s1( "PositionX" );
- OUString s2( "PositionY" );
- OUString s3( "Width" );
- OUString s4( "Height" );
-
sal_Int32 nLen = rEvents.getLength();
for( sal_Int32 i = 0; i < nLen; i++ )
{
const PropertyChangeEvent& rEvt = rEvents.getConstArray()[i];
Reference< XControlModel > xModel( rEvt.Source, UNO_QUERY );
bool bOwnModel = xModel.get() == getModel().get();
- if ( ( rEvt.PropertyName == s1 ) ||
- ( rEvt.PropertyName == s2 ) ||
- ( rEvt.PropertyName == s3 ) ||
- ( rEvt.PropertyName == s4 ) )
+ if ( ( rEvt.PropertyName == "PositionX" ) ||
+ ( rEvt.PropertyName == "PositionY" ) ||
+ ( rEvt.PropertyName == "Width" ) ||
+ ( rEvt.PropertyName == "Height" ) )
{
if ( bOwnModel )
{
@@ -1778,10 +1773,9 @@ void ControlContainerBase::ImplStartListingForResourceEvents()
void ControlContainerBase::ImplUpdateResourceResolver()
{
- OUString aPropName( PROPERTY_RESOURCERESOLVER );
Reference< resource::XStringResourceResolver > xStringResourceResolver;
- ImplGetPropertyValue( aPropName ) >>= xStringResourceResolver;
+ ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver;
if ( !xStringResourceResolver.is() )
return;
diff --git a/toolkit/source/controls/roadmapentry.cxx b/toolkit/source/controls/roadmapentry.cxx
index 3238b6e5d578..1efe5b39ee57 100644
--- a/toolkit/source/controls/roadmapentry.cxx
+++ b/toolkit/source/controls/roadmapentry.cxx
@@ -76,8 +76,7 @@ css::uno::Reference< css:: beans::XPropertySetInfo > SAL_CALL
OUString SAL_CALL ORoadmapEntry::getImplementationName( )
{
- OUString aStr("com.sun.star.comp.toolkit.RoadmapItem");
- return aStr;
+ return OUString("com.sun.star.comp.toolkit.RoadmapItem");
}
sal_Bool SAL_CALL ORoadmapEntry::supportsService( const OUString& ServiceName )
diff --git a/toolkit/source/controls/unocontrolbase.cxx b/toolkit/source/controls/unocontrolbase.cxx
index 6ad663687ccb..d5648869a69e 100644
--- a/toolkit/source/controls/unocontrolbase.cxx
+++ b/toolkit/source/controls/unocontrolbase.cxx
@@ -74,11 +74,6 @@ void UnoControlBase::ImplSetPropertyValues( const css::uno::Sequence< OUString >
if ( !bUpdateThis )
ImplLockPropertyChangeNotifications( aPropertyNames, false );
}
- else
- {
- int dummy = 0;
- (void)dummy;
- }
}
void UnoControlBase::ImplSetPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue, bool bUpdateThis )
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index e1b0a5a13eb6..68b8a960d12a 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -281,10 +281,9 @@ UnoControlHolderList::ControlIdentifier UnoControlHolderList::impl_getFreeIdenti
OUString UnoControlHolderList::impl_getFreeName_throw()
{
- OUString name( "control_" );
for ( ControlIdentifier candidateId = 0; candidateId < ::std::numeric_limits< ControlIdentifier >::max(); ++candidateId )
{
- OUString candidateName( name + OUString::number( candidateId ) );
+ OUString candidateName( "control_" + OUString::number( candidateId ) );
ControlMap::const_iterator loop = maControls.begin();
for ( ; loop != maControls.end(); ++loop )
{