summaryrefslogtreecommitdiff
path: root/dtrans/source/os2/clipb/Os2Clipboard.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/os2/clipb/Os2Clipboard.cxx')
-rw-r--r--dtrans/source/os2/clipb/Os2Clipboard.cxx44
1 files changed, 13 insertions, 31 deletions
diff --git a/dtrans/source/os2/clipb/Os2Clipboard.cxx b/dtrans/source/os2/clipb/Os2Clipboard.cxx
index 494df04b640a..76df3e4945c4 100644
--- a/dtrans/source/os2/clipb/Os2Clipboard.cxx
+++ b/dtrans/source/os2/clipb/Os2Clipboard.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,9 +43,10 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
using namespace cppu;
using namespace osl;
-using namespace rtl;
using namespace os2;
+using ::rtl::OUString;
+
const Type CPPUTYPE_SEQINT8 = getCppuType( ( Sequence< sal_Int8 >* )0 );
const Type CPPUTYPE_OUSTRING = getCppuType( (OUString*)0 );
@@ -74,7 +76,6 @@ MRESULT EXPENTRY DtransObjWndProc( HWND hWnd, ULONG nMsg, MPARAM nMP1, MPARAM nM
Os2Clipboard* os2Clipboard = GetWindowPtr( hWnd);
if (os2Clipboard)
{
- //MutexGuard aGuard(os2Clipboard->m_aMutex);
debug_printf("WM_DRAWCLIPBOARD os2Clipboard %08x\n", os2Clipboard);
if (os2Clipboard->m_bInSetClipboardData)
{
@@ -109,26 +110,6 @@ Os2Clipboard::Os2Clipboard() :
hText = 0;
hBitmap = 0;
-#if 0
- // register object class
- if ( WinRegisterClass( hAB, (PSZ)DTRANS_OBJ_CLASSNAME,
- (PFNWP)DtransObjWndProc, 0, sizeof(ULONG) ))
- {
- APIRET rc;
- // create object window to get clip viewer messages
- hObjWnd = WinCreateWindow( HWND_OBJECT, (PCSZ)DTRANS_OBJ_CLASSNAME,
- (PCSZ)"", 0, 0, 0, 0, 0,
- HWND_OBJECT, HWND_TOP,
- 222, NULL, NULL);
- // store pointer
- SetWindowPtr( hObjWnd, this);
- // register the viewer window
- rc = WinOpenClipbrd(hAB);
- rc = WinSetClipbrdViewer(hAB, hObjWnd);
- rc = WinCloseClipbrd(hAB);
- }
-#endif
-
}
Os2Clipboard::~Os2Clipboard()
@@ -153,7 +134,7 @@ void SAL_CALL Os2Clipboard::initialize( const Sequence< Any >& aArguments )
OUString SAL_CALL Os2Clipboard::getImplementationName() throw( RuntimeException )
{
debug_printf("Os2Clipboard::getImplementationName\n");
- return OUString::createFromAscii( OS2_CLIPBOARD_IMPL_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( OS2_CLIPBOARD_IMPL_NAME ));
}
sal_Bool SAL_CALL Os2Clipboard::supportsService( const OUString& ServiceName ) throw( RuntimeException )
@@ -247,7 +228,7 @@ void SAL_CALL Os2Clipboard::setContents( const Reference< XTransferable >& xTran
}
}
-#if OSL_DEBUG_LEVEL>0
+#if OSL_DEBUG_LEVEL > 0
// dump list of available mimetypes
Sequence< DataFlavor > aFlavors( m_aContents->getTransferDataFlavors() );
for( int i = 0; i < aFlavors.getLength(); i++ )
@@ -256,10 +237,10 @@ void SAL_CALL Os2Clipboard::setContents( const Reference< XTransferable >& xTran
#endif
// we can only export text or bitmap
- DataFlavor nFlavorText( OUString::createFromAscii( "text/plain;charset=utf-16" ),
- OUString::createFromAscii( "Unicode-Text" ), CPPUTYPE_OUSTRING);
- DataFlavor nFlavorBitmap( OUString::createFromAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ),
- OUString::createFromAscii( "Bitmap" ), CPPUTYPE_DEFAULT);
+ DataFlavor nFlavorText( OUString(RTL_CONSTASCII_USTRINGPARAM("text/plain;charset=utf-16")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Unicode-Text")), CPPUTYPE_OUSTRING);
+ DataFlavor nFlavorBitmap( OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" )),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Bitmap")), CPPUTYPE_DEFAULT);
// try text transfer data (if any)
PSZ pSharedText = NULL;
@@ -409,14 +390,14 @@ void SAL_CALL Os2Clipboard::notifyAllClipboardListener( )
}
catch(RuntimeException&)
{
- OSL_ENSURE( false, "RuntimeException caught" );
+ OSL_FAIL( "RuntimeException caught" );
debug_printf( "RuntimeException caught" );
}
}
}
catch(const ::com::sun::star::lang::DisposedException&)
{
- OSL_ENSURE(false, "Service Manager disposed");
+ OSL_FAIL("Service Manager disposed");
debug_printf( "Service Manager disposed");
// no further clipboard changed notifications
@@ -433,7 +414,7 @@ void SAL_CALL Os2Clipboard::notifyAllClipboardListener( )
Sequence< OUString > SAL_CALL Os2Clipboard_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii( OS2_CLIPBOARD_SERVICE_NAME );
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( OS2_CLIPBOARD_SERVICE_NAME ));
return aRet;
}
@@ -445,3 +426,4 @@ Reference< XInterface > SAL_CALL Os2Clipboard_createInstance(
return Reference < XInterface >( ( OWeakObject * ) new Os2Clipboard());
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */