summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 08:12:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 10:02:39 +0200
commit2c1b7e8d6a7fa22cb91919238418816671c3a497 (patch)
tree6f356017d24dffcd25261295ab25a21b738dc835 /desktop
parentTurn ScGridWin::AutoFilterMode into scoped enum (diff)
downloadcore-2c1b7e8d6a7fa22cb91919238418816671c3a497.tar.gz
core-2c1b7e8d6a7fa22cb91919238418816671c3a497.zip
clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx18
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx2
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx2
4 files changed, 12 insertions, 12 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 1d41456adda8..69f2b3ac2bfb 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -290,16 +290,16 @@ void DesktopLOKTest::testGetStyles()
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:StyleApply");
std::stringstream aStream(pJSON);
boost::property_tree::read_json(aStream, aTree);
- CPPUNIT_ASSERT( aTree.size() > 0 );
+ CPPUNIT_ASSERT( !aTree.empty() );
CPPUNIT_ASSERT_EQUAL( std::string(".uno:StyleApply"), aTree.get_child("commandName").get_value<std::string>() );
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
- CPPUNIT_ASSERT( aValues.size() > 0 );
+ CPPUNIT_ASSERT( !aValues.empty() );
for (const auto& rPair : aValues)
{
if( rPair.first != "ClearStyle")
{
- CPPUNIT_ASSERT( rPair.second.size() > 0);
+ CPPUNIT_ASSERT( !rPair.second.empty());
}
if (rPair.first != "CharacterStyles" &&
rPair.first != "ParagraphStyles" &&
@@ -326,15 +326,15 @@ void DesktopLOKTest::testGetFonts()
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CharFontName");
std::stringstream aStream(pJSON);
boost::property_tree::read_json(aStream, aTree);
- CPPUNIT_ASSERT( aTree.size() > 0 );
+ CPPUNIT_ASSERT( !aTree.empty() );
CPPUNIT_ASSERT_EQUAL( std::string(".uno:CharFontName"), aTree.get_child("commandName").get_value<std::string>() );
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
- CPPUNIT_ASSERT( aValues.size() > 0 );
+ CPPUNIT_ASSERT( !aValues.empty() );
for (const auto& rPair : aValues)
{
// check that we have font sizes available for each font
- CPPUNIT_ASSERT( rPair.second.size() > 0);
+ CPPUNIT_ASSERT( !rPair.second.empty());
}
free(pJSON);
comphelper::LibreOfficeKit::setActive(false);
@@ -401,7 +401,7 @@ void DesktopLOKTest::testGetFilterTypes()
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
- CPPUNIT_ASSERT(aTree.size() > 0);
+ CPPUNIT_ASSERT(!aTree.empty());
CPPUNIT_ASSERT_EQUAL(std::string("application/vnd.oasis.opendocument.text"), aTree.get_child("writer8").get_child("MediaType").get_value<std::string>());
free(pJSON);
comphelper::LibreOfficeKit::setActive(false);
@@ -1930,10 +1930,10 @@ void DesktopLOKTest::testGetFontSubset()
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aCommand.getStr());
std::stringstream aStream(pJSON);
boost::property_tree::read_json(aStream, aTree);
- CPPUNIT_ASSERT( aTree.size() > 0 );
+ CPPUNIT_ASSERT( !aTree.empty() );
CPPUNIT_ASSERT_EQUAL( std::string(".uno:FontSubset"), aTree.get_child("commandName").get_value<std::string>() );
boost::property_tree::ptree aValues = aTree.get_child("commandValues");
- CPPUNIT_ASSERT( aValues.size() > 0 );
+ CPPUNIT_ASSERT( !aValues.empty() );
free(pJSON);
comphelper::LibreOfficeKit::setActive(false);
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index fb6ce8668582..f76a8df08a47 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1470,7 +1470,7 @@ void BackendImpl::PackageImpl::scanBundle(
// patch description:
std::vector<sal_Int8> bytes( readFile( descrFileContent ) );
OUStringBuffer buf;
- if ( bytes.size() )
+ if ( !bytes.empty() )
{
buf.append( OUString( reinterpret_cast<sal_Char const *>(
bytes.data() ),
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6dfa7cc28825..6f080c5e0316 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -340,7 +340,7 @@ std::vector<beans::PropertyValue> desktop::jsonToPropertyValuesVector(const char
else if (rType == "[]any")
{
aNodeValue = rPair.second.get_child("value", aNodeNull);
- if (aNodeValue != aNodeNull && aNodeValue.size() > 0)
+ if (aNodeValue != aNodeNull && !aNodeValue.empty())
{
sal_Int32 itSeq = 0;
uno::Sequence< uno::Any > aSeq(aNodeValue.size());
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 33a8af6f8e55..fea990384e9c 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -530,7 +530,7 @@ extern "C" int unopkg_main()
Reference<ui::dialogs::XAsynchronousExecutableDialog> xDialog(
deployment::ui::PackageManagerDialog::createAndInstall(
xComponentContext,
- cmdPackages.size() > 0 ? cmdPackages[0] : OUString() ));
+ !cmdPackages.empty() ? cmdPackages[0] : OUString() ));
osl::Condition dialogEnded;
dialogEnded.reset();