diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-11 11:22:46 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-11 11:59:18 +0200 |
commit | a3f3cead5d7fed99ea78c2a12b8671f18d156e23 (patch) | |
tree | b55d001bf5fa084c9df4b2d75595b061ecf14e53 /desktop | |
parent | 3f5a9ca46efc801f79cdc00a3583646936bec689 (diff) |
loplugin: unused return values in desktop
Change-Id: Iec7a150c6bdb3b25fe24d711e3e453e1d8a5d26e
Diffstat (limited to 'desktop')
14 files changed, 35 insertions, 59 deletions
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index 94a48c3ca0d1..010c0f55ec81 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -138,7 +138,7 @@ static OString decodeString( const sal_Char* pEncChars, int nLen) return aDecStr.makeStringAndClear(); } -bool PersistentMap::open() +void PersistentMap::open() { // open the existing file sal_uInt32 nOpenFlags = osl_File_OpenFlag_Read; @@ -152,9 +152,9 @@ bool PersistentMap::open() m_bToBeCreated &= (rcOpen == osl::File::E_NOENT) && !m_bIsOpen; if( !m_bIsOpen) - return m_bToBeCreated; + return; - return readAll(); + readAll(); } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 70c8eed7b26d..e25a28e8eeab 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -747,7 +747,7 @@ void ExtMgrDialog::setGetExtensionsURL( const OUString &rURL ) } -long ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage, +void ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage, bool bLicenseMissing ) { @@ -758,20 +758,19 @@ long ExtMgrDialog::addPackageToList( const uno::Reference< deployment::XPackage if (m_pBundledCbx->IsChecked() && (xPackage->getRepositoryName() == BUNDLED_PACKAGE_MANAGER) ) { - return m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); + m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); } else if (m_pSharedCbx->IsChecked() && (xPackage->getRepositoryName() == SHARED_PACKAGE_MANAGER) ) { - return m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); + m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); } else if (m_pUserCbx->IsChecked() && (xPackage->getRepositoryName() == USER_PACKAGE_MANAGER )) { - return m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); + m_pExtensionBox->addEntry( xPackage, bLicenseMissing ); } else { //OSL_FAIL("Package will not be displayed"); - return 0; } } @@ -1221,7 +1220,7 @@ void UpdateRequiredDialog::dispose() ModalDialog::dispose(); } -long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage, +void UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage, bool bLicenseMissing ) { // We will only add entries to the list with unsatisfied dependencies @@ -1230,9 +1229,8 @@ long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::X m_bHasLockedEntries |= m_pManager->isReadOnly( xPackage ); const SolarMutexGuard aGuard; m_pUpdateBtn->Enable(); - return m_pExtensionBox->addEntry( xPackage ); + m_pExtensionBox->addEntry( xPackage ); } - return 0; } @@ -1255,12 +1253,10 @@ void UpdateRequiredDialog::checkEntries() } -bool UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage, +void UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage, bool bEnable ) { m_pManager->getCmdQueue()->enableExtension( xPackage, bEnable ); - - return true; } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index 55d0eceedc58..4fd00359de6e 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -77,7 +77,7 @@ public: virtual void updateProgress( const long nProgress ) = 0; virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) = 0; - virtual long addPackageToList( const css::uno::Reference< css::deployment::XPackage > &xPackage, + virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &xPackage, bool bLicenseMissing = false ) = 0; virtual void prepareChecking() = 0; @@ -156,7 +156,7 @@ public: virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) override; void setGetExtensionsURL( const OUString &rURL ); - virtual long addPackageToList( const css::uno::Reference< css::deployment::XPackage > &, + virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &, bool bLicenseMissing = false ) override; bool enablePackage(const css::uno::Reference< css::deployment::XPackage > &xPackage, bool bEnable ); @@ -224,9 +224,9 @@ public: virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) override; - virtual long addPackageToList( const css::uno::Reference< css::deployment::XPackage > &, + virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &, bool bLicenseMissing = false ) override; - bool enablePackage( const css::uno::Reference< css::deployment::XPackage > &xPackage, bool bEnable ); + void enablePackage( const css::uno::Reference< css::deployment::XPackage > &xPackage, bool bEnable ); virtual void prepareChecking() override; virtual void checkEntries() override; diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 99bbeaed6b04..e739a3833cc4 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -189,7 +189,7 @@ bool TheExtensionManager::isVisible() } -bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bParentVisible*/ ) +void TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bParentVisible*/ ) { std::vector< uno::Reference< deployment::XPackage > > vEntries; uno::Sequence< uno::Sequence< uno::Reference< deployment::XPackage > > > xAllPackages; @@ -198,11 +198,11 @@ bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bPare xAllPackages = m_xExtensionManager->getAllExtensions( uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment >() ); } catch ( const deployment::DeploymentException & ) { - return false; + return; } catch ( const ucb::CommandFailedException & ) { - return false; + return; } catch ( const ucb::CommandAbortedException & ) { - return false; + return; } catch ( const lang::IllegalArgumentException & e ) { throw uno::RuntimeException( e.Message, e.Context ); } @@ -218,7 +218,6 @@ bool TheExtensionManager::checkUpdates( bool /* bShowUpdateOnly */, bool /*bPare } m_pExecuteCmdQueue->checkForUpdates( vEntries ); - return true; } diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx index c68987f74663..263fe20cab57 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx @@ -90,7 +90,7 @@ public: bool isVisible(); - bool checkUpdates( bool showUpdateOnly, bool parentVisible ); + void checkUpdates( bool showUpdateOnly, bool parentVisible ); bool installPackage( const OUString &rPackageURL, bool bWarnUser = false ); void createPackageList(); diff --git a/desktop/source/deployment/inc/dp_persmap.h b/desktop/source/deployment/inc/dp_persmap.h index 4f97994c8275..c18b2c827b15 100644 --- a/desktop/source/deployment/inc/dp_persmap.h +++ b/desktop/source/deployment/inc/dp_persmap.h @@ -54,7 +54,7 @@ public: bool erase( OString const & key, bool flush_immediately = true ); protected: - bool open(); + void open(); bool readAll(); void add( OString const & key, OString const & value ); void flush(); diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index b591ec3571cf..b52b0df77a70 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -310,9 +310,9 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend OUString const & id, Reference<XInterface> const & xObject ); void releaseObject( OUString const & id ); - bool addToUnoRc( RcItem kind, OUString const & url, + void addToUnoRc( RcItem kind, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); - bool removeFromUnoRc( RcItem kind, OUString const & url, + void removeFromUnoRc( RcItem kind, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); bool hasInUnoRc( RcItem kind, OUString const & url ); @@ -992,7 +992,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) } -bool BackendImpl::addToUnoRc( RcItem kind, OUString const & url_, +void BackendImpl::addToUnoRc( RcItem kind, OUString const & url_, Reference<XCommandEnvironment> const & xCmdEnv ) { const OUString rcterm( dp_misc::makeRcTerm(url_) ); @@ -1004,14 +1004,11 @@ bool BackendImpl::addToUnoRc( RcItem kind, OUString const & url_, // write immediately: m_unorc_modified = true; unorc_flush( xCmdEnv ); - return true; } - else - return false; } -bool BackendImpl::removeFromUnoRc( +void BackendImpl::removeFromUnoRc( RcItem kind, OUString const & url_, Reference<XCommandEnvironment> const & xCmdEnv ) { @@ -1022,7 +1019,6 @@ bool BackendImpl::removeFromUnoRc( // write immediately: m_unorc_modified = true; unorc_flush( xCmdEnv ); - return true; } diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 3df952adba7a..4dc4f8da904b 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -131,7 +131,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend value from the backend db. This entry already contains the path as it is used in the configmgr.ini. */ - bool addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url, + void addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); bool removeFromConfigmgrIni( bool isSchema, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); @@ -471,7 +471,7 @@ void BackendImpl::configmgrini_flush( } -bool BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url_, +void BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & url_, Reference<XCommandEnvironment> const & xCmdEnv ) { const OUString rcterm( isURL ? dp_misc::makeRcTerm(url_) : url_ ); @@ -483,10 +483,7 @@ bool BackendImpl::addToConfigmgrIni( bool isSchema, bool isURL, OUString const & // write immediately: m_configmgrini_modified = true; configmgrini_flush( xCmdEnv ); - return true; } - else - return false; } diff --git a/desktop/source/migration/services/basicmigration.cxx b/desktop/source/migration/services/basicmigration.cxx index 457b479fb0a5..26b0ca391f34 100644 --- a/desktop/source/migration/services/basicmigration.cxx +++ b/desktop/source/migration/services/basicmigration.cxx @@ -106,7 +106,7 @@ namespace migration - ::osl::FileBase::RC BasicMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) + void BasicMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) { ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); if ( aResult == ::osl::FileBase::E_NOENT ) @@ -114,11 +114,7 @@ namespace migration INetURLObject aBaseURL( rDirURL ); aBaseURL.removeSegment(); checkAndCreateDirectory( aBaseURL ); - return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - } - else - { - return aResult; + ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); } } diff --git a/desktop/source/migration/services/basicmigration.hxx b/desktop/source/migration/services/basicmigration.hxx index 7b2657cde030..02600c1d95f7 100644 --- a/desktop/source/migration/services/basicmigration.hxx +++ b/desktop/source/migration/services/basicmigration.hxx @@ -60,7 +60,7 @@ namespace migration OUString m_sSourceDir; TStringVectorPtr getFiles( const OUString& rBaseURL ) const; - ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL ); + void checkAndCreateDirectory( INetURLObject& rDirURL ); void copyFiles(); public: diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index f2c162052c29..e1e0f3880a17 100644 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -80,7 +80,7 @@ OO3ExtensionMigration::~OO3ExtensionMigration() { } -::osl::FileBase::RC OO3ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) +void OO3ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) { ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); if ( aResult == ::osl::FileBase::E_NOENT ) @@ -88,11 +88,7 @@ OO3ExtensionMigration::~OO3ExtensionMigration() INetURLObject aBaseURL( rDirURL ); aBaseURL.removeSegment(); checkAndCreateDirectory( aBaseURL ); - return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - } - else - { - return aResult; + ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); } } diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx index 79aebdd94a3d..b049c166da7c 100644 --- a/desktop/source/migration/services/oo3extensionmigration.hxx +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -79,7 +79,7 @@ namespace migration SCANRESULT_DONTMIGRATE_EXTENSION }; - ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL ); + void checkAndCreateDirectory( INetURLObject& rDirURL ); ScanResult scanExtensionFolder( const OUString& sExtFolder ); void scanUserExtensions( const OUString& sSourceDir, TStringVector& aMigrateExtensions ); bool scanDescriptionXml( const OUString& sDescriptionXmlFilePath ); diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index b289ee5f549a..621b65ebf752 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -106,7 +106,7 @@ namespace migration - ::osl::FileBase::RC WordbookMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) + void WordbookMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) { ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); if ( aResult == ::osl::FileBase::E_NOENT ) @@ -114,11 +114,7 @@ namespace migration INetURLObject aBaseURL( rDirURL ); aBaseURL.removeSegment(); checkAndCreateDirectory( aBaseURL ); - return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - } - else - { - return aResult; + ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); } } diff --git a/desktop/source/migration/services/wordbookmigration.hxx b/desktop/source/migration/services/wordbookmigration.hxx index 8982c76b2e19..49c997c9c3d1 100644 --- a/desktop/source/migration/services/wordbookmigration.hxx +++ b/desktop/source/migration/services/wordbookmigration.hxx @@ -60,7 +60,7 @@ namespace migration OUString m_sSourceDir; TStringVectorPtr getFiles( const OUString& rBaseURL ) const; - ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL ); + void checkAndCreateDirectory( INetURLObject& rDirURL ); void copyFiles(); public: |