From 8efb69e260ecbcde5ee67ab41ed7a9630783c29a Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Fri, 30 Nov 2012 19:37:07 +0100 Subject: move base check for bibliography to sfx2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - in the libbiblio component the frame is already created, and a frame that is loading is vetoing a terminate - thus move check to sfx2 - use the fancy svtools::RestartDialog Change-Id: I500aaeac44d52969575f50f6b79d0c07a08c977e Reviewed-on: https://gerrit.libreoffice.org/1207 Reviewed-by: Björn Michaelsen Tested-by: Björn Michaelsen --- extensions/source/bibliography/bibload.cxx | 45 ------------------------------ 1 file changed, 45 deletions(-) (limited to 'extensions') diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 24367917fbf7..537010ef3962 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -44,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -233,53 +231,10 @@ void BibliographyLoader::cancel(void) throw (::com::sun::star::uno::RuntimeExcep //! } -// ----------------------------------------------------------------------- -namespace -{ - // lp#527938, debian#602953, fdo#33266, i#105408 - static bool lcl_isBaseAvailable() - { - try - { - // if we get com::sun::star::sdbc::DriverManager, libsdbc2 is there - // and the bibliography is assumed to work - return com::sun::star::sdbc::DriverManager::create(comphelper::getProcessComponentContext()).is(); - } - catch (Exception & e) - { - SAL_INFO( - "extensions.bibliography", - "assuming Base to be missing; caught " << e.Message); - return false; - } - } -} void BibliographyLoader::load(const Reference< XFrame > & rFrame, const rtl::OUString& rURL, const Sequence< PropertyValue >& rArgs, const Reference< XLoadEventListener > & rListener) throw (::com::sun::star::uno::RuntimeException) { - // lp#527938, debian#602953, fdo#33266, i#105408 - // make sure we actually can instanciate services from base first - if(!lcl_isBaseAvailable()) - { - try - { - using namespace org::freedesktop::PackageKit; - Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext())); - Sequence< ::rtl::OUString > vPackages(1); - vPackages[0] = "libreoffice-base"; - ::rtl::OUString sInteraction; - xSyncDbusSessionHelper->InstallPackageNames(0, vPackages, sInteraction); - // FIXME: notify user to restart here - } - catch (Exception & e) - { - SAL_INFO( - "extensions.bibliography", - "trying to install LibreOffice Base, caught " << e.Message); - } - return; - } SolarMutexGuard aGuard; -- cgit