[Libreoffice-commits] core.git: filter/source package/source scripting/source sc/source sw/source toolkit/source unotools/source vcl/source
Julien Nabet
serval2412 at yahoo.fr
Sun Jan 4 10:12:01 PST 2015
filter/source/config/cache/filtercache.cxx | 12 ++++++------
package/source/xstor/ohierarchyholder.cxx | 2 +-
sc/source/filter/excel/excimp8.cxx | 2 +-
scripting/source/provider/ProviderCache.cxx | 2 +-
scripting/source/stringresource/stringresource.cxx | 2 +-
scripting/source/vbaevents/eventhelper.cxx | 2 +-
sw/source/core/unocore/unocoll.cxx | 2 +-
sw/source/ui/vba/vbadocumentproperties.cxx | 2 +-
toolkit/source/controls/dialogcontrol.cxx | 2 +-
unotools/source/config/cmdoptions.cxx | 2 +-
vcl/source/gdi/pdfwriter_impl.cxx | 2 +-
11 files changed, 16 insertions(+), 16 deletions(-)
New commits:
commit 7da92fdcb040d1f82fc2a6c61fd05f76f7344035
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sun Jan 4 19:09:27 2015 +0100
cppcheck: Possible inefficient checking for <var> emptiness
Change-Id: I6ca0e477a4429e762c48c721951b9876db3a5c6c
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index a1c37c5..69d6027 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -172,13 +172,13 @@ void FilterCache::takeOver(const FilterCache& rClone)
// c4) clone_2 take over unchanged filters(!) and changed types(!)
// c5) c4 overwrites c3!
- if (rClone.m_lChangedTypes.size()>0)
+ if (!rClone.m_lChangedTypes.empty())
m_lTypes = rClone.m_lTypes;
- if (rClone.m_lChangedFilters.size()>0)
+ if (!rClone.m_lChangedFilters.empty())
m_lFilters = rClone.m_lFilters;
- if (rClone.m_lChangedFrameLoaders.size()>0)
+ if (!rClone.m_lChangedFrameLoaders.empty())
m_lFrameLoaders = rClone.m_lFrameLoaders;
- if (rClone.m_lChangedContentHandlers.size()>0)
+ if (!rClone.m_lChangedContentHandlers.empty())
m_lContentHandlers = rClone.m_lContentHandlers;
m_lChangedTypes.clear();
@@ -1009,11 +1009,11 @@ void FilterCache::impl_validateAndOptimize()
if (
(
(bSomeTypesShouldExist) &&
- (m_lTypes.size() < 1 )
+ (m_lTypes.empty())
) ||
(
(bAllFiltersShouldExist) &&
- (m_lFilters.size() < 1 )
+ (m_lFilters.empty())
)
)
{
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 2478437..fd2b39f 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -235,7 +235,7 @@ void OHierarchyElement_Impl::TestForClosing()
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( !m_aOpenStreams.size() && !m_aChildren.size() )
+ if ( m_aOpenStreams.empty() && m_aChildren.empty() )
{
if ( m_rParent.is() )
{
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index c1d342e..ae83bca 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -126,7 +126,7 @@ public:
virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
- return ( IdToOleNameHash.size() > 0 );
+ return ( !IdToOleNameHash.empty() );
}
// XNameAcess
virtual uno::Any SAL_CALL getByName( const OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index b094e2e..d02550e 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -93,7 +93,7 @@ ProviderCache::getAllProviders() throw ( RuntimeException )
ProviderDetails_hash::iterator h_itEnd = m_hProviderDetailsCache.end();
ProviderDetails_hash::iterator h_it = m_hProviderDetailsCache.begin();
// should assert if size !> 0
- if ( m_hProviderDetailsCache.size() )
+ if ( !m_hProviderDetailsCache.empty() )
{
sal_Int32 providerIndex = 0;
sal_Int32 index = 0;
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 667a900..3a693d2 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -2202,7 +2202,7 @@ bool StringResourcePersistenceImpl::implWritePropertiesFile( LocaleItem* pLocale
xTextOutputStream->writeString( aLineFeedStr );
const IdToStringMap& rHashMap = pLocaleItem->m_aIdToStringMap;
- if( rHashMap.size() > 0 )
+ if( !rHashMap.empty() )
{
// Sort ids according to read order
const IdToIndexMap& rIndexMap = pLocaleItem->m_aIdToIndexMap;
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 5ab80df..a9e970d 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -495,7 +495,7 @@ public:
virtual Type SAL_CALL getElementType( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
{ return cppu::UnoType<OUString>::get(); }
virtual sal_Bool SAL_CALL hasElements( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
- { return ( ( m_hEvents.size() > 0 ? sal_True : sal_False ) ); }
+ { return ( ( m_hEvents.empty() ? sal_False : sal_True ) ); }
private:
typedef std::unordered_map< OUString, Any, OUStringHash,
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index d4fe261..2a0f65c 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -234,7 +234,7 @@ public:
virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE
{
- return ( mTemplateToProject.size() > 0 );
+ return ( !mTemplateToProject.empty() );
}
};
diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx
index 701ea4d..2a90438 100644
--- a/sw/source/ui/vba/vbadocumentproperties.cxx
+++ b/sw/source/ui/vba/vbadocumentproperties.cxx
@@ -727,7 +727,7 @@ protected:
}
virtual sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
- return mDocProps.size() > 0;
+ return !mDocProps.empty();
}
virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
{
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 5d84922..af8f6d5 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -140,7 +140,7 @@ public:
virtual sal_Bool SAL_CALL hasElements( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
- return ( things.size() > 0 );
+ return ( !things.empty() );
}
};
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx
index d343e9f..59b7f19 100644
--- a/unotools/source/config/cmdoptions.cxx
+++ b/unotools/source/config/cmdoptions.cxx
@@ -61,7 +61,7 @@ class SvtCmdOptions
bool HasEntries() const
{
- return ( m_aCommandHashMap.size() > 0 );
+ return ( !m_aCommandHashMap.empty() );
}
bool Lookup( const OUString& aCmd ) const
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 0193177..5e1f8c2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5187,7 +5187,7 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
break;
}
- if( rWidget.m_aAppearances.size() )
+ if( !rWidget.m_aAppearances.empty() )
{
rAnnotDict.append( "/AP<<\n" );
for( PDFAppearanceMap::iterator dict_it = rWidget.m_aAppearances.begin(); dict_it != rWidget.m_aAppearances.end(); ++dict_it )
More information about the Libreoffice-commits
mailing list