summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsolenv/bin/native-code.py2
-rw-r--r--vcl/inc/factory.hxx5
-rw-r--r--vcl/source/components/dtranscomp.cxx60
-rw-r--r--vcl/source/components/factory.cxx6
-rw-r--r--vcl/vcl.android.component5
-rw-r--r--vcl/vcl.ios.component5
-rw-r--r--vcl/vcl.macosx.component3
-rw-r--r--vcl/vcl.unx.component3
8 files changed, 19 insertions, 70 deletions
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index d9d50e81103d..4f387be3186a 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -304,6 +304,8 @@ core_constructor_list = [
# uui/util/uui.component
"com_sun_star_comp_uui_UUIInteractionHandler_get_implementation",
"com_sun_star_comp_uui_UUIInteractionRequestStringResolver_get_implementation",
+# vcl/*.component
+ "vcl_SystemClipboard_get_implementation",
# xmloff/source/transform/xof.component
"xmloff_XMLCalcContentImportOOO_get_implementation",
"xmloff_XMLCalcImportOOO_get_implementation",
diff --git a/vcl/inc/factory.hxx b/vcl/inc/factory.hxx
index f32fdaee6012..4a808d29c70b 100644
--- a/vcl/inc/factory.hxx
+++ b/vcl/inc/factory.hxx
@@ -36,11 +36,6 @@ namespace com::sun::star {
namespace vcl {
-OUString Clipboard_getImplementationName();
-
-css::uno::Reference<css::lang::XSingleServiceFactory>
-Clipboard_createFactory();
-
css::uno::Sequence<OUString> DragSource_getSupportedServiceNames();
OUString DragSource_getImplementationName();
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index c7bda5361fdb..7e5f36f67f7d 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -185,64 +185,16 @@ void GenericClipboard::removeClipboardListener( const Reference< datatransfer::c
m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end());
}
-namespace {
-
-class ClipboardFactory : public ::cppu::WeakComponentImplHelper<
- css::lang::XSingleServiceFactory
->
-{
- osl::Mutex m_aMutex;
-public:
- ClipboardFactory();
-
- /*
- * XSingleServiceFactory
- */
- virtual Reference< XInterface > SAL_CALL createInstance() override;
- virtual Reference< XInterface > SAL_CALL createInstanceWithArguments( const Sequence< Any >& rArgs ) override;
-};
-
-}
-
-ClipboardFactory::ClipboardFactory() :
- cppu::WeakComponentImplHelper<
- css::lang::XSingleServiceFactory
->( m_aMutex )
-{
-}
-Reference< XInterface > ClipboardFactory::createInstance()
-{
- return createInstanceWithArguments( Sequence< Any >() );
-}
-Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Sequence< Any >& arguments )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+vcl_SystemClipboard_get_implementation(
+ css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& args)
{
SolarMutexGuard aGuard;
- Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateClipboard( arguments );
- return xResult;
-}
-
-OUString Clipboard_getImplementationName()
-{
- return
- #if defined MACOSX
- "com.sun.star.datatransfer.clipboard.AquaClipboard"
- #elif defined IOS
- "com.sun.star.datatransfer.clipboard.iOSClipboard"
- #elif defined ANDROID
- "com.sun.star.datatransfer.VCLGenericClipboard"
- #elif defined UNX
- "com.sun.star.datatransfer.X11ClipboardSupport"
- #else
- "com.sun.star.datatransfer.VCLGenericClipboard"
- #endif
- ;
-}
-
-Reference< XSingleServiceFactory > Clipboard_createFactory()
-{
- return Reference< XSingleServiceFactory >( new ClipboardFactory() );
+ auto xClipboard = ImplGetSVData()->mpDefInst->CreateClipboard( args );
+ xClipboard->acquire();
+ return xClipboard.get();
}
namespace {
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 6c1cfe2ec872..0a5b7e8f6f8c 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -43,11 +43,7 @@ extern "C" {
static_cast< css::lang::XMultiServiceFactory* >( pXUnoSMgr )
);
Reference< css::lang::XSingleServiceFactory > xFactory;
- if( vcl::Clipboard_getImplementationName().equalsAscii( pImplementationName ) )
- {
- xFactory = vcl::Clipboard_createFactory();
- }
- else if( vcl::DragSource_getImplementationName().equalsAscii( pImplementationName ) )
+ if( vcl::DragSource_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = ::cppu::createSingleFactory(
xMgr, vcl::DragSource_getImplementationName(), vcl::DragSource_createInstance,
diff --git a/vcl/vcl.android.component b/vcl/vcl.android.component
index b81e61591471..d59855a7342e 100644
--- a/vcl/vcl.android.component
+++ b/vcl/vcl.android.component
@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="vcl" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.datatransfer.VCLGenericClipboard">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.VCLGenericClipboard"
+ constructor="vcl_SystemClipboard_get_implementation">
<service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
</implementation>
<implementation name="com.sun.star.frame.VCLSessionManagerClient"
diff --git a/vcl/vcl.ios.component b/vcl/vcl.ios.component
index 17e91391b855..21f73b70e705 100644
--- a/vcl/vcl.ios.component
+++ b/vcl/vcl.ios.component
@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="vcl" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.datatransfer.clipboard.iOSClipboard">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.datatransfer.clipboard.iOSClipboard"
+ constructor="vcl_SystemClipboard_get_implementation">
<service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
</implementation>
<implementation name="com.sun.star.frame.VCLSessionManagerClient"
diff --git a/vcl/vcl.macosx.component b/vcl/vcl.macosx.component
index 98339e3ce573..3ae39a371909 100644
--- a/vcl/vcl.macosx.component
+++ b/vcl/vcl.macosx.component
@@ -25,7 +25,8 @@
<implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1">
<service name="com.sun.star.datatransfer.dnd.OleDropTarget"/>
</implementation>
- <implementation name="com.sun.star.datatransfer.clipboard.AquaClipboard">
+ <implementation name="com.sun.star.datatransfer.clipboard.AquaClipboard"
+ constructor="vcl_SystemClipboard_get_implementation">
<service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
</implementation>
<implementation name="com.sun.star.frame.VCLSessionManagerClient"
diff --git a/vcl/vcl.unx.component b/vcl/vcl.unx.component
index 70b3370c6ae3..30506b721155 100644
--- a/vcl/vcl.unx.component
+++ b/vcl/vcl.unx.component
@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="vcl" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.datatransfer.X11ClipboardSupport">
+ <implementation name="com.sun.star.datatransfer.X11ClipboardSupport"
+ constructor="vcl_SystemClipboard_get_implementation">
<service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/>
</implementation>
<implementation name="com.sun.star.datatransfer.dnd.XdndDropTarget">