Kaydet (Commit) a6c1e418 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

lp#527938: use new-style service and session installer in bibliography

Change-Id: Id06e64ffb6c63cfba2f9948579dc03a4f54b6d45
üst db160a3c
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/sdbc/DriverManager.hpp>
#include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/frame/XFrameLoader.hpp> #include <com/sun/star/frame/XFrameLoader.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
#include <com/sun/star/form/XLoadListener.hpp> #include <com/sun/star/form/XLoadListener.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/uno/XAggregation.hpp> #include <com/sun/star/uno/XAggregation.hpp>
#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
#include <toolkit/awt/vclxwindow.hxx> #include <toolkit/awt/vclxwindow.hxx>
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
...@@ -239,9 +241,9 @@ namespace ...@@ -239,9 +241,9 @@ namespace
{ {
try try
{ {
Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); // if we get com::sun::star::sdbc::DriverManager, libsdbc2 is there
Reference< XAggregation > xAggregate = Reference< XAggregation >( xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY); // and the bibliography is assumed to work
return xAggregate.is(); return com::sun::star::sdbc::DriverManager::create(comphelper::getProcessComponentContext()).is();
} }
catch(...) catch(...)
{ {
...@@ -256,7 +258,25 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const rtl::OUS ...@@ -256,7 +258,25 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const rtl::OUS
// lp#527938, debian#602953, fdo#33266, i#105408 // lp#527938, debian#602953, fdo#33266, i#105408
// make sure we actually can instanciate services from base first // make sure we actually can instanciate services from base first
if(!lcl_isBaseAvailable()) if(!lcl_isBaseAvailable())
{
try
{
using namespace org::freedesktop::PackageKit;
Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()), UNO_QUERY);
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; return;
}
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment