Kaydet (Commit) fa2a7c1c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Keep using component_getImplementationEnvironment in extensions

...instead of relying on the implicit CPPU_CURRENT_LANGUAGE_BINDING_NAME
convention.  Keeping that convention an implementation detail makes it easier to
do improvements in the future.  (Theoretically, the bundled extension in mysqlc
could be considered internal code and not adapted, but just be safe.)

Change-Id: Iae41a6e072dabc2bf7c1481ba6cfed61680edf37
üst ca406568
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/log.hxx" #include "sal/log.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "uno/lbnames.h"
namespace { namespace {
...@@ -251,6 +252,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -251,6 +252,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
pImplName, pServiceManager, pRegistryKey, services); pImplName, pServiceManager, pRegistryKey, services);
} }
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void * pServiceManager, void * pRegistryKey) void * pServiceManager, void * pRegistryKey)
{ {
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "cppuhelper/weak.hxx" #include "cppuhelper/weak.hxx"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "sal/types.h" #include "sal/types.h"
#include "uno/lbnames.h"
namespace { namespace {
...@@ -248,4 +249,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -248,4 +249,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
pImplName, pServiceManager, pRegistryKey, services); pImplName, pServiceManager, pRegistryKey, services);
} }
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <uno/lbnames.h>
using namespace connectivity::mysqlc; using namespace connectivity::mysqlc;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
...@@ -102,6 +103,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( ...@@ -102,6 +103,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
}; };
/* }}} */ /* }}} */
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
/* /*
* Local variables: * Local variables:
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <stdio.h> #include <stdio.h>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <uno/lbnames.h>
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
// generated c++ interfaces // generated c++ interfaces
...@@ -85,4 +86,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C ...@@ -85,4 +86,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C
return pRet; return pRet;
} }
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx> #include <cppuhelper/implementationentry.hxx>
#include <uno/lbnames.h>
#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XInitialization.hpp>
...@@ -204,6 +205,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -204,6 +205,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries ); implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries );
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "SDriver.hxx" #include "SDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <uno/lbnames.h>
using namespace connectivity::skeleton; using namespace connectivity::skeleton;
using ::rtl::OUString; using ::rtl::OUString;
...@@ -143,5 +144,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( ...@@ -143,5 +144,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
return pRet; return pRet;
}; };
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <osl/thread.h> #include <osl/thread.h>
#include <uno/lbnames.h>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp>
...@@ -72,6 +73,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -72,6 +73,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
return pRet; return pRet;
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <cppuhelper/implbase2.hxx> #include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <uno/lbnames.h>
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
...@@ -339,6 +340,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -339,6 +340,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
return pRet; return pRet;
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} // extern "C" } // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -572,7 +572,7 @@ the c++ ProtocolHandler example.</td> ...@@ -572,7 +572,7 @@ the c++ ProtocolHandler example.</td>
href="./Components/Addons/ProtocolHandlerAddon_cpp/component.cxx" href="./Components/Addons/ProtocolHandlerAddon_cpp/component.cxx"
title="link to Components/Addons/ProtocolHandlerAddon_cpp/component.cxx">component.cxx</a></td> title="link to Components/Addons/ProtocolHandlerAddon_cpp/component.cxx">component.cxx</a></td>
<td class="cell80">Implements the administrative <td class="cell80">Implements the administrative
component functions (component_writeInfo, component_getFactory).</td> component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment).</td>
</tr> </tr>
<tr> <tr>
<td class="cell20"><a <td class="cell20"><a
...@@ -899,7 +899,7 @@ the filter detection example.</td> ...@@ -899,7 +899,7 @@ the filter detection example.</td>
href="./OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx" href="./OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx"
title="link to OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx">fdcomp.cxx</a></td> title="link to OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx">fdcomp.cxx</a></td>
<td class="cell80">Implements the administrative <td class="cell80">Implements the administrative
component functions (component_writeInfo, component_getFactory).</td> component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment).</td>
</tr> </tr>
<tr> <tr>
<td class="cell20"><a <td class="cell20"><a
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <uno/lbnames.h>
#include "MyProtocolHandler.h" #include "MyProtocolHandler.h"
#include "MyListener.h" #include "MyListener.h"
...@@ -56,6 +57,12 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplNa ...@@ -56,6 +57,12 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplNa
return xFactory.get(); return xFactory.get();
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} // extern C } // extern C
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <stdio.h> #include <stdio.h>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <uno/lbnames.h>
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
...@@ -181,4 +182,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C ...@@ -181,4 +182,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C
return pRet; return pRet;
} }
extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "ctp_factory.hxx" #include "ctp_factory.hxx"
#include <cppuhelper/implementationentry.hxx> #include <cppuhelper/implementationentry.hxx>
#include <uno/lbnames.h>
//...................................................................................................................... //......................................................................................................................
namespace sd { namespace colortoolpanel namespace sd { namespace colortoolpanel
...@@ -52,6 +53,13 @@ extern "C" ...@@ -52,6 +53,13 @@ extern "C"
{ {
return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries ); return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries );
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <stdio.h> #include <stdio.h>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <uno/lbnames.h>
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#include <com/sun/star/uno/XNamingService.hpp> #include <com/sun/star/uno/XNamingService.hpp>
...@@ -245,6 +246,13 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( ...@@ -245,6 +246,13 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
return pRet; return pRet;
} }
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
char const ** ppEnvTypeName, uno_Environment **)
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EXPORTS EXPORTS
component_getFactory component_getFactory
component_getImplementationEnvironment
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