summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dtrans/source/win32/clipb/WinClipboard.cxx2
-rw-r--r--dtrans/source/win32/clipb/WinClipboard.hxx8
-rw-r--r--offapi/UnoApi_offapi.mk5
-rw-r--r--offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl37
-rw-r--r--offapi/com/sun/star/datatransfer/clipboard/XSystemClipboard.idl63
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx12
-rw-r--r--vcl/aqua/source/dtrans/aqua_clipboard.cxx2
-rw-r--r--vcl/aqua/source/dtrans/aqua_clipboard.hxx6
-rw-r--r--vcl/source/components/dtranscomp.cxx12
-rw-r--r--vcl/source/window/window.cxx41
-rw-r--r--vcl/unx/generic/dtrans/X11_clipboard.cxx8
-rw-r--r--vcl/unx/generic/dtrans/X11_clipboard.hxx12
12 files changed, 94 insertions, 114 deletions
diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx
index 5a2c1e9daac6..6f5874483830 100644
--- a/dtrans/source/win32/clipb/WinClipboard.cxx
+++ b/dtrans/source/win32/clipb/WinClipboard.cxx
@@ -59,7 +59,7 @@ namespace
//------------------------------------------------------------------------
/*XEventListener,*/
CWinClipboard::CWinClipboard( const Reference< XComponentContext >& rxContext, const OUString& aClipboardName ) :
- WeakComponentImplHelper3< XSystemClipboard, XFlushableClipboard, XServiceInfo >( m_aCbListenerMutex ),
+ WeakComponentImplHelper4< XClipboardEx, XFlushableClipboard, XClipboardNotifier, XServiceInfo >( m_aCbListenerMutex ),
m_xContext( rxContext )
{
m_pImpl.reset( new CWinClipbImpl( aClipboardName, this ) );
diff --git a/dtrans/source/win32/clipb/WinClipboard.hxx b/dtrans/source/win32/clipb/WinClipboard.hxx
index 608f9e9ceece..3b36ae7cd3e4 100644
--- a/dtrans/source/win32/clipb/WinClipboard.hxx
+++ b/dtrans/source/win32/clipb/WinClipboard.hxx
@@ -23,13 +23,12 @@
#include <rtl/ustring.hxx>
#include <sal/types.h>
-#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/compbase4.hxx>
#include <com/sun/star/datatransfer/XTransferable.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
-#include <com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp>
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -63,9 +62,10 @@ protected:
class CWinClipboard :
public CWinClipboardDummy,
- public cppu::WeakComponentImplHelper3<
- ::com::sun::star::datatransfer::clipboard::XSystemClipboard,
+ public cppu::WeakComponentImplHelper4<
+ ::com::sun::star::datatransfer::clipboard::XClipboardEx, \
::com::sun::star::datatransfer::clipboard::XFlushableClipboard,
+ ::com::sun::star::datatransfer::clipboard::XClipboardNotifier,
::com::sun::star::lang::XServiceInfo >
{
public:
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index db062c4e576a..63ec527cfc93 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -105,9 +105,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransf
DataFormatTranslator \
MimeContentTypeFactory \
))
-$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransfer/clipboard,\
- SystemClipboard \
-))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment,\
ExtensionManager \
PackageInformationProvider \
@@ -711,6 +708,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/configu
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/datatransfer/clipboard,\
ClipboardManager \
GenericClipboard \
+ SystemClipboard \
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/datatransfer/dnd,\
OleDragSource \
@@ -2118,7 +2116,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/datatransfer/cli
XClipboardNotifier \
XClipboardOwner \
XFlushableClipboard \
- XSystemClipboard \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/datatransfer/dnd,\
DNDConstants \
diff --git a/offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl b/offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl
index b81dec5c4782..374c7e8de5db 100644
--- a/offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl
+++ b/offapi/com/sun/star/datatransfer/clipboard/SystemClipboard.idl
@@ -20,14 +20,17 @@
#ifndef __com_sun_star_datatransfer_clipboard_SystemClipboard_idl__
#define __com_sun_star_datatransfer_clipboard_SystemClipboard_idl__
-#include <com/sun/star/awt/XDisplayConnection.idl>
-#include <com/sun/star/datatransfer/clipboard/XSystemClipboard.idl>
-#include <com/sun/star/script/XInvocation.idl>
+#include <com/sun/star/lang/XComponent.idl>
+#include <com/sun/star/lang/XInitialization.idl>
module com { module sun { module star { module datatransfer { module clipboard {
+ published interface XClipboardEx;
+ published interface XClipboardNotifier;
+ published interface XFlushableClipboard;
+
/** The system clipboard service builds a bridge to the OS specific clipboard
interfaces.
@@ -39,14 +42,30 @@ module com { module sun { module star { module datatransfer { module clipboard {
</ul>
It is possible to use clipboards for different selections simultaneously.</p>
*/
-published service SystemClipboard : XSystemClipboard
+published service SystemClipboard
{
- createDefault();
+ /** Provides access to the clipboard content.
+ */
+ interface XClipboardEx;
+
+ /** Provides the ability to request notifications on content changes.
+ */
+ interface XClipboardNotifier;
+
+ /** Provides the ability to render the complete clipboard content. This
+ interface is only available if the method
+ <member scope="com::sun::star::datatransfer::clipboard">XClipboardEx::getRenderingCapabilities()</member>
+ returns Persistant
+ */
+ [optional] interface XFlushableClipboard;
+
+ /** Provides the ability to initialize the clipboard
+ */
+ [optional] interface com::sun::star::lang::XInitialization;
- /** This method is only valid for unix systems (excluding MacOS) */
- createUnix([in] com::sun::star::awt::XDisplayConnection DisplayConnection,
- [in] string ClipboardName,
- [in] com::sun::star::script::XInvocation BmpConverter);
+ /** For shutdown and listener support.
+ */
+ interface com::sun::star::lang::XComponent;
};
diff --git a/offapi/com/sun/star/datatransfer/clipboard/XSystemClipboard.idl b/offapi/com/sun/star/datatransfer/clipboard/XSystemClipboard.idl
deleted file mode 100644
index 669180d810a7..000000000000
--- a/offapi/com/sun/star/datatransfer/clipboard/XSystemClipboard.idl
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- 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_datatransfer_clipboard_XSystemClipboard_idl__
-#define __com_sun_star_datatransfer_clipboard_XSystemClipboard_idl__
-
-#include <com/sun/star/lang/XComponent.idl>
-#include <com/sun/star/datatransfer/clipboard/XClipboardEx.idl>
-#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.idl>
-#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.idl>
-
-module com { module sun { module star { module datatransfer { module clipboard {
-
-
-/**
- Provides a unified interface for new-style service SystemClipboard.
-
- @since LibreOffice 4.1
-*/
-published interface XSystemClipboard
-{
- /** Provides access to the clipboard content.
- */
- interface XClipboardEx;
-
- /** Provides the ability to request notifications on content changes.
- */
- interface XClipboardNotifier;
-
- /** Provides the ability to render the complete clipboard content. This
- interface is only available if the method
- <member scope="com::sun::star::datatransfer::clipboard">XClipboardEx::getRenderingCapabilities()</member>
- returns Persistant
- */
- [optional] interface XFlushableClipboard;
-
- /** For shutdown and listener support.
- */
- interface com::sun::star::lang::XComponent;
-};
-
-
-}; }; }; }; };
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 21c5b6d3d4d4..4f38a2927b65 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -42,7 +42,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
#include <cppuhelper/typeprovider.hxx>
#include <osl/conditn.hxx>
#include <rtl/uuid.h>
@@ -1333,10 +1332,13 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
{
if( !mxClipboard.is() )
{
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- // remember clipboard here
- mxClipboard = ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > (
- ::com::sun::star::datatransfer::clipboard::SystemClipboard::createDefault(xContext), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ if ( xFactory.is() )
+ {
+ // remember clipboard here
+ mxClipboard = ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > (
+ xFactory->createInstance( ::rtl::OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), ::com::sun::star::uno::UNO_QUERY );
+ }
}
return mxClipboard;
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
index 383c7488aa2f..eaaf7e8f0698 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx
@@ -81,7 +81,7 @@ Sequence<OUString> clipboard_getSupportedServiceNames()
AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard) :
- WeakComponentImplHelper3<XSystemClipboard, XFlushableClipboard, XServiceInfo>(m_aMutex),
+ WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex),
mIsSystemPasteboard(bUseSystemPasteboard)
{
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.hxx b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
index 2e7670588ede..855297fbcaf9 100644
--- a/vcl/aqua/source/dtrans/aqua_clipboard.hxx
+++ b/vcl/aqua/source/dtrans/aqua_clipboard.hxx
@@ -23,13 +23,12 @@
#include "DataFlavorMapping.hxx"
#include <rtl/ustring.hxx>
#include <sal/types.h>
-#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/compbase4.hxx>
#include <com/sun/star/datatransfer/XTransferable.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
-#include <com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp>
#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -64,7 +63,8 @@ class AquaClipboard;
class AquaClipboard : public ::cppu::BaseMutex,
- public ::cppu::WeakComponentImplHelper3< com::sun::star::datatransfer::clipboard::XSystemClipboard,
+ public ::cppu::WeakComponentImplHelper4< com::sun::star::datatransfer::clipboard::XClipboardEx,
+ com::sun::star::datatransfer::clipboard::XClipboardNotifier,
com::sun::star::datatransfer::clipboard::XFlushableClipboard,
com::sun::star::lang::XServiceInfo >,
private ::boost::noncopyable
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index 650fce07f7fc..81ef30a9f40e 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -34,13 +34,13 @@
#include "com/sun/star/datatransfer/clipboard/XClipboardEx.hpp"
#include "com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp"
#include "com/sun/star/datatransfer/clipboard/XClipboardListener.hpp"
-#include "com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp"
#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
#include "com/sun/star/datatransfer/dnd/DNDConstants.hpp"
#include "cppuhelper/compbase1.hxx"
#include "cppuhelper/compbase2.hxx"
+#include "cppuhelper/compbase3.hxx"
#include "cppuhelper/implbase1.hxx"
using namespace com::sun::star;
@@ -53,8 +53,9 @@ namespace vcl
{
// generic implementation to satisfy SalInstance
class GenericClipboard :
- public cppu::WeakComponentImplHelper2 <
- datatransfer::clipboard::XSystemClipboard,
+ public cppu::WeakComponentImplHelper3 <
+ datatransfer::clipboard::XClipboardEx,
+ datatransfer::clipboard::XClipboardNotifier,
XServiceInfo
>
{
@@ -68,8 +69,9 @@ class GenericClipboard :
public:
- GenericClipboard() : cppu::WeakComponentImplHelper2<
- datatransfer::clipboard::XSystemClipboard,
+ GenericClipboard() : cppu::WeakComponentImplHelper3<
+ datatransfer::clipboard::XClipboardEx,
+ datatransfer::clipboard::XClipboardNotifier,
XServiceInfo
>( m_aMutex )
{}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 1018bb80efcd..470f91225127 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -84,7 +84,6 @@
#include "com/sun/star/datatransfer/dnd/XDragSource.hpp"
#include "com/sun/star/datatransfer/dnd/XDropTarget.hpp"
#include "com/sun/star/datatransfer/clipboard/XClipboard.hpp"
-#include "com/sun/star/datatransfer/clipboard/SystemClipboard.hpp"
#include "com/sun/star/lang/XInitialization.hpp"
#include "com/sun/star/lang/XComponent.hpp"
#include "com/sun/star/lang/XServiceName.hpp"
@@ -8434,15 +8433,28 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
try
{
- uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
- Reference<XSystemClipboard> xSystemClipboard;
+ uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
+
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), UNO_QUERY );
+
#if defined(UNX) && !defined(MACOSX) // unix clipboard needs to be initialized
- xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "CLIPBOARD", vcl::createBmpConverter() );
-#else
- xSystemClipboard = SystemClipboard::createDefault(xContext);
+ if( mpWindowImpl->mpFrameData->mxClipboard.is() )
+ {
+ uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY );
+
+ if( xInit.is() )
+ {
+ Sequence< Any > aArgumentList( 3 );
+ aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
+
+ xInit->initialize( aArgumentList );
+ }
+ }
#endif
- mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY );
}
+
// createInstance can throw any exception
catch (const Exception&)
{
@@ -8469,12 +8481,19 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
{
try
{
- uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
-
#if defined(UNX) && !defined(MACOSX)
- Reference<XSystemClipboard> xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "PRIMARY", vcl::createBmpConverter() );
- mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xSystemClipboard, UNO_QUERY );
+ uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
+
+ Sequence< Any > aArgumentList( 3 );
+ aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
+ aArgumentList[ 1 ] = makeAny( OUString("PRIMARY") );
+ aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
+
+ mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
+ OUString("com.sun.star.datatransfer.clipboard.SystemClipboard"), aArgumentList ), UNO_QUERY );
# else
+ uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+
static uno::Reference< XClipboard > s_xSelection(
xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY );
diff --git a/vcl/unx/generic/dtrans/X11_clipboard.cxx b/vcl/unx/generic/dtrans/X11_clipboard.cxx
index 6325e19e7f1e..aec38f0303c3 100644
--- a/vcl/unx/generic/dtrans/X11_clipboard.cxx
+++ b/vcl/unx/generic/dtrans/X11_clipboard.cxx
@@ -46,9 +46,11 @@ using namespace x11;
X11Clipboard::X11Clipboard( SelectionManager& rManager, Atom aSelection ) :
- ::cppu::WeakComponentImplHelper2<
- ::com::sun::star::datatransfer::clipboard::XSystemClipboard,
- ::com::sun::star::lang::XServiceInfo
+ ::cppu::WeakComponentImplHelper4<
+ ::com::sun::star::datatransfer::clipboard::XClipboardEx,
+ ::com::sun::star::datatransfer::clipboard::XClipboardNotifier,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization
>( rManager.getMutex() ),
m_rSelectionManager( rManager ),
diff --git a/vcl/unx/generic/dtrans/X11_clipboard.hxx b/vcl/unx/generic/dtrans/X11_clipboard.hxx
index 18c08b036f7e..ea4535819834 100644
--- a/vcl/unx/generic/dtrans/X11_clipboard.hxx
+++ b/vcl/unx/generic/dtrans/X11_clipboard.hxx
@@ -23,9 +23,9 @@
#include <X11_selection.hxx>
#include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
+
#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
-#include <com/sun/star/datatransfer/clipboard/XSystemClipboard.hpp>
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase4.hxx>
// ------------------------------------------------------------------------
@@ -34,9 +34,11 @@
namespace x11 {
class X11Clipboard :
- public ::cppu::WeakComponentImplHelper2 <
- ::com::sun::star::datatransfer::clipboard::XSystemClipboard,
- ::com::sun::star::lang::XServiceInfo
+ public ::cppu::WeakComponentImplHelper4 <
+ ::com::sun::star::datatransfer::clipboard::XClipboardEx,
+ ::com::sun::star::datatransfer::clipboard::XClipboardNotifier,
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization
>,
public SelectionAdaptor
{