[Libreoffice-commits] core.git: fpicker/Library_fpicker.mk fpicker/Module_fpicker.mk fpicker/source postprocess/Rdb_services.mk svtools/Library_svt.mk svtools/source svtools/util

Marcos Paulo de Souza marcos.souza.org at gmail.com
Mon Nov 4 13:16:12 CET 2013


 fpicker/Library_fpicker.mk               |   33 ----
 fpicker/Module_fpicker.mk                |    1 
 fpicker/source/generic/fpicker.component |   28 ---
 fpicker/source/generic/fpicker.cxx       |  223 -------------------------------
 postprocess/Rdb_services.mk              |    1 
 svtools/Library_svt.mk                   |    1 
 svtools/source/uno/fpicker.cxx           |  188 ++++++++++++++++++++++++++
 svtools/source/uno/fpicker.hxx           |   47 ++++++
 svtools/source/uno/miscservices.cxx      |   29 ++--
 svtools/util/svt.component               |    6 
 10 files changed, 262 insertions(+), 295 deletions(-)

New commits:
commit b40ffd288baf6dc5989cc09c5b5007eee97dd1bf
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Fri Oct 25 13:56:34 2013 -0200

    fdo#60698: Move generic fpicker to svtools
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>
    Conflicts:
    	dictionaries
    
    Change-Id: I6af478d7d6952e0e8f6c8f1b0575fcd50f2ba0e4

diff --git a/fpicker/Library_fpicker.mk b/fpicker/Library_fpicker.mk
deleted file mode 100644
index 36ae9f3..0000000
--- a/fpicker/Library_fpicker.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
-#
-#
-# 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/.
-#
-
-$(eval $(call gb_Library_Library,fpicker))
-
-$(eval $(call gb_Library_set_componentfile,fpicker,fpicker/source/generic/fpicker))
-
-$(eval $(call gb_Library_use_external,fpicker,boost_headers))
-
-$(eval $(call gb_Library_use_sdk_api,fpicker))
-
-$(eval $(call gb_Library_use_libraries,fpicker,\
-	cppu \
-	cppuhelper \
-	sal \
-	svl \
-	svt \
-	vcl \
-	$(gb_UWINAPI) \
-))
-
-$(eval $(call gb_Library_add_exception_objects,fpicker,\
-	fpicker/source/generic/fpicker \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/fpicker/Module_fpicker.mk b/fpicker/Module_fpicker.mk
index 1dc3181..d4a1e1f 100644
--- a/fpicker/Module_fpicker.mk
+++ b/fpicker/Module_fpicker.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,fpicker))
 
 $(eval $(call gb_Module_add_targets,fpicker,\
 	AllLangResTarget_fps_office \
-	Library_fpicker \
 	Library_fps_office \
 ))
 
diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component
deleted file mode 100644
index 7aee017..0000000
--- a/fpicker/source/generic/fpicker.component
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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 .
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" prefix="fpicker"
-    xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.fpicker.FilePicker">
-    <service name="com.sun.star.ui.dialogs.FilePicker"/>
-  </implementation>
-  <implementation name="com.sun.star.comp.fpicker.FolderPicker">
-    <service name="com.sun.star.ui.dialogs.FolderPicker"/>
-  </implementation>
-</component>
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 06d90e3..768a8e7 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -41,7 +41,6 @@ $(eval $(call gb_Rdb_add_components,services,\
 	filter/source/xsltdialog/xsltdlg \
 	filter/source/xsltfilter/xsltfilter \
 	formula/util/for \
-	fpicker/source/generic/fpicker \
 	fpicker/source/office/fps_office \
 	framework/util/fwk \
 	framework/util/fwl \
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index b18370f..11706c6 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -220,6 +220,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
     svtools/source/toolpanel/toolpaneldrawerpeer \
     svtools/source/uno/addrtempuno \
     svtools/source/uno/contextmenuhelper \
+    svtools/source/uno/fpicker \
     svtools/source/uno/framestatuslistener \
     svtools/source/uno/generictoolboxcontroller \
     svtools/source/uno/genericunodialog \
diff --git a/fpicker/source/generic/fpicker.cxx b/svtools/source/uno/fpicker.cxx
similarity index 80%
rename from fpicker/source/generic/fpicker.cxx
rename to svtools/source/uno/fpicker.cxx
index ea35226..81f2c6f 100644
--- a/fpicker/source/generic/fpicker.cxx
+++ b/svtools/source/uno/fpicker.cxx
@@ -20,7 +20,6 @@
 #include "sal/types.h"
 #include "rtl/ustring.hxx"
 
-#include "cppuhelper/implementationentry.hxx"
 #include "com/sun/star/lang/XMultiComponentFactory.hpp"
 
 #include "svtools/miscopt.hxx"
@@ -58,7 +57,7 @@ static OUString FilePicker_getSystemPickerServiceName()
 #endif
 }
 
-static Reference< css::uno::XInterface > FilePicker_createInstance (
+Reference< css::uno::XInterface > FilePicker_CreateInstance (
     Reference< css::uno::XComponentContext > const & rxContext)
 {
     Reference< css::uno::XInterface > xResult;
@@ -102,12 +101,12 @@ static Reference< css::uno::XInterface > FilePicker_createInstance (
     return xResult;
 }
 
-static OUString FilePicker_getImplementationName()
+OUString SAL_CALL FilePicker_getImplementationName()
 {
-    return OUString("com.sun.star.comp.fpicker.FilePicker");
+    return OUString("com.sun.star.comp.svt.FilePicker");
 }
 
-static Sequence< OUString > FilePicker_getSupportedServiceNames()
+Sequence< OUString > FilePicker_getSupportedServiceNames()
 {
     Sequence< OUString > aServiceNames(1);
     aServiceNames.getArray()[0] =
@@ -132,7 +131,7 @@ static OUString FolderPicker_getSystemPickerServiceName()
     return OUString("com.sun.star.ui.dialogs.SystemFolderPicker");
 }
 
-static Reference< css::uno::XInterface > FolderPicker_createInstance (
+Reference< css::uno::XInterface > FolderPicker_CreateInstance (
     Reference< css::uno::XComponentContext > const & rxContext)
 {
     Reference< css::uno::XInterface > xResult;
@@ -173,12 +172,12 @@ static Reference< css::uno::XInterface > FolderPicker_createInstance (
     return xResult;
 }
 
-static OUString FolderPicker_getImplementationName()
+OUString SAL_CALL FolderPicker_getImplementationName()
 {
-    return OUString("com.sun.star.comp.fpicker.FolderPicker");
+    return OUString("com.sun.star.comp.svt.FolderPicker");
 }
 
-static Sequence< OUString > FolderPicker_getSupportedServiceNames()
+Sequence< OUString > FolderPicker_getSupportedServiceNames()
 {
     Sequence< OUString > aServiceNames(1);
     aServiceNames.getArray()[0] =
@@ -186,38 +185,4 @@ static Sequence< OUString > FolderPicker_getSupportedServiceNames()
     return aServiceNames;
 }
 
-/*
- * Implementation entries.
- */
-static const cppu::ImplementationEntry g_entries[] =
-{
-    {
-        FilePicker_createInstance,
-        FilePicker_getImplementationName,
-        FilePicker_getSupportedServiceNames,
-        cppu::createSingleComponentFactory, 0, 0
-    },
-    {
-        FolderPicker_createInstance,
-        FolderPicker_getImplementationName,
-        FolderPicker_getSupportedServiceNames,
-        cppu::createSingleComponentFactory, 0, 0
-    },
-    { 0, 0, 0, 0, 0, 0 }
-};
-
-/*
- * Public (exported) interface.
- */
-extern "C"
-{
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL fpicker_component_getFactory (
-    const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
-{
-    return cppu::component_getFactoryHelper (
-        pImplementationName, pServiceManager, pRegistryKey, g_entries);
-}
-
-} // extern "C"
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/fpicker.hxx b/svtools/source/uno/fpicker.hxx
new file mode 100644
index 0000000..6558bfc
--- /dev/null
+++ b/svtools/source/uno/fpicker.hxx
@@ -0,0 +1,47 @@
+/* -*- 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 INCLUDED_SVT_SOURCE_UNO_FILEPICKER_HXX
+#define INCLUDED_SVT_SOURCE_UNO_FILEPICKER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star {
+namespace lang { class XMultiServiceFactory; }
+namespace uno { class XInterface; }
+} } }
+
+css::uno::Reference<css::uno::XInterface> SAL_CALL FilePicker_CreateInstance(
+css::uno::Reference< css::uno::XComponentContext > const & context);
+css::uno::Sequence<OUString> FilePicker_getSupportedServiceNames();
+OUString FilePicker_getImplementationName();
+
+css::uno::Reference<css::uno::XInterface> SAL_CALL FolderPicker_CreateInstance(
+css::uno::Reference< css::uno::XComponentContext > const & context);
+css::uno::Sequence<OUString> FolderPicker_getSupportedServiceNames();
+OUString FolderPicker_getImplementationName();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
index 76bc5a6..0414f5d 100644
--- a/svtools/source/uno/miscservices.cxx
+++ b/svtools/source/uno/miscservices.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/registry/XRegistryKey.hpp>
 #include <osl/diagnose.h>
 #include <uno/mapping.hxx>
+#include "fpicker.hxx"
 #include "provider.hxx"
 #include "renderer.hxx"
 #include "unowizard.hxx"
@@ -69,6 +70,18 @@ namespace
             ::svt::uno::Wizard::getSupportedServiceNames_static,
             ::cppu::createSingleComponentFactory, NULL, 0
         },
+        {
+            FilePicker_CreateInstance,
+            FilePicker_getImplementationName,
+            FilePicker_getSupportedServiceNames,
+            ::cppu::createSingleComponentFactory, 0, 0
+        },
+        {
+            FolderPicker_CreateInstance,
+            FolderPicker_getImplementationName,
+            FolderPicker_getSupportedServiceNames,
+            ::cppu::createSingleComponentFactory, 0, 0
+        },
         { 0, 0, 0, 0, 0, 0 }
     };
 }
@@ -90,6 +103,8 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
     void * pResult = 0;
     if ( _pServiceManager )
     {
+        Reference< XMultiServiceFactory > xSMgr(reinterpret_cast< XMultiServiceFactory * >( _pServiceManager ) );
+
         Reference< XSingleServiceFactory > xFactory;
         if (rtl_str_compare (
                 pImplementationName, "com.sun.star.comp.svtools.OAddressBookSourceDialogUno") == 0)
@@ -98,8 +113,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
             aServiceNames.getArray()[0] =
                 OUString( "com.sun.star.ui.AddressBookSourceDialog" );
 
-            xFactory = ::cppu::createSingleFactory (
-                reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
+            xFactory = ::cppu::createSingleFactory (xSMgr,
                 OUString::createFromAscii( pImplementationName ),
                 svt::OAddressBookSourceDialogUno_CreateInstance,
                 aServiceNames);
@@ -111,31 +125,28 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
             aServiceNames.getArray()[0] =
                 OUString( "com.sun.star.ui.dialogs.FilterOptionsDialog" );
 
-            xFactory = ::cppu::createSingleFactory (
-                reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
+            xFactory = ::cppu::createSingleFactory (xSMgr,
                 OUString::createFromAscii( pImplementationName ),
                 SvFilterOptionsDialog_CreateInstance,
                 aServiceNames);
         }
         else if( 0 == GraphicProvider::getImplementationName_Static().compareToAscii( pImplementationName ) )
         {
-            xFactory =  ::cppu::createOneInstanceFactory(
-                reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
+            xFactory =  ::cppu::createOneInstanceFactory(xSMgr,
                 GraphicProvider::getImplementationName_Static(),
                 GraphicProvider_CreateInstance,
                 GraphicProvider::getSupportedServiceNames_Static() );
         }
         else if( 0 == GraphicRendererVCL::getImplementationName_Static().compareToAscii( pImplementationName ) )
         {
-            xFactory = ::cppu::createOneInstanceFactory(
-                reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
+            xFactory = ::cppu::createOneInstanceFactory(xSMgr,
                 GraphicRendererVCL::getImplementationName_Static(),
                 GraphicRendererVCL_CreateInstance,
                 GraphicRendererVCL::getSupportedServiceNames_Static() );
         }
         else
         {
-            pResult =  component_getFactoryHelper( pImplementationName, reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl );
+            pResult =  component_getFactoryHelper( pImplementationName, reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl );
             if ( !pResult )
                 pResult = ::cppu::component_getFactoryHelper( pImplementationName, _pServiceManager, pRegistryKey, s_aServiceEntries );
         }
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
index 4670a13..249448b 100644
--- a/svtools/util/svt.component
+++ b/svtools/util/svt.component
@@ -37,4 +37,10 @@
   <implementation name="com.sun.star.svtools.SvFilterOptionsDialog">
     <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
   </implementation>
+  <implementation name="com.sun.star.comp.svt.FilePicker">
+    <service name="com.sun.star.ui.dialogs.FilePicker"/>
+  </implementation>
+  <implementation name="com.sun.star.comp.svt.FolderPicker">
+    <service name="com.sun.star.ui.dialogs.FolderPicker"/>
+  </implementation>
 </component>


More information about the Libreoffice-commits mailing list