summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 21:20:18 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-05 19:24:57 +0200
commit2ed3d691b42525f6c1cc430d5863febcb102816e (patch)
tree97088acb96f8ad26f2ae67f3f8e5c2f6aab05cf0 /desktop
parent6c31c2b01dd32cc7ba1230f2c4a98b8f7def219b (diff)
Use hasElements to check Sequence emptiness in cppcanvas..desktop
Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx6
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_informationprovider.cxx2
-rw-r--r--desktop/source/deployment/misc/dp_update.cxx4
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx2
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--desktop/source/migration/migration.cxx2
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx2
-rw-r--r--desktop/source/splash/splash.cxx2
10 files changed, 14 insertions, 14 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index eaab2ff54e72..f2b54ffb7bab 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -752,7 +752,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker()
m_sLastFolderURL = xFilePicker->getDisplayDirectory();
uno::Sequence< OUString > files( xFilePicker->getSelectedFiles() );
- OSL_ASSERT( files.getLength() > 0 );
+ OSL_ASSERT( files.hasElements() );
return files;
}
@@ -928,7 +928,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleAddBtn, Button*, void)
uno::Sequence< OUString > aFileList = raiseAddPicker();
- if ( aFileList.getLength() )
+ if ( aFileList.hasElements() )
{
m_pManager->installPackage( aFileList[0] );
}
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index cfcf3e300106..f0e4c5115714 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -425,7 +425,7 @@ void UpdateDialog::Thread::prepareUpdateData(
out_du.name = getUpdateDisplayString(out_data, infoset.getVersion());
- if (out_du.unsatisfiedDependencies.getLength() == 0)
+ if (!out_du.unsatisfiedDependencies.hasElements())
{
out_data.aUpdateInfo = updateInfo;
out_data.updateVersion = infoset.getVersion();
@@ -439,7 +439,7 @@ bool UpdateDialog::Thread::update(
dp_gui::UpdateData const & data) const
{
bool ret = false;
- if (du.unsatisfiedDependencies.getLength() == 0)
+ if (!du.unsatisfiedDependencies.hasElements())
{
SolarMutexGuard g;
if (!m_stop) {
@@ -933,7 +933,7 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void)
break;
UpdateDialog::DisabledUpdate & data = m_disabledUpdates[ pos ];
- if (data.unsatisfiedDependencies.getLength() != 0)
+ if (data.unsatisfiedDependencies.hasElements())
{
// create error string for version mismatch
OUString sVersion( "%VERSION" );
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index 78ba7942833d..6240cf3566ec 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -355,7 +355,7 @@ void UpdateInstallDialog::Thread::downloadExtensions()
//remember occurring exceptions in case we need to print out error information
std::vector< std::pair<OUString, cssu::Exception> > vecExceptions;
cssu::Sequence<OUString> seqDownloadURLs = info.getUpdateDownloadUrls();
- OSL_ENSURE(seqDownloadURLs.getLength() > 0, "No download URL provided!");
+ OSL_ENSURE(seqDownloadURLs.hasElements(), "No download URL provided!");
for (sal_Int32 j = 0; j < seqDownloadURLs.getLength(); j++)
{
try
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx
index 93329cc07c29..caa1d2b7d8bb 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -203,7 +203,7 @@ PackageInformationProvider::isUpdateAvailable( const OUString& _sExtensionId )
dp_misc::DescriptionInfoset infoset(mxContext, info.info);
uno::Sequence< uno::Reference< xml::dom::XElement > >
ds( dp_misc::Dependencies::check( infoset ) );
- if ( ! ds.getLength() )
+ if ( ! ds.hasElements() )
sOnlineVersion = info.version;
}
diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx
index 05f1f0e6b991..38b37d1da873 100644
--- a/desktop/source/deployment/misc/dp_update.cxx
+++ b/desktop/source/deployment/misc/dp_update.cxx
@@ -93,7 +93,7 @@ void getOwnUpdateInfos(
{
OSL_ASSERT(inout.second.extension.is());
Sequence<OUString> urls(inout.second.extension->getUpdateInformationURLs());
- if (urls.getLength())
+ if (urls.hasElements())
{
const OUString search_id = dp_misc::getIdentifier(inout.second.extension);
SAL_INFO( "extensions.update", "Searching update for " << search_id );
@@ -307,7 +307,7 @@ Reference<deployment::XPackage>
getExtensionWithHighestVersion(
Sequence<Reference<deployment::XPackage> > const & seqExt)
{
- if (seqExt.getLength() == 0)
+ if (!seqExt.hasElements())
return Reference<deployment::XPackage>();
Reference<deployment::XPackage> greatest;
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index e5167eaf6631..6357eef886ef 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -603,7 +603,7 @@ bool BackendImpl::PackageImpl::checkDependencies(
css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > >
unsatisfied(dp_misc::Dependencies::check(description));
- if (unsatisfied.getLength() == 0) {
+ if (!unsatisfied.hasElements()) {
return true;
} else {
OUString msg(
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2a19ef820c1a..c1a24ce6c3e0 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4251,7 +4251,7 @@ static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindo
aArgs[1].Name == "Data" && (aArgs[1].Value >>= aData);
}
- if (!aMimeType.isEmpty() && aData.getLength() > 0)
+ if (!aMimeType.isEmpty() && aData.hasElements())
{
uno::Reference<datatransfer::XTransferable> xTransferable(new LOKTransferable(aMimeType, aData));
uno::Reference<datatransfer::clipboard::XClipboard> xClipboard(new LOKClipboard);
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 599db808cd41..1716a9f54325 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -876,7 +876,7 @@ std::vector< MigrationModuleInfo > MigrationImpl::dectectUIChangesForAllModules(
uno::Reference< embed::XStorage > xMenubar = xModule->openStorageElement(MENUBAR, embed::ElementModes::READ);
if (xMenubar.is()) {
uno::Reference< container::XNameAccess > xNameAccess(xMenubar, uno::UNO_QUERY);
- if (xNameAccess->getElementNames().getLength() > 0) {
+ if (xNameAccess->getElementNames().hasElements()) {
aModuleInfo.sModuleShortName = sModuleShortName;
aModuleInfo.bHasMenubar = true;
}
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 01f9c2e93355..ae46322a9092 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -323,7 +323,7 @@ void OO3ExtensionMigration::initialize( const Sequence< Any >& aArguments )
else if ( aValue.Name == "ExtensionBlackList" )
{
Sequence< OUString > aBlackList;
- if ( (aValue.Value >>= aBlackList ) && ( aBlackList.getLength() > 0 ))
+ if ( (aValue.Value >>= aBlackList ) && aBlackList.hasElements())
{
m_aBlackList.resize( aBlackList.getLength() );
::comphelper::sequenceToArray< OUString >( m_aBlackList.data(), aBlackList );
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 64af4ce7fd6a..1076e739a1c0 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -251,7 +251,7 @@ void SAL_CALL
SplashScreen::initialize( const css::uno::Sequence< css::uno::Any>& aArguments )
{
osl::MutexGuard aGuard( _aMutex );
- if (aArguments.getLength() > 0)
+ if (aArguments.hasElements())
{
aArguments[0] >>= _bVisible;
if (aArguments.getLength() > 1 )