[Libreoffice-commits] .: 2 commits - extensions/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Nov 24 11:24:47 PST 2012


 extensions/source/bibliography/bibload.cxx   |   26 ++++++++++-
 offapi/UnoApi_offapi.mk                      |    2 
 offapi/com/sun/star/sdbc/DriverManager.idl   |   41 +-----------------
 offapi/com/sun/star/sdbc/XDriverManager2.idl |   60 +++++++++++++++++++++++++++
 offapi/type_reference/types.rdb              |binary
 5 files changed, 88 insertions(+), 41 deletions(-)

New commits:
commit a6c1e4186a4f7e246103f541beccbc7d8a027ef0
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 24 20:06:26 2012 +0100

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

diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 94e35cf..58c1b01 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/util/XURLTransformer.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.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/frame/XFrameLoader.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -43,6 +44,7 @@
 #include <com/sun/star/form/XLoadListener.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/uno/XAggregation.hpp>
+#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
 #include <toolkit/awt/vclxwindow.hxx>
 #include <vcl/window.hxx>
 #include <vcl/edit.hxx>
@@ -239,9 +241,9 @@ namespace
     {
         try
         {
-            Reference< XMultiServiceFactory >  xMgr = comphelper::getProcessServiceFactory();
-            Reference< XAggregation > xAggregate = Reference< XAggregation >( xMgr->createInstance(C2U("com.sun.star.sdb.RowSet")), UNO_QUERY);
-            return xAggregate.is();
+            // 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(...)
         {
@@ -256,7 +258,25 @@ void BibliographyLoader::load(const Reference< XFrame > & rFrame, const rtl::OUS
     // 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()), 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;
+    }
 
     SolarMutexGuard aGuard;
     
commit db160a3cd5aa8d42ac90efd91b4c1825a9fe3156
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Sat Nov 24 20:08:12 2012 +0100

    fdo#46808: move com::sun::star:sdbc::DriverManager to new UNO-style
    
    Change-Id: I9807fbe8bce95e7e801ac584d89b3b1da97d8662

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index f1e53a2..6e85574 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -247,6 +247,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb/applic
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdbc,\
 	ConnectionPool \
+	DriverManager \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
 	CertificateContainer \
@@ -3194,6 +3195,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdbc,\
 	XDriver \
 	XDriverAccess \
 	XDriverManager \
+	XDriverManager2 \
 	XGeneratedResultSet \
 	XIsolatedConnection \
 	XMultipleResults \
diff --git a/offapi/com/sun/star/sdbc/DriverManager.idl b/offapi/com/sun/star/sdbc/DriverManager.idl
index 7d04d9c..e9166ef 100644
--- a/offapi/com/sun/star/sdbc/DriverManager.idl
+++ b/offapi/com/sun/star/sdbc/DriverManager.idl
@@ -19,49 +19,14 @@
 #ifndef __com_sun_star_sdbc_DriverManager_idl__
 #define __com_sun_star_sdbc_DriverManager_idl__
 
-#include <com/sun/star/container/XEnumerationAccess.idl>
+#include <com/sun/star/sdbc/XDriverManager2.idl>
 
- module com {  module sun {  module star {  module sdbc {
-
- published interface XConnection;
- published interface XDriver;
- published interface XDriverManager;
-
-
-/** is the basic service for managing a set of SDBC drivers.
-
-
-    <p>
-    As part of its initialization, the DriverManager service will
-    attempt to load the registered drivers.
-
-    </p>
-    <p>
-    When the method <code>getConnection</code> is called,
-    the DriverManager will attempt to
-    locate a suitable driver.
-
-    </p>
-    @see com::sun::star::sdbc::XDriver
-    @see com::sun::star::sdbc::XConnection
- */
-published service DriverManager
-{
-
-    /** is the basic interface for establishing database connections.
-     */
-    interface XDriverManager;
-
-    /** creates an enumeration on all installed / registered drivers.
-     */
-    interface com::sun::star::container::XEnumerationAccess;
-};
+module com { module sun { module star { module sdbc {
 
+published service DriverManager : XDriverManager2;
 
 }; }; }; };
 
-/*===========================================================================
-===========================================================================*/
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/sdbc/XDriverManager2.idl b/offapi/com/sun/star/sdbc/XDriverManager2.idl
new file mode 100644
index 0000000..6512eb3
--- /dev/null
+++ b/offapi/com/sun/star/sdbc/XDriverManager2.idl
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_sdbc_XDriverManager2_idl__
+#define __com_sun_star_sdbc_XDriverManager2_idl__
+
+#include <com/sun/star/container/XEnumerationAccess.idl>
+#include <com/sun/star/sdbc/XDriverManager.idl>
+
+module com { module sun { module star { module sdbc {
+
+/** is the basic interface for managing a set of SDBC drivers.
+
+    <p>
+    As part of its initialization, the DriverManager service will
+    attempt to load the registered drivers.
+
+    </p>
+    <p>
+    When the method <code>getConnection</code> is called,
+    the DriverManager will attempt to
+    locate a suitable driver.
+
+    </p>
+    @see com::sun::star::sdbc::XDriver
+    @see com::sun::star::sdbc::XConnection
+ */
+published interface XDriverManager2
+{
+
+    /** is the basic interface for establishing database connections.
+     */
+    interface XDriverManager;
+
+    /** creates an enumeration on all installed / registered drivers.
+     */
+    interface com::sun::star::container::XEnumerationAccess;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 05eb70a..4478c94 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ


More information about the Libreoffice-commits mailing list