summaryrefslogtreecommitdiffstats
path: root/dtrans/source/win32/workbench/test_wincb.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/win32/workbench/test_wincb.cxx')
-rw-r--r--dtrans/source/win32/workbench/test_wincb.cxx38
1 files changed, 0 insertions, 38 deletions
diff --git a/dtrans/source/win32/workbench/test_wincb.cxx b/dtrans/source/win32/workbench/test_wincb.cxx
index 175c58b0ac44..a065dc002b0b 100644
--- a/dtrans/source/win32/workbench/test_wincb.cxx
+++ b/dtrans/source/win32/workbench/test_wincb.cxx
@@ -46,10 +46,8 @@
#include <process.h>
-
// my defines
-
#define TEST_CLIPBOARD
#define RDB_SYSPATH "d:\\projects\\src623\\dtrans\\wntmsci7\\bin\\applicat.rdb"
#define WINCLIPBOARD_SERVICE_NAME L"com.sun.star.datatransfer.clipboard.SystemClipboard"
@@ -58,10 +56,8 @@
#define EVT_INIT_NONSIGNALED FALSE
#define EVT_NONAME ""
-
// namesapces
-
using namespace ::rtl;
using namespace ::std;
using namespace ::cppu;
@@ -71,26 +67,18 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
-
// globales
-
Reference< XTransferable > rXTransfRead;
HANDLE g_hEvtThreadWakeup;
-
-//
-
-
class CClipboardListener : public WeakImplHelper1 < XClipboardListener >
{
public:
~CClipboardListener( );
-
// XClipboardListener
-
virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException);
virtual void SAL_CALL changedContents( const ClipboardEvent& event ) throw( RuntimeException );
};
@@ -109,19 +97,13 @@ void SAL_CALL CClipboardListener::changedContents( const ClipboardEvent& event )
//MessageBox( NULL, TEXT("Clipboard content changed"), TEXT("Info"), MB_OK | MB_ICONINFORMATION );
}
-
-//
-
-
class CTransferable : public WeakImplHelper2< XClipboardOwner, XTransferable >
{
public:
CTransferable( );
-
// XTransferable
-
virtual Any SAL_CALL getTransferData( const DataFlavor& aFlavor )
throw(UnsupportedFlavorException, IOException, RuntimeException);
@@ -129,10 +111,8 @@ public:
virtual sal_Bool SAL_CALL isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException);
-
// XClipboardOwner
-
virtual void SAL_CALL lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans )
throw(RuntimeException);
@@ -141,10 +121,8 @@ private:
OUString m_Data;
};
-
// ctor
-
CTransferable::CTransferable( ) :
m_FlavorList( 1 ),
m_Data( OUString("I bought a new bike!") )
@@ -160,10 +138,8 @@ CTransferable::CTransferable( ) :
m_FlavorList[0] = df;
}
-
// getTransferData
-
Any SAL_CALL CTransferable::getTransferData( const DataFlavor& aFlavor )
throw(UnsupportedFlavorException, IOException, RuntimeException)
{
@@ -192,20 +168,16 @@ Any SAL_CALL CTransferable::getTransferData( const DataFlavor& aFlavor )
return anyData;
}
-
// getTransferDataFlavors
-
Sequence< DataFlavor > SAL_CALL CTransferable::getTransferDataFlavors( )
throw(RuntimeException)
{
return m_FlavorList;
}
-
// isDataFlavorSupported
-
sal_Bool SAL_CALL CTransferable::isDataFlavorSupported( const DataFlavor& aFlavor )
throw(RuntimeException)
{
@@ -218,10 +190,8 @@ sal_Bool SAL_CALL CTransferable::isDataFlavorSupported( const DataFlavor& aFlavo
return sal_False;
}
-
// lostOwnership
-
void SAL_CALL CTransferable::lostOwnership(
const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans )
throw(RuntimeException)
@@ -229,10 +199,8 @@ void SAL_CALL CTransferable::lostOwnership(
//MessageBox( NULL, TEXT("No longer clipboard owner"), TEXT("Info"), MB_OK | MB_ICONINFORMATION );
}
-
// main
-
int SAL_CALL main( int nArgc, char* Argv[] )
{
// create a multi-threaded apartment; we can test only
@@ -249,10 +217,8 @@ int SAL_CALL main( int nArgc, char* Argv[] )
BOOL bValid = IsValidLocale( lcid, LCID_SUPPORTED );
GetLocaleInfoA( lcid, LOCALE_IDEFAULTANSICODEPAGE, buff, sizeof( buff ) );
-
// get the global service-manager
-
OUString rdbName = OUString( RDB_SYSPATH );
Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) );
@@ -263,10 +229,8 @@ int SAL_CALL main( int nArgc, char* Argv[] )
return(-1);
}
-
// try to get an Interface to a XFilePicker Service
-
Reference< XTransferable > rXTransf( static_cast< XTransferable* >( new CTransferable ) );
Reference< XClipboard >
@@ -305,10 +269,8 @@ int SAL_CALL main( int nArgc, char* Argv[] )
rXClipListener.clear();
xClipNotifier.clear();
-
// shutdown the service manager
-
// Cast factory to XComponent
Reference< XComponent > xComponent( g_xFactory, UNO_QUERY );