diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 12:21:42 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-31 12:21:42 +0000 |
commit | e087669e56f0683e5a374c5126208e2bd23525b0 (patch) | |
tree | f60440576e052043b06cfd5f2b9fde9cdc526f9b | |
parent | 72a6854414965bb9f89603c3c1db4b120a62a9c7 (diff) |
INTEGRATION: CWS vcl35 (1.1.698); FILE MERGED
2005/01/13 18:37:21 pl 1.1.698.1: #i39157# thanks to fs: copy assertions from clipboard window
-rw-r--r-- | vcl/source/app/unohelp2.cxx | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx index d82de67d4f08..38ce48c3f0c7 100644 --- a/vcl/source/app/unohelp2.cxx +++ b/vcl/source/app/unohelp2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unohelp2.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: tbe $ $Date: 2002-03-18 17:36:18 $ + * last change: $Author: rt $ $Date: 2005-01-31 13:21:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,9 +71,21 @@ #include <sot/formats.hxx> #endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif +#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARD_HPP_ +#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#endif +#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XFLUSHABLECLIPBOARD_HPP_ +#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp> +#endif -using namespace ::com::sun::star; +using namespace ::com::sun::star; namespace vcl { namespace unohelper { @@ -85,6 +97,30 @@ namespace vcl { namespace unohelper { { } + void TextDataObject::CopyStringTo( const String& rContent, + const uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard ) + { + DBG_ASSERT( rxClipboard.is(), "TextDataObject::CopyStringTo: invalid clipboard!" ); + if ( !rxClipboard.is() ) + return; + + TextDataObject* pDataObj = new TextDataObject( rContent ); + + const sal_uInt32 nRef = Application::ReleaseSolarMutex(); + try + { + rxClipboard->setContents( pDataObj, NULL ); + + uno::Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( rxClipboard, uno::UNO_QUERY ); + if( xFlushableClipboard.is() ) + xFlushableClipboard->flushClipboard(); + } + catch( const uno::Exception& ) + { + } + Application::AcquireSolarMutex( nRef ); + } + // ::com::sun::star::uno::XInterface uno::Any TextDataObject::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException) { |