Blame SOURCES/0072-Keep-using-component_getImplementationEnvironment-in.patch

f0633d
From 8071d87b62ab87b2a825394847e9313ea8ddfcb4 Mon Sep 17 00:00:00 2001
f0633d
From: Stephan Bergmann <sbergman@redhat.com>
f0633d
Date: Tue, 17 Dec 2013 10:53:29 +0100
f0633d
Subject: [PATCH 072/109] Keep using component_getImplementationEnvironment in
f0633d
 extensions
f0633d
f0633d
...instead of relying on the implicit CPPU_CURRENT_LANGUAGE_BINDING_NAME
f0633d
convention.  Keeping that convention an implementation detail makes it easier to
f0633d
do improvements in the future.  (Theoretically, the bundled extension in mysqlc
f0633d
could be considered internal code and not adapted, but just be safe.)
f0633d
f0633d
(cherry picked from commit fa2a7c1c95f78d20ed572091e12700fd4d852835)
f0633d
Conflicts:
f0633d
	desktop/test/deployment/active/active_native.cxx
f0633d
	odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
f0633d
	odk/examples/cpp/counter/counter.cxx
f0633d
f0633d
Change-Id: Iae41a6e072dabc2bf7c1481ba6cfed61680edf37
f0633d
Reviewed-on: https://gerrit.libreoffice.org/7119
f0633d
Reviewed-by: Michael Stahl <mstahl@redhat.com>
f0633d
Tested-by: Michael Stahl <mstahl@redhat.com>
f0633d
---
f0633d
 desktop/test/deployment/active/active_native.cxx                  | 7 +++++++
f0633d
 desktop/test/deployment/passive/passive_native.cxx                | 7 +++++++
f0633d
 mysqlc/source/mysqlc_services.cxx                                 | 7 +++++++
f0633d
 .../Components/Addons/ProtocolHandlerAddon_cpp/component.cxx      | 8 ++++++++
f0633d
 .../DevelopersGuide/Components/CppComponent/service2_impl.cxx     | 7 +++++++
f0633d
 .../DevelopersGuide/Database/DriverSkeleton/SServices.cxx         | 7 +++++++
f0633d
 .../OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx | 7 +++++++
f0633d
 .../OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx     | 7 +++++++
f0633d
 odk/examples/DevelopersGuide/examples.html                        | 4 ++--
f0633d
 odk/examples/cpp/complextoolbarcontrols/exports.cxx               | 7 +++++++
f0633d
 odk/examples/cpp/counter/counter.cxx                              | 8 ++++++++
f0633d
 odk/examples/cpp/custompanel/ctp_services.cxx                     | 8 ++++++++
f0633d
 odk/examples/cpp/remoteclient/remoteclient.cxx                    | 8 ++++++++
f0633d
 odk/settings/component.uno.def                                    | 1 +
f0633d
 14 files changed, 91 insertions(+), 2 deletions(-)
f0633d
f0633d
diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx
f0633d
index 3afc099..0e0b1e6 100644
f0633d
--- a/desktop/test/deployment/active/active_native.cxx
f0633d
+++ b/desktop/test/deployment/active/active_native.cxx
f0633d
@@ -252,6 +252,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
         pImplName, pServiceManager, pRegistryKey, services);
f0633d
 }
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 extern "C" sal_Bool SAL_CALL component_writeInfo(
f0633d
     void * pServiceManager, void * pRegistryKey)
f0633d
 {
f0633d
diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx
f0633d
index 819f6ab..22586a4 100644
f0633d
--- a/desktop/test/deployment/passive/passive_native.cxx
f0633d
+++ b/desktop/test/deployment/passive/passive_native.cxx
f0633d
@@ -249,4 +249,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
         pImplName, pServiceManager, pRegistryKey, services);
f0633d
 }
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/mysqlc/source/mysqlc_services.cxx b/mysqlc/source/mysqlc_services.cxx
f0633d
index af1cabe..0ffe9cd 100644
f0633d
--- a/mysqlc/source/mysqlc_services.cxx
f0633d
+++ b/mysqlc/source/mysqlc_services.cxx
f0633d
@@ -22,6 +22,7 @@
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
 #include <osl/diagnose.h>
f0633d
 #include <rtl/ustrbuf.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 using namespace connectivity::mysqlc;
f0633d
 using ::com::sun::star::uno::Reference;
f0633d
@@ -102,6 +103,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
f0633d
 };
f0633d
 /* }}} */
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
 
f0633d
 /*
f0633d
  * Local variables:
f0633d
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
f0633d
index 20c2628..b71c694 100644
f0633d
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
f0633d
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx
f0633d
@@ -35,6 +35,7 @@
f0633d
 
f0633d
 #include <stdio.h>
f0633d
 #include <rtl/ustring.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 #include <cppuhelper/queryinterface.hxx> // helper for queryInterface() impl
f0633d
 #include <cppuhelper/factory.hxx> // helper for component factory
f0633d
 // generated c++ interfaces
f0633d
@@ -85,4 +86,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C
f0633d
     return pRet;
f0633d
 }
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
f0633d
index ac86ea1..fa6d875 100644
f0633d
--- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
f0633d
+++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
f0633d
@@ -36,6 +36,7 @@
f0633d
 #include <cppuhelper/implbase3.hxx> // "3" implementing three interfaces
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
 #include <cppuhelper/implementationentry.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 #include <com/sun/star/lang/XServiceInfo.hpp>
f0633d
 #include <com/sun/star/lang/XInitialization.hpp>
f0633d
@@ -206,6 +207,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
         implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries );
f0633d
 }
f0633d
 
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 }
f0633d
 
f0633d
 
f0633d
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
f0633d
index 9e8fa4c..4873522 100644
f0633d
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
f0633d
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
f0633d
@@ -37,6 +37,7 @@
f0633d
 #include "SDriver.hxx"
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
 #include <osl/diagnose.h>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 using namespace connectivity::skeleton;
f0633d
 using ::rtl::OUString;
f0633d
@@ -143,5 +144,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
f0633d
     return pRet;
f0633d
 };
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
f0633d
index e6b7885..9d234e9 100644
f0633d
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
f0633d
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
f0633d
@@ -37,6 +37,7 @@
f0633d
 
f0633d
 #include <osl/mutex.hxx>
f0633d
 #include <osl/thread.h>
f0633d
+#include <uno/lbnames.h>
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
f0633d
 
f0633d
@@ -72,6 +73,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
     return pRet;
f0633d
 }
f0633d
 
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 }
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
f0633d
index 5cfe660..9dd347d 100644
f0633d
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
f0633d
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
f0633d
@@ -38,6 +38,7 @@
f0633d
 #include <cppuhelper/implbase2.hxx>
f0633d
 #include <cppuhelper/implbase3.hxx>
f0633d
 #include <cppuhelper/implbase.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 #include <com/sun/star/lang/XComponent.hpp>
f0633d
 
f0633d
@@ -339,6 +340,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
     return pRet;
f0633d
 }
f0633d
 
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 } // extern "C"
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/DevelopersGuide/examples.html b/odk/examples/DevelopersGuide/examples.html
f0633d
index b33b16e..17db8e1 100644
f0633d
--- a/odk/examples/DevelopersGuide/examples.html
f0633d
+++ b/odk/examples/DevelopersGuide/examples.html
f0633d
@@ -573,7 +573,7 @@ the c++ ProtocolHandler example.
f0633d
  href="./Components/Addons/ProtocolHandlerAddon_cpp/component.cxx"
f0633d
  title="link to Components/Addons/ProtocolHandlerAddon_cpp/component.cxx">component.cxx
f0633d
                   Implements the administrative
f0633d
-component functions (component_writeInfo, component_getFactory).
f0633d
+component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment).
f0633d
                 
f0633d
                 
f0633d
                   
f0633d
@@ -900,7 +900,7 @@ the filter detection example.
f0633d
  href="./OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx"
f0633d
  title="link to OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx">fdcomp.cxx
f0633d
                   Implements the administrative
f0633d
-component functions (component_writeInfo, component_getFactory).
f0633d
+component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment).
f0633d
                 
f0633d
                 
f0633d
                   
f0633d
diff --git a/odk/examples/cpp/complextoolbarcontrols/exports.cxx b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
f0633d
index 09ab4ce..35a4f39 100644
f0633d
--- a/odk/examples/cpp/complextoolbarcontrols/exports.cxx
f0633d
+++ b/odk/examples/cpp/complextoolbarcontrols/exports.cxx
f0633d
@@ -18,6 +18,7 @@
f0633d
  */
f0633d
 
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 #include "MyProtocolHandler.h"
f0633d
 #include "MyListener.h"
f0633d
@@ -56,6 +57,12 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplNa
f0633d
     return xFactory.get();
f0633d
 }
f0633d
 
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 } // extern C
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx
f0633d
index 6f65f5c..0773d60 100644
f0633d
--- a/odk/examples/cpp/counter/counter.cxx
f0633d
+++ b/odk/examples/cpp/counter/counter.cxx
f0633d
@@ -46,6 +46,7 @@
f0633d
 
f0633d
 #include <stdio.h>
f0633d
 #include <rtl/ustring.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 #include <cppuhelper/queryinterface.hxx> // helper for queryInterface() impl
f0633d
 #include <cppuhelper/factory.hxx> // helper for component factory
f0633d
 // generated c++ interfaces
f0633d
@@ -194,4 +195,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C
f0633d
     return pRet;
f0633d
 }
f0633d
 
f0633d
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
f0633d
+component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/cpp/custompanel/ctp_services.cxx b/odk/examples/cpp/custompanel/ctp_services.cxx
f0633d
index c096a7b..a8f5702 100644
f0633d
--- a/odk/examples/cpp/custompanel/ctp_services.cxx
f0633d
+++ b/odk/examples/cpp/custompanel/ctp_services.cxx
f0633d
@@ -20,6 +20,7 @@
f0633d
 #include "ctp_factory.hxx"
f0633d
 
f0633d
 #include <cppuhelper/implementationentry.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 
f0633d
 //......................................................................................................................
f0633d
 namespace sd { namespace colortoolpanel
f0633d
@@ -52,6 +53,13 @@ extern "C"
f0633d
     {
f0633d
         return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries );
f0633d
     }
f0633d
+
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 }
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx
f0633d
index c8886b0..037814b 100644
f0633d
--- a/odk/examples/cpp/remoteclient/remoteclient.cxx
f0633d
+++ b/odk/examples/cpp/remoteclient/remoteclient.cxx
f0633d
@@ -35,6 +35,7 @@
f0633d
 
f0633d
 #include <stdio.h>
f0633d
 #include <osl/mutex.hxx>
f0633d
+#include <uno/lbnames.h>
f0633d
 #include <cppuhelper/factory.hxx>
f0633d
 
f0633d
 #include <com/sun/star/uno/XNamingService.hpp>
f0633d
@@ -245,6 +246,13 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
f0633d
 
f0633d
     return pRet;
f0633d
 }
f0633d
+
f0633d
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
f0633d
+    char const ** ppEnvTypeName, uno_Environment **)
f0633d
+{
f0633d
+    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
f0633d
+}
f0633d
+
f0633d
 }
f0633d
 
f0633d
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
f0633d
diff --git a/odk/settings/component.uno.def b/odk/settings/component.uno.def
f0633d
index 0c35f9a..1ca480a 100644
f0633d
--- a/odk/settings/component.uno.def
f0633d
+++ b/odk/settings/component.uno.def
f0633d
@@ -1,2 +1,3 @@
f0633d
 EXPORTS
f0633d
 component_getFactory
f0633d
+component_getImplementationEnvironment
f0633d
-- 
f0633d
1.8.4.2
f0633d