diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-09 11:49:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-09 11:13:34 +0000 |
commit | a71d6a2a847828b737e5b6cc5eefe877613085b7 (patch) | |
tree | 2fe758330a61cab221715749973911acbc82aa88 /desktop | |
parent | 243977708ceaf877e520ef0bb393aa49040d65c9 (diff) |
loplugin:expandablemethods in dbaccess
Change-Id: I6087a3eff46926646ac1637615a0af30b38956a4
Reviewed-on: https://gerrit.libreoffice.org/30712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/app.hxx | 10 | ||||
-rw-r--r-- | desktop/inc/lib/init.hxx | 1 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 47 | ||||
-rw-r--r-- | desktop/source/app/appinit.cxx | 3 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 9 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.hxx | 1 | ||||
-rw-r--r-- | desktop/source/deployment/registry/help/dp_help.cxx | 25 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 7 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 11 | ||||
-rw-r--r-- | desktop/source/migration/migration_impl.hxx | 1 |
10 files changed, 26 insertions, 89 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index e4bc622a26ff..91dde49439ab 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -158,20 +158,12 @@ class Desktop : public Application /** for ui-testing provide a mechanism to pseudo-restart by closing the open frames and reopen the frame that appeared post initial startup */ - static void DoExecute(); - - /// does initializations which are necessary for the first run of the office - static void DoFirstRunInitializations(); + static void DoExecute(); static void ShowBackingComponent(Desktop * progress); - static bool SaveTasks(); - - static bool isUIOnSessionShutdownAllowed(); - // on-demand acceptors static void createAcceptor(const OUString& aDescription); - static void enableAcceptors(); static void destroyAcceptor(const OUString& aDescription); bool m_bCleanedExtensionCache; diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index e202344450ff..302f54de5391 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -53,7 +53,6 @@ namespace desktop { typedef std::vector<std::pair<int, std::string>> queue_type; private: - void flush(); void removeAll(const std::function<bool (const queue_type::value_type&)>& rTestFunc); queue_type m_queue; diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 53365f4e76a0..badeca5cc707 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1038,12 +1038,6 @@ void Desktop::HandleBootstrapErrors( } -bool Desktop::isUIOnSessionShutdownAllowed() -{ - return officecfg::Office::Recovery::SessionShutdown::DocumentStoreUIEnabled - ::get(); -} - namespace { bool crashReportInfoExists() @@ -1170,20 +1164,6 @@ bool impl_callRecoveryUI(bool bEmergencySave , } -/* - * Save all open documents so they will be reopened - * the next time the application is started - * - * returns sal_True if at least one document could be saved... - * - */ -bool Desktop::SaveTasks() -{ - return impl_callRecoveryUI( - true , // sal_True => force emergency save - false); -} - namespace { void restartOnMac(bool passArguments) { @@ -1292,7 +1272,14 @@ void Desktop::Exception(ExceptionCategory nCategory) ( Application::IsInExecute() ) // crashes during startup and shutdown should be ignored (they indicates a corrupt installation ...) ); if ( bAllowRecoveryAndSessionManagement ) - bRestart = SaveTasks(); + { + // Save all open documents so they will be reopened + // the next time the application is started + // returns true if at least one document could be saved... + bRestart = impl_callRecoveryUI( + true , // force emergency save + false); + } FlushConfiguration(); @@ -1974,12 +1961,6 @@ void Desktop::OverrideSystemSettings( AllSettings& rSettings ) } -IMPL_STATIC_LINK(Desktop, AsyncInitFirstRun, Timer *, /*unused*/, void) -{ - DoFirstRunInitializations(); -} - - class ExitTimer : public Timer { public: @@ -2030,12 +2011,6 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void) } } -// enable acceptors -IMPL_STATIC_LINK_NOARG(Desktop, EnableAcceptors_Impl, void*, void) -{ - enableAcceptors(); -} - void Desktop::OpenClients() { @@ -2159,8 +2134,9 @@ void Desktop::OpenClients() try { // specifies whether the UI-interaction on Session shutdown is allowed + bool bUIOnSessionShutdownAllowed = officecfg::Office::Recovery::SessionShutdown::DocumentStoreUIEnabled::get(); xSessionListener = SessionListener::createWithOnQuitFlag( - ::comphelper::getProcessComponentContext(), isUIOnSessionShutdownAllowed()); + ::comphelper::getProcessComponentContext(), bUIOnSessionShutdownAllowed); } catch(const css::uno::Exception& e) { @@ -2594,8 +2570,9 @@ void Desktop::CloseSplashScreen() } -void Desktop::DoFirstRunInitializations() +IMPL_STATIC_LINK(Desktop, AsyncInitFirstRun, Timer *, /*unused*/, void) { + // does initializations which are necessary for the first run of the office try { Reference< XJobExecutor > xExecutor = theJobExecutor::get( ::comphelper::getProcessComponentContext() ); diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 6e6f56b1da33..615b0d453e06 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -185,7 +185,8 @@ class enable } }; -void Desktop::enableAcceptors() +// enable acceptors +IMPL_STATIC_LINK_NOARG(Desktop, EnableAcceptors_Impl, void*, void) { if (!bAccept) { diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 4c6cd322a9ae..6afa3aea5923 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -1259,13 +1259,6 @@ void UpdateRequiredDialog::checkEntries() } -void UpdateRequiredDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage, - bool bEnable ) -{ - m_pManager->getCmdQueue()->enableExtension( xPackage, bEnable ); -} - - IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn, Button*, void) { if ( m_xAbortChannel.is() ) @@ -1553,7 +1546,7 @@ void UpdateRequiredDialog::disableAllEntries() for ( long nIndex = 0; nIndex < nCount; nIndex++ ) { TEntry_Impl pEntry = m_pExtensionBox->GetEntryData( nIndex ); - enablePackage( pEntry->m_xPackage, false ); + m_pManager->getCmdQueue()->enableExtension( pEntry->m_xPackage, false ); } setBusy( false ); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index fdd23d8255e8..db0ad303aec3 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -226,7 +226,6 @@ public: virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &, bool bLicenseMissing = false ) override; - 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/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 73e1b43e1dc7..84f52443811d 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -100,10 +100,8 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend void implCollectXhpFiles( const OUString& aDir, std::vector< OUString >& o_rXhpFileVector ); - void addDataToDb(OUString const & url, HelpBackendDb::Data const & data); ::boost::optional<HelpBackendDb::Data> readDataFromDb(OUString const & url); bool hasActiveEntry(OUString const & url); - void revokeEntryFromDb(OUString const & url); bool activateEntry(OUString const & url); Reference< ucb::XSimpleFileAccess3 > const & getFileAccess(); @@ -211,13 +209,6 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( static_cast<sal_Int16>(-1) ); } -void BackendImpl::addDataToDb( - OUString const & url, HelpBackendDb::Data const & data) -{ - if (m_backendDb.get()) - m_backendDb->addEntry(url, data); -} - ::boost::optional<HelpBackendDb::Data> BackendImpl::readDataFromDb( OUString const & url) { @@ -234,12 +225,6 @@ bool BackendImpl::hasActiveEntry(OUString const & url) return false; } -void BackendImpl::revokeEntryFromDb(OUString const & url) -{ - if (m_backendDb.get()) - m_backendDb->revokeEntry(url); -} - bool BackendImpl::activateEntry(OUString const & url) { if (m_backendDb.get()) @@ -561,14 +546,16 @@ void BackendImpl::implProcessHelp( (void) xCmdEnv; #endif } - //Writing the data entry replaces writing the flag file. If we got to this - //point the registration was successful. - addDataToDb(xPackage->getURL(), data); + // Writing the data entry replaces writing the flag file. If we got to this + // point the registration was successful. + if (m_backendDb.get()) + m_backendDb->addEntry(xPackage->getURL(), data); } } //if (doRegisterPackage) else { - revokeEntryFromDb(xPackage->getURL()); + if (m_backendDb.get()) + m_backendDb->revokeEntry(xPackage->getURL()); } } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f3592c8c66ac..ddbcc3ced57a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -576,11 +576,6 @@ CallbackFlushHandler::~CallbackFlushHandler() Stop(); } -void CallbackFlushHandler::Invoke() -{ - flush(); -} - void CallbackFlushHandler::callback(const int type, const char* payload, void* data) { CallbackFlushHandler* self = static_cast<CallbackFlushHandler*>(data); @@ -828,7 +823,7 @@ void CallbackFlushHandler::queue(const int type, const char* data) } } -void CallbackFlushHandler::flush() +void CallbackFlushHandler::Invoke() { if (m_pCallback && !m_bEventLatch) { diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 3d1383d616cc..880bf029fbdb 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -292,7 +292,9 @@ bool MigrationImpl::doMigration() // execute custom migration services from Setup.xcu // and refresh the cache runServices(); - refresh(); + uno::Reference< XRefreshable >( + configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()), + uno::UNO_QUERY_THROW)->refresh(); result = true; } catch (css::uno::Exception & e) { @@ -308,13 +310,6 @@ bool MigrationImpl::doMigration() return result; } -void MigrationImpl::refresh() -{ - uno::Reference< XRefreshable >( - configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()), - uno::UNO_QUERY_THROW)->refresh(); -} - void MigrationImpl::setMigrationCompleted() { try { diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx index 9ad6f7de2d76..4342c4f6688f 100644 --- a/desktop/source/migration/migration_impl.hxx +++ b/desktop/source/migration/migration_impl.hxx @@ -210,7 +210,6 @@ private: void copyFiles(); void copyConfig(); void runServices(); - static void refresh(); static void setMigrationCompleted(); static bool checkMigrationCompleted(); |