diff options
author | Alexander Wilms <f.alexander.wilms@gmail.com> | 2014-02-22 21:20:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-23 03:38:49 +0000 |
commit | 0ce0c369aa8880dff9fe874ba85ec6f52ee37ddf (patch) | |
tree | 5024cba9f9ea5e3b23ea26025323f6aef39488d0 /dtrans/source | |
parent | b81ac16e65b311d6e43c05c22c65d2040c9d7e04 (diff) |
Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dtrans/source')
28 files changed, 753 insertions, 754 deletions
diff --git a/dtrans/source/cnttype/mcnttfactory.cxx b/dtrans/source/cnttype/mcnttfactory.cxx index 6d955d262245..7bb69a31f1ae 100644 --- a/dtrans/source/cnttype/mcnttfactory.cxx +++ b/dtrans/source/cnttype/mcnttfactory.cxx @@ -24,9 +24,9 @@ #define MIMECONTENTTYPEFACTORY_IMPL_NAME "com.sun.star.datatransfer.MimeCntTypeFactory" -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace ::rtl; using namespace ::osl; @@ -35,9 +35,9 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::datatransfer; -//------------------------------------------------------------------------ + // helper functions -//------------------------------------------------------------------------ + namespace { @@ -49,17 +49,17 @@ namespace } } -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CMimeContentTypeFactory::CMimeContentTypeFactory() { } -//------------------------------------------------------------------------ + // createMimeContentType -//------------------------------------------------------------------------ + Reference< XMimeContentType > CMimeContentTypeFactory::createMimeContentType( const OUString& aContentType ) throw( IllegalArgumentException, RuntimeException ) @@ -68,9 +68,9 @@ Reference< XMimeContentType > CMimeContentTypeFactory::createMimeContentType( co return Reference< XMimeContentType >( new CMimeContentType( aContentType ) ); } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + OUString SAL_CALL CMimeContentTypeFactory::getImplementationName( ) throw( RuntimeException ) @@ -85,9 +85,9 @@ sal_Bool SAL_CALL CMimeContentTypeFactory::supportsService( const OUString& Serv return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + Sequence< OUString > SAL_CALL CMimeContentTypeFactory::getSupportedServiceNames( ) throw( RuntimeException ) diff --git a/dtrans/source/cnttype/mcnttype.cxx b/dtrans/source/cnttype/mcnttype.cxx index 150668d94895..7381e3660efa 100644 --- a/dtrans/source/cnttype/mcnttype.cxx +++ b/dtrans/source/cnttype/mcnttype.cxx @@ -19,9 +19,9 @@ #include "mcnttype.hxx" -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -30,54 +30,54 @@ using namespace std; using namespace osl; -//------------------------------------------------------------------------ + // constants -//------------------------------------------------------------------------ + const char TSPECIALS[] = "()<>@,;:\\\"/[]?="; const char TOKEN[] = "!#$%&'*+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz{|}~."; const char SPACE[] = " "; const char SEMICOLON[] = ";"; -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CMimeContentType::CMimeContentType( const OUString& aCntType ) { init( aCntType ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::getMediaType( ) throw(RuntimeException) { return m_MediaType; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::getMediaSubtype( ) throw(RuntimeException) { return m_MediaSubtype; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::getFullMediaType( ) throw(RuntimeException) { return m_MediaType + "/" + m_MediaSubtype; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL CMimeContentType::getParameters( ) throw(RuntimeException) { @@ -97,9 +97,9 @@ Sequence< OUString > SAL_CALL CMimeContentType::getParameters( ) throw(RuntimeEx return seqParams; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CMimeContentType::hasParameter( const OUString& aName ) throw(RuntimeException) { @@ -107,9 +107,9 @@ sal_Bool SAL_CALL CMimeContentType::hasParameter( const OUString& aName ) throw( return ( m_ParameterMap.end( ) != m_ParameterMap.find( aName ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::getParameterValue( const OUString& aName ) throw(NoSuchElementException, RuntimeException) { @@ -121,9 +121,9 @@ OUString SAL_CALL CMimeContentType::getParameterValue( const OUString& aName ) t return m_ParameterMap.find( aName )->second; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::init( const OUString& aCntType ) throw( IllegalArgumentException ) { @@ -136,9 +136,9 @@ void SAL_CALL CMimeContentType::init( const OUString& aCntType ) throw( IllegalA type(); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::getSym( void ) { @@ -152,9 +152,9 @@ void SAL_CALL CMimeContentType::getSym( void ) m_nxtSym = OUString( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::acceptSym( const OUString& pSymTlb ) { @@ -164,9 +164,9 @@ void SAL_CALL CMimeContentType::acceptSym( const OUString& pSymTlb ) getSym(); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::skipSpaces( void ) { @@ -174,9 +174,9 @@ void SAL_CALL CMimeContentType::skipSpaces( void ) getSym( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::type( void ) { @@ -207,9 +207,9 @@ void SAL_CALL CMimeContentType::type( void ) subtype( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::subtype( void ) { @@ -237,9 +237,9 @@ void SAL_CALL CMimeContentType::subtype( void ) trailer(); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::trailer( void ) { @@ -282,9 +282,9 @@ void SAL_CALL CMimeContentType::trailer( void ) } } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::pName( ) { @@ -305,9 +305,9 @@ OUString SAL_CALL CMimeContentType::pName( ) return pname; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::pValue( ) { @@ -339,11 +339,11 @@ OUString SAL_CALL CMimeContentType::pValue( ) return pvalue; } -//------------------------------------------------------------------------ + // the following combinations within a quoted value are not allowed: // '";' (quote sign followed by semicolon) and '" ' (quote sign followed // by space) -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::quotedPValue( ) { @@ -375,9 +375,9 @@ OUString SAL_CALL CMimeContentType::quotedPValue( ) return pvalue; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CMimeContentType::nonquotedPValue( ) { @@ -398,9 +398,9 @@ OUString SAL_CALL CMimeContentType::nonquotedPValue( ) return pvalue; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CMimeContentType::comment( void ) { @@ -415,9 +415,9 @@ void SAL_CALL CMimeContentType::comment( void ) } } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CMimeContentType::isInRange( const OUString& aChr, const OUString& aRange ) { diff --git a/dtrans/source/cnttype/mctfentry.cxx b/dtrans/source/cnttype/mctfentry.cxx index a8e68ae48d9f..87ff14bf872d 100644 --- a/dtrans/source/cnttype/mctfentry.cxx +++ b/dtrans/source/cnttype/mctfentry.cxx @@ -23,9 +23,9 @@ #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp> #include "mcnttfactory.hxx" -//----------------------------------------------------------------- + // some defines -//----------------------------------------------------------------- + // the service names #define MIMECONTENTTYPEFACTORY_SERVICE_NAME "com.sun.star.datatransfer.MimeContentTypeFactory" @@ -33,9 +33,9 @@ // the implementation names #define MIMECONTENTTYPEFACTORY_IMPL_NAME "com.sun.star.datatransfer.MimeCntTypeFactory" -//----------------------------------------------------------------------------------------------------------- + // namespace directives -//----------------------------------------------------------------------------------------------------------- + using namespace ::rtl ; using namespace ::cppu ; @@ -44,18 +44,18 @@ using namespace ::com::sun::star::registry ; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer; -//----------------------------------------------------------------- + // create a static object to initialize the shell9x library -//----------------------------------------------------------------- + namespace { - //----------------------------------------------------------------------------------------------------------- + // functions to create a new Clipboad instance; is needed by factory helper implementation // @param rServiceManager - service manager, useful if the component needs other uno services // so we should give it to every UNO-Implementation component - //----------------------------------------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& ) { @@ -65,10 +65,10 @@ namespace extern "C" { -//---------------------------------------------------------------------- + // component_getFactory // returns a factory to create XFilePicker-Services -//---------------------------------------------------------------------- + SAL_DLLPUBLIC_EXPORT void* SAL_CALL mcnttype_component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/dtrans/source/cnttype/wbench/testcnttype.cxx b/dtrans/source/cnttype/wbench/testcnttype.cxx index 2bc3e990b626..1c55c2b7f1a5 100644 --- a/dtrans/source/cnttype/wbench/testcnttype.cxx +++ b/dtrans/source/cnttype/wbench/testcnttype.cxx @@ -32,16 +32,16 @@ #include <vector> -//------------------------------------------------------------- + // my defines -//------------------------------------------------------------- + #define TEST_CLIPBOARD #define RDB_SYSPATH "d:\\projects\\src621\\dtrans\\wntmsci7\\bin\\applicat.rdb" -//------------------------------------------------------------ + // namesapces -//------------------------------------------------------------ + using namespace ::rtl; using namespace ::std; @@ -51,9 +51,9 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; -//---------------------------------------------------------------- + // -//---------------------------------------------------------------- + void ShutdownServiceMgr( Reference< XMultiServiceFactory >& SrvMgr ) { @@ -68,9 +68,9 @@ void ShutdownServiceMgr( Reference< XMultiServiceFactory >& SrvMgr ) SrvMgr.clear(); } -//---------------------------------------------------------------- + // -//---------------------------------------------------------------- + sal_Bool readCntTypesFromFileIntoVector( char* fname, vector< string >& vecData ) { @@ -95,9 +95,9 @@ sal_Bool readCntTypesFromFileIntoVector( char* fname, vector< string >& vecData return sal_True; } -//---------------------------------------------------------------- + // -//---------------------------------------------------------------- + sal_Bool processCntTypesAndWriteResultIntoFile( char* fname, vector< string >& vecData, Reference< XMimeContentTypeFactory > cnttypeFactory ) { @@ -152,18 +152,18 @@ sal_Bool processCntTypesAndWriteResultIntoFile( char* fname, vector< string >& v return sal_True; } -//---------------------------------------------------------------- + // main -//---------------------------------------------------------------- + int SAL_CALL main( int nArgc, char* argv[] ) { if ( nArgc != 3 ) printf( "Start with: testcnttype input-file output-file\n" ); - //------------------------------------------------- + // get the global service-manager - //------------------------------------------------- + OUString rdbName = OUString( RDB_SYSPATH ); Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) ); @@ -198,9 +198,9 @@ int SAL_CALL main( int nArgc, char* argv[] ) ShutdownServiceMgr( g_xFactory ); } - //-------------------------------------------------- + // shutdown the service manager - //-------------------------------------------------- + ShutdownServiceMgr( g_xFactory ); diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx index 6d130615d61a..01955d60acd6 100644 --- a/dtrans/source/generic/clipboardmanager.cxx +++ b/dtrans/source/generic/clipboardmanager.cxx @@ -32,7 +32,7 @@ using namespace std; using ::dtrans::ClipboardManager; -// ------------------------------------------------------------------------ + ClipboardManager::ClipboardManager(): WeakComponentImplHelper3< XClipboardManager, XEventListener, XServiceInfo > (m_aMutex), @@ -40,13 +40,13 @@ ClipboardManager::ClipboardManager(): { } -// ------------------------------------------------------------------------ + ClipboardManager::~ClipboardManager() { } -// ------------------------------------------------------------------------ + OUString SAL_CALL ClipboardManager::getImplementationName( ) throw(RuntimeException) @@ -60,7 +60,7 @@ sal_Bool SAL_CALL ClipboardManager::supportsService( const OUString& ServiceName return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL ClipboardManager::getSupportedServiceNames( ) throw(RuntimeException) @@ -68,7 +68,7 @@ Sequence< OUString > SAL_CALL ClipboardManager::getSupportedServiceNames( ) return ClipboardManager_getSupportedServiceNames(); } -// ------------------------------------------------------------------------ + Reference< XClipboard > SAL_CALL ClipboardManager::getClipboard( const OUString& aName ) throw(NoSuchElementException, RuntimeException) @@ -89,7 +89,7 @@ Reference< XClipboard > SAL_CALL ClipboardManager::getClipboard( const OUString& throw NoSuchElementException(aName, static_cast < XClipboardManager * > (this)); } -// ------------------------------------------------------------------------ + void SAL_CALL ClipboardManager::addClipboard( const Reference< XClipboard >& xClipboard ) throw(IllegalArgumentException, ElementExistException, RuntimeException) @@ -129,7 +129,7 @@ void SAL_CALL ClipboardManager::addClipboard( const Reference< XClipboard >& xCl } } -// ------------------------------------------------------------------------ + void SAL_CALL ClipboardManager::removeClipboard( const OUString& aName ) throw(RuntimeException) @@ -139,7 +139,7 @@ void SAL_CALL ClipboardManager::removeClipboard( const OUString& aName ) m_aClipboardMap.erase(aName.getLength() ? aName : m_aDefaultName ); } -// ------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL ClipboardManager::listClipboardNames() throw(RuntimeException) @@ -163,7 +163,7 @@ Sequence< OUString > SAL_CALL ClipboardManager::listClipboardNames() return aRet; } -// ------------------------------------------------------------------------ + void SAL_CALL ClipboardManager::dispose() throw(RuntimeException) @@ -211,7 +211,7 @@ void SAL_CALL ClipboardManager::dispose() } } -// ------------------------------------------------------------------------ + void SAL_CALL ClipboardManager::disposing( const EventObject& event ) throw(RuntimeException) @@ -222,7 +222,7 @@ void SAL_CALL ClipboardManager::disposing( const EventObject& event ) removeClipboard(xClipboard->getName()); } -// ------------------------------------------------------------------------ + Reference< XInterface > SAL_CALL ClipboardManager_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/) @@ -230,7 +230,7 @@ Reference< XInterface > SAL_CALL ClipboardManager_createInstance( return Reference < XInterface >( ( OWeakObject * ) new ClipboardManager()); } -// ------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL ClipboardManager_getSupportedServiceNames() { diff --git a/dtrans/source/generic/generic_clipboard.cxx b/dtrans/source/generic/generic_clipboard.cxx index b79f3d98a695..1f22408555e6 100644 --- a/dtrans/source/generic/generic_clipboard.cxx +++ b/dtrans/source/generic/generic_clipboard.cxx @@ -37,13 +37,13 @@ GenericClipboard::GenericClipboard() : { } -// ------------------------------------------------------------------------ + GenericClipboard::~GenericClipboard() { } -// ------------------------------------------------------------------------ + void SAL_CALL GenericClipboard::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException) @@ -59,7 +59,7 @@ void SAL_CALL GenericClipboard::initialize( const Sequence< Any >& aArguments ) } } -// ------------------------------------------------------------------------ + OUString SAL_CALL GenericClipboard::getImplementationName( ) throw(RuntimeException) @@ -73,7 +73,7 @@ sal_Bool SAL_CALL GenericClipboard::supportsService( const OUString& ServiceName return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL GenericClipboard::getSupportedServiceNames( ) throw(RuntimeException) @@ -81,7 +81,7 @@ Sequence< OUString > SAL_CALL GenericClipboard::getSupportedServiceNames( ) return GenericClipboard_getSupportedServiceNames(); } -// ------------------------------------------------------------------------ + Reference< XTransferable > SAL_CALL GenericClipboard::getContents() throw(RuntimeException) @@ -90,7 +90,7 @@ Reference< XTransferable > SAL_CALL GenericClipboard::getContents() return m_aContents; } -// ------------------------------------------------------------------------ + void SAL_CALL GenericClipboard::setContents(const Reference< XTransferable >& xTrans, const Reference< XClipboardOwner >& xClipboardOwner ) @@ -128,7 +128,7 @@ void SAL_CALL GenericClipboard::setContents(const Reference< XTransferable >& xT } } -// ------------------------------------------------------------------------ + OUString SAL_CALL GenericClipboard::getName() throw(RuntimeException) @@ -136,7 +136,7 @@ OUString SAL_CALL GenericClipboard::getName() return m_aName; } -// ------------------------------------------------------------------------ + sal_Int8 SAL_CALL GenericClipboard::getRenderingCapabilities() throw(RuntimeException) @@ -145,7 +145,7 @@ sal_Int8 SAL_CALL GenericClipboard::getRenderingCapabilities() } -// ------------------------------------------------------------------------ + void SAL_CALL GenericClipboard::addClipboardListener( const Reference< XClipboardListener >& listener ) throw(RuntimeException) @@ -157,7 +157,7 @@ void SAL_CALL GenericClipboard::addClipboardListener( const Reference< XClipboar rBHelper.aLC.addInterface( getCppuType( (const ::com::sun::star::uno::Reference< XClipboardListener > *) 0), listener ); } -// ------------------------------------------------------------------------ + void SAL_CALL GenericClipboard::removeClipboardListener( const Reference< XClipboardListener >& listener ) throw(RuntimeException) @@ -168,7 +168,7 @@ void SAL_CALL GenericClipboard::removeClipboardListener( const Reference< XClipb rBHelper.aLC.removeInterface( getCppuType( (const Reference< XClipboardListener > *) 0 ), listener ); \ } -// ------------------------------------------------------------------------ + Sequence< OUString > SAL_CALL GenericClipboard_getSupportedServiceNames() { @@ -177,7 +177,7 @@ Sequence< OUString > SAL_CALL GenericClipboard_getSupportedServiceNames() return aRet; } -// ------------------------------------------------------------------------ + Reference< XInterface > SAL_CALL GenericClipboard_createInstance( const Reference< XMultiServiceFactory > & /*xMultiServiceFactory*/) diff --git a/dtrans/source/test/test_dtrans.cxx b/dtrans/source/test/test_dtrans.cxx index 7ba4de90e328..11ac2174915b 100644 --- a/dtrans/source/test/test_dtrans.cxx +++ b/dtrans/source/test/test_dtrans.cxx @@ -34,9 +34,9 @@ #include <stdio.h> #include <string.h> -//------------------------------------------------------------------------ + // my defines -//------------------------------------------------------------------------ + #ifdef UNX #define PATH_SEPARATOR '/' @@ -49,9 +49,9 @@ #define PERFORM( a, b ) fprintf( stderr, "Performing " a); b; fprintf( stderr, "done\n" ) #define TRACE( a ) fprintf( stderr, a ) -//------------------------------------------------------------------------ + // namespaces -//------------------------------------------------------------------------ + using namespace ::rtl; using namespace ::std; @@ -63,15 +63,15 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::io; using namespace ::com::sun::star::lang; -//------------------------------------------------------------------------ + // globals -//------------------------------------------------------------------------ + const char * app = NULL; -//------------------------------------------------------------------------ + // ClipboardOwner -//------------------------------------------------------------------------ + class ClipboardOwner : public WeakImplHelper1< XClipboardOwner > { @@ -83,9 +83,9 @@ class ClipboardOwner : public WeakImplHelper1< XClipboardOwner > public: ClipboardOwner(); - //-------------------------------------------------------------------- + // XClipboardOwner - //-------------------------------------------------------------------- + virtual void SAL_CALL lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans ) throw(RuntimeException); @@ -94,18 +94,18 @@ public: Reference< XTransferable > lostOwnershipTransferableValue() { return m_xTransferable; }; }; -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + ClipboardOwner::ClipboardOwner(): m_nReceivedLostOwnerships( 0 ) { } -//------------------------------------------------------------------------ + // lostOwnership -//------------------------------------------------------------------------ + void SAL_CALL ClipboardOwner::lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans ) throw(RuntimeException) @@ -115,9 +115,9 @@ void SAL_CALL ClipboardOwner::lostOwnership( const Reference< XClipboard >& xCli m_xTransferable = xTrans; } -//------------------------------------------------------------------------ + // ClipboardListener -//------------------------------------------------------------------------ + class ClipboardListener : public WeakImplHelper1< XClipboardListener > { @@ -129,15 +129,15 @@ class ClipboardListener : public WeakImplHelper1< XClipboardListener > public: ClipboardListener(); - //-------------------------------------------------------------------- + // XClipboardOwner - //-------------------------------------------------------------------- + virtual void SAL_CALL changedContents( const ClipboardEvent& event ) throw(RuntimeException); - //-------------------------------------------------------------------- + // XEventListener - //-------------------------------------------------------------------- + virtual void SAL_CALL disposing( const EventObject& event ) throw(RuntimeException); @@ -146,18 +146,18 @@ public: Reference< XTransferable > changedContentsEventTransferableValue() { return m_xTransferable; }; }; -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + ClipboardListener::ClipboardListener(): m_nReceivedChangedContentsEvents( 0 ) { } -//------------------------------------------------------------------------ + // changedContents -//------------------------------------------------------------------------ + void SAL_CALL ClipboardListener::changedContents( const ClipboardEvent& event ) throw(RuntimeException) @@ -167,35 +167,35 @@ void SAL_CALL ClipboardListener::changedContents( const ClipboardEvent& event ) m_xTransferable = event.Contents; } -//------------------------------------------------------------------------ + // disposing -//------------------------------------------------------------------------ + void SAL_CALL ClipboardListener::disposing( const EventObject& event ) throw(RuntimeException) { } -//------------------------------------------------------------------------ + // StringTransferable -//------------------------------------------------------------------------ + class StringTransferable : public WeakImplHelper2< XClipboardOwner, XTransferable > { public: StringTransferable( ); - //-------------------------------------------------------------------- + // XTransferable - //-------------------------------------------------------------------- + virtual Any SAL_CALL getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException); virtual Sequence< DataFlavor > SAL_CALL getTransferDataFlavors( ) throw(RuntimeException); 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); @@ -208,9 +208,9 @@ private: sal_Bool m_receivedLostOwnership; }; -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + StringTransferable::StringTransferable( ) : m_seqDFlv( 1 ), @@ -233,9 +233,9 @@ StringTransferable::StringTransferable( ) : m_seqDFlv[0] = df; } -//------------------------------------------------------------------------ + // getTransferData -//------------------------------------------------------------------------ + Any SAL_CALL StringTransferable::getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException) @@ -250,9 +250,9 @@ Any SAL_CALL StringTransferable::getTransferData( const DataFlavor& aFlavor ) return anyData; } -//------------------------------------------------------------------------ + // getTransferDataFlavors -//------------------------------------------------------------------------ + Sequence< DataFlavor > SAL_CALL StringTransferable::getTransferDataFlavors( ) throw(RuntimeException) @@ -260,9 +260,9 @@ Sequence< DataFlavor > SAL_CALL StringTransferable::getTransferDataFlavors( ) return m_seqDFlv; } -//------------------------------------------------------------------------ + // isDataFlavorSupported -//------------------------------------------------------------------------ + sal_Bool SAL_CALL StringTransferable::isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException) @@ -282,9 +282,9 @@ sal_Bool SAL_CALL StringTransferable::isDataFlavorSupported( const DataFlavor& a return bRet; } -//------------------------------------------------------------------------ + // lostOwnership -//------------------------------------------------------------------------ + void SAL_CALL StringTransferable::lostOwnership( const Reference< XClipboard >& xClipboard, const Reference< XTransferable >& xTrans ) throw(RuntimeException) @@ -292,17 +292,17 @@ void SAL_CALL StringTransferable::lostOwnership( const Reference< XClipboard >& m_receivedLostOwnership = sal_True; } -//------------------------------------------------------------------------ + // main -//------------------------------------------------------------------------ + int SAL_CALL main( int argc, const char* argv[] ) { OUString aRegistry; - //------------------------------------------------------------------ + // check command line parameters - //------------------------------------------------------------------ + if ( NULL == ( app = strrchr( argv[0], PATH_SEPARATOR ) ) ) app = argv[0]; @@ -323,9 +323,9 @@ int SAL_CALL main( int argc, const char* argv[] ) if( aRegistry.isEmpty( ) ) fprintf( stderr, "Usage: %s -r full-path-to-applicat.rdb\n", app ); - //------------------------------------------------------------------ + // create service manager - //------------------------------------------------------------------ + Reference< XMultiServiceFactory > xServiceManager; try @@ -333,9 +333,9 @@ int SAL_CALL main( int argc, const char* argv[] ) xServiceManager = createRegistryServiceFactory( aRegistry, sal_True ); ENSURE( xServiceManager.is(), "*** ERROR *** service manager could not be created." ); - //-------------------------------------------------------------- + // create an instance of GenericClipboard service - //-------------------------------------------------------------- + Sequence< Any > arguments(1); arguments[0] = makeAny( OUString("generic") ); @@ -353,9 +353,9 @@ int SAL_CALL main( int argc, const char* argv[] ) if( xClipboardNotifier.is() ) xClipboardNotifier->addClipboardListener( xClipboardListener ); - //-------------------------------------------------------------- + // run various tests on clipboard implementation - //-------------------------------------------------------------- + TRACE( "\n*** testing generic clipboard service ***\n" ); @@ -416,18 +416,18 @@ int SAL_CALL main( int argc, const char* argv[] ) TEST( "if received changedContents notification for correct transferable: ", ! pListener->changedContentsEventTransferableValue().is() ); } - //-------------------------------------------------------------- + // create an instance of ClipboardManager service - //-------------------------------------------------------------- + Reference< XClipboardManager > xClipboardManager( xServiceManager->createInstance( OUString("com.sun.star.datatransfer.clipboard.ClipboardManager") ), UNO_QUERY ); ENSURE( xClipboardManager.is(), "*** ERROR *** clipboard manager service could not be created." ); - //-------------------------------------------------------------- + // run various tests on clipboard manager implementation - //-------------------------------------------------------------- + TRACE( "\n*** testing clipboard manager service ***\n" ); @@ -455,9 +455,9 @@ int SAL_CALL main( int argc, const char* argv[] ) ENSURE( sal_False, "*** ERROR *** exception caught." ); } - //-------------------------------------------------------------------- + // shutdown the service manager - //-------------------------------------------------------------------- + // query XComponent interface Reference< XComponent > xComponent( xServiceManager, UNO_QUERY ); diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx index 365e8696b7a4..59c9a8b8e0f1 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx @@ -52,9 +52,9 @@ #define __uuidof(I) IID_##I #endif -//---------------------------------------------------------------- + // namespace directives -//---------------------------------------------------------------- + using osl::Condition; using osl::Mutex; @@ -66,9 +66,9 @@ namespace /* private */ char CLIPSRV_DLL_NAME[] = "sysdtrans.dll"; char g_szWndClsName[] = "MtaOleReqWnd###"; - //-------------------------------------------------------- + // messages constants - //-------------------------------------------------------- + const sal_uInt32 MSG_SETCLIPBOARD = WM_USER + 0x0001; const sal_uInt32 MSG_GETCLIPBOARD = WM_USER + 0x0002; @@ -84,7 +84,7 @@ namespace /* private */ const sal_Bool AUTO_RESET = sal_False; const sal_Bool INIT_NONSIGNALED = sal_False; - //------------------------------------------------------ + /* Cannot use osl conditions because they are blocking without waking up on messages sent by another thread this leads to deadlocks because we are blocking the @@ -155,9 +155,9 @@ namespace /* private */ Win32Condition& operator=(const Win32Condition&); }; - //------------------------------------------ + // we use one condition for every request - //------------------------------------------ + struct MsgCtx { @@ -167,15 +167,15 @@ namespace /* private */ } /* namespace private */ -//---------------------------------------------------------------- + // static member initialization -//---------------------------------------------------------------- + CMtaOleClipboard* CMtaOleClipboard::s_theMtaOleClipboardInst = NULL; -//-------------------------------------------------------------------- + // marshal an IDataObject -//-------------------------------------------------------------------- + //inline HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStream ) @@ -191,9 +191,9 @@ HRESULT MarshalIDataObjectInStream( IDataObject* pIDataObject, LPSTREAM* ppStrea ); } -//-------------------------------------------------------------------- + // unmarshal an IDataObject -//-------------------------------------------------------------------- + //inline HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** ppIDataObject ) @@ -208,9 +208,9 @@ HRESULT UnmarshalIDataObjectAndReleaseStream( LPSTREAM lpStream, IDataObject** p reinterpret_cast<LPVOID*>(ppIDataObject)); } -//-------------------------------------------------------------------- + // helper class to ensure that the calling thread has com initialized -//-------------------------------------------------------------------- + class CAutoComInit { @@ -255,9 +255,9 @@ private: HRESULT m_hResult; }; -//-------------------------------------------------------------------- + // ctor -//-------------------------------------------------------------------- + CMtaOleClipboard::CMtaOleClipboard( ) : m_hOleThread( NULL ), @@ -283,9 +283,9 @@ CMtaOleClipboard::CMtaOleClipboard( ) : NULL, 0, CMtaOleClipboard::oleThreadProc, this, 0, &m_uOleThreadId ); OSL_ASSERT( NULL != m_hOleThread ); - //---------------------------------------------- + // setup the clipboard changed notifier thread - //---------------------------------------------- + m_hClipboardChangedNotifierEvents[0] = CreateEventA( 0, MANUAL_RESET, INIT_NONSIGNALED, NULL ); OSL_ASSERT( NULL != m_hClipboardChangedNotifierEvents[0] ); @@ -300,9 +300,9 @@ CMtaOleClipboard::CMtaOleClipboard( ) : OSL_ASSERT( NULL != m_hClipboardChangedNotifierThread ); } -//-------------------------------------------------------------------- + // dtor -//-------------------------------------------------------------------- + CMtaOleClipboard::~CMtaOleClipboard( ) { @@ -355,9 +355,9 @@ CMtaOleClipboard::~CMtaOleClipboard( ) } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + HRESULT CMtaOleClipboard::flushClipboard( ) { @@ -381,9 +381,9 @@ HRESULT CMtaOleClipboard::flushClipboard( ) return aMsgCtx.hr; } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + HRESULT CMtaOleClipboard::getClipboard( IDataObject** ppIDataObject ) { @@ -421,10 +421,10 @@ HRESULT CMtaOleClipboard::getClipboard( IDataObject** ppIDataObject ) return hr; } -//-------------------------------------------------------------------- + // this is an asynchronous method that's why we don't wait until the // request is completed -//-------------------------------------------------------------------- + HRESULT CMtaOleClipboard::setClipboard( IDataObject* pIDataObject ) { @@ -460,9 +460,9 @@ HRESULT CMtaOleClipboard::setClipboard( IDataObject* pIDataObject ) return S_OK; } -//-------------------------------------------------------------------- + // register a clipboard viewer -//-------------------------------------------------------------------- + bool CMtaOleClipboard::registerClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipViewerCallback ) { @@ -487,9 +487,9 @@ bool CMtaOleClipboard::registerClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipV return bRet; } -//-------------------------------------------------------------------- + // register a clipboard viewer -//-------------------------------------------------------------------- + bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncClipViewerCallback ) { @@ -528,18 +528,18 @@ bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncCli return bRet; } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::onSetClipboard( IDataObject* pIDataObject ) { return static_cast<LRESULT>( OleSetClipboard( pIDataObject ) ); } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) { @@ -557,18 +557,18 @@ LRESULT CMtaOleClipboard::onGetClipboard( LPSTREAM* ppStream ) return static_cast<LRESULT>(hr); } -//-------------------------------------------------------------------- + // flush the ole-clipboard -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::onFlushClipboard( ) { return static_cast<LRESULT>( OleFlushClipboard( ) ); } -//-------------------------------------------------------------------- + // handle clipboard chain change event -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext ) { @@ -591,9 +591,9 @@ LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext ) return 0; } -//-------------------------------------------------------------------- + // handle draw clipboard event -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::onDrawClipboard( ) { @@ -626,20 +626,20 @@ LRESULT CMtaOleClipboard::onDrawClipboard( ) return 0; } -//-------------------------------------------------------------------- + // SendMessage so we don't need to supply the HWND if we send // something to our wrapped window -//-------------------------------------------------------------------- + LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return ::SendMessageA( m_hwndMtaOleReqWnd, msg, wParam, lParam ); } -//-------------------------------------------------------------------- + // PostMessage so we don't need to supply the HWND if we send // something to our wrapped window -//-------------------------------------------------------------------- + bool CMtaOleClipboard::postMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { @@ -647,9 +647,9 @@ bool CMtaOleClipboard::postMessage( UINT msg, WPARAM wParam, LPARAM lParam ) } -//-------------------------------------------------------------------- + // the window proc -//-------------------------------------------------------------------- + LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { @@ -734,9 +734,9 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA return lResult; } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + void CMtaOleClipboard::createMtaOleReqWnd( ) { @@ -767,9 +767,9 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) g_szWndClsName, NULL, 0, 0, 0, 0, 0, NULL, NULL, hInst, NULL ); } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + unsigned int CMtaOleClipboard::run( ) { @@ -803,9 +803,9 @@ unsigned int CMtaOleClipboard::run( ) return nRet; } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam ) { @@ -816,9 +816,9 @@ unsigned int WINAPI CMtaOleClipboard::oleThreadProc( LPVOID pParam ) return pInst->run( ); } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + unsigned int WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( LPVOID pParam ) { @@ -860,9 +860,9 @@ unsigned int WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( LPVOID return ( 0 ); } -//-------------------------------------------------------------------- + // -//-------------------------------------------------------------------- + bool CMtaOleClipboard::WaitForThreadReady( ) const { diff --git a/dtrans/source/win32/clipb/WinClipbImpl.cxx b/dtrans/source/win32/clipb/WinClipbImpl.cxx index f10b3e5e66af..441338925848 100644 --- a/dtrans/source/win32/clipb/WinClipbImpl.cxx +++ b/dtrans/source/win32/clipb/WinClipbImpl.cxx @@ -37,9 +37,9 @@ #pragma warning(pop) #endif -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace osl; using namespace std; @@ -55,9 +55,9 @@ using namespace com::sun::star::datatransfer::clipboard::RenderingCapabilities; CWinClipbImpl* CWinClipbImpl::s_pCWinClipbImpl = NULL; osl::Mutex CWinClipbImpl::s_aMutex; -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CWinClipbImpl::CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* theWinClipboard ) : m_itsName( aClipboardName ), @@ -72,9 +72,9 @@ CWinClipbImpl::CWinClipbImpl( const OUString& aClipboardName, CWinClipboard* the registerClipboardViewer( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CWinClipbImpl::~CWinClipbImpl( ) { @@ -85,9 +85,9 @@ CWinClipbImpl::~CWinClipbImpl( ) unregisterClipboardViewer( ); } -//------------------------------------------------------------------------ + // getContent -//------------------------------------------------------------------------ + Reference< XTransferable > SAL_CALL CWinClipbImpl::getContents( ) throw( RuntimeException ) { @@ -125,9 +125,9 @@ Reference< XTransferable > SAL_CALL CWinClipbImpl::getContents( ) throw( Runtime return rClipContent; } -//------------------------------------------------------------------------ + // setContent -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::setContents( const Reference< XTransferable >& xTransferable, @@ -155,27 +155,27 @@ void SAL_CALL CWinClipbImpl::setContents( m_MtaOleClipboard.setClipboard(pIDataObj.get()); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CWinClipbImpl::getName( ) throw( RuntimeException ) { return m_itsName; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Int8 SAL_CALL CWinClipbImpl::getRenderingCapabilities( ) throw( RuntimeException ) { return ( Delayed | Persistant ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::flushClipboard( ) throw( RuntimeException ) { @@ -193,36 +193,36 @@ void SAL_CALL CWinClipbImpl::flushClipboard( ) throw( RuntimeException ) m_MtaOleClipboard.flushClipboard( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::registerClipboardViewer( ) { m_MtaOleClipboard.registerClipViewer( CWinClipbImpl::onClipboardContentChanged ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::unregisterClipboardViewer( ) { m_MtaOleClipboard.registerClipViewer( NULL ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::dispose() throw( RuntimeException ) { OSL_ENSURE( !m_pCurrentClipContent, "Clipboard was not flushed before shutdown!" ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void WINAPI CWinClipbImpl::onClipboardContentChanged( void ) { @@ -233,9 +233,9 @@ void WINAPI CWinClipbImpl::onClipboardContentChanged( void ) s_pCWinClipbImpl->m_pWinClipboard->notifyAllClipboardListener( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CWinClipbImpl::onReleaseDataObject( CXNotifyingDataObject* theCaller ) { diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/dtrans/source/win32/clipb/WinClipboard.cxx index 59bc8be8ccf6..66b3f582eaf2 100644 --- a/dtrans/source/win32/clipb/WinClipboard.cxx +++ b/dtrans/source/win32/clipb/WinClipboard.cxx @@ -25,9 +25,9 @@ #include <cppuhelper/supportsservice.hxx> #include "WinClipbImpl.hxx" -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace osl; using namespace std; @@ -41,9 +41,9 @@ using namespace com::sun::star::lang; #define WINCLIPBOARD_IMPL_NAME "com.sun.star.datatransfer.clipboard.ClipboardW32" -//------------------------------------------------------------------------ + // helper functions -//------------------------------------------------------------------------ + namespace { @@ -55,9 +55,9 @@ namespace } } -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + /*XEventListener,*/ CWinClipboard::CWinClipboard( const Reference< XComponentContext >& rxContext, const OUString& aClipboardName ) : WeakComponentImplHelper3< XSystemClipboard, XFlushableClipboard, XServiceInfo >( m_aCbListenerMutex ), @@ -70,14 +70,14 @@ CWinClipboard::CWinClipboard( const Reference< XComponentContext >& rxContext, c // XClipboard //======================================================================== -//------------------------------------------------------------------------ + // getContent // to avoid unecessary traffic we check first if there is a clipboard // content which was set via setContent, in this case we don't need // to query the content from the clipboard, create a new wrapper object // and so on, we simply return the orignial XTransferable instead of our // DOTransferable -//------------------------------------------------------------------------ + Reference< XTransferable > SAL_CALL CWinClipboard::getContents( ) throw( RuntimeException ) { @@ -93,9 +93,9 @@ Reference< XTransferable > SAL_CALL CWinClipboard::getContents( ) throw( Runtime return Reference< XTransferable >( ); } -//------------------------------------------------------------------------ + // setContent -//------------------------------------------------------------------------ + void SAL_CALL CWinClipboard::setContents( const Reference< XTransferable >& xTransferable, const Reference< XClipboardOwner >& xClipboardOwner ) @@ -111,9 +111,9 @@ void SAL_CALL CWinClipboard::setContents( const Reference< XTransferable >& xTra m_pImpl->setContents( xTransferable, xClipboardOwner ); } -//------------------------------------------------------------------------ + // getName -//------------------------------------------------------------------------ + OUString SAL_CALL CWinClipboard::getName( ) throw( RuntimeException ) { @@ -163,9 +163,9 @@ sal_Int8 SAL_CALL CWinClipboard::getRenderingCapabilities( ) throw( RuntimeExce // XClipboardNotifier //======================================================================== -//------------------------------------------------------------------------ + // getName -//------------------------------------------------------------------------ + void SAL_CALL CWinClipboard::addClipboardListener( const Reference< XClipboardListener >& listener ) throw( RuntimeException ) @@ -183,9 +183,9 @@ void SAL_CALL CWinClipboard::addClipboardListener( const Reference< XClipboardLi rBHelper.aLC.addInterface( getCppuType( &listener ), listener ); } -//------------------------------------------------------------------------ + // getName -//------------------------------------------------------------------------ + void SAL_CALL CWinClipboard::removeClipboardListener( const Reference< XClipboardListener >& listener ) throw( RuntimeException ) @@ -203,9 +203,9 @@ void SAL_CALL CWinClipboard::removeClipboardListener( const Reference< XClipboar rBHelper.aLC.removeInterface( getCppuType( &listener ), listener ); } -//------------------------------------------------------------------------ + // getName -//------------------------------------------------------------------------ + void SAL_CALL CWinClipboard::notifyAllClipboardListener( ) { @@ -254,10 +254,10 @@ void SAL_CALL CWinClipboard::notifyAllClipboardListener( ) } // end if } -//------------------------------------------------ + // overwritten base class method which will be // called by the base class dispose method -//------------------------------------------------ + void SAL_CALL CWinClipboard::disposing() { @@ -268,9 +268,9 @@ void SAL_CALL CWinClipboard::disposing() m_pImpl.reset(); } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + OUString SAL_CALL CWinClipboard::getImplementationName( ) throw(RuntimeException) @@ -285,9 +285,9 @@ sal_Bool SAL_CALL CWinClipboard::supportsService( const OUString& ServiceName ) return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + Sequence< OUString > SAL_CALL CWinClipboard::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/dtrans/source/win32/clipb/wcbentry.cxx b/dtrans/source/win32/clipb/wcbentry.cxx index e13a109a220b..8ca8563008b6 100644 --- a/dtrans/source/win32/clipb/wcbentry.cxx +++ b/dtrans/source/win32/clipb/wcbentry.cxx @@ -23,9 +23,9 @@ #include <osl/diagnose.h> #include "WinClipboard.hxx" -//----------------------------------------------------------------- + // some defines -//----------------------------------------------------------------- + // the service names #define WINCLIPBOARD_SERVICE_NAME "com.sun.star.datatransfer.clipboard.SystemClipboard" @@ -33,9 +33,9 @@ // the implementation names #define WINCLIPBOARD_IMPL_NAME "com.sun.star.datatransfer.clipboard.ClipboardW32" -//----------------------------------------------------------------------------------------------------------- + // namespace directives -//----------------------------------------------------------------------------------------------------------- + using namespace ::rtl ; using namespace ::com::sun::star::uno ; @@ -44,18 +44,18 @@ using namespace ::cppu ; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer::clipboard; -//----------------------------------------------------------------- + // create a static object to initialize the shell9x library -//----------------------------------------------------------------- + namespace { - //----------------------------------------------------------------------------------------------------------- + // functions to create a new Clipboad instance; is needed by factory helper implementation // @param rServiceManager - service manager, useful if the component needs other uno services // so we should give it to every UNO-Implementation component - //----------------------------------------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { @@ -65,10 +65,10 @@ namespace extern "C" { -//---------------------------------------------------------------------- + // component_getFactory // returns a factory to create XFilePicker-Services -//---------------------------------------------------------------------- + SAL_DLLPUBLIC_EXPORT void* SAL_CALL sysdtrans_component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx index bdc0b05a51b2..036ae9686124 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/dtrans/source/win32/dnd/target.cxx @@ -624,5 +624,4 @@ inline sal_Int8 DropTarget::getFilteredActions( DWORD grfKeyState, DWORD dwEffec return actions & m_nDefaultActions; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dtrans/source/win32/dtobj/APNDataObject.cxx b/dtrans/source/win32/dtobj/APNDataObject.cxx index eefa2fe17cb8..9428b52a47e5 100644 --- a/dtrans/source/win32/dtobj/APNDataObject.cxx +++ b/dtrans/source/win32/dtobj/APNDataObject.cxx @@ -31,9 +31,9 @@ #define FREE_HGLOB_ON_RELEASE TRUE #define KEEP_HGLOB_ON_RELEASE FALSE -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CAPNDataObject::CAPNDataObject( IDataObjectPtr rIDataObject ) : m_rIDataObjectOrg( rIDataObject ), @@ -106,9 +106,9 @@ CAPNDataObject::~CAPNDataObject( ) } } -//------------------------------------------------------------------------ + // IUnknown->QueryInterface -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -130,18 +130,18 @@ STDMETHODIMP CAPNDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//------------------------------------------------------------------------ + // IUnknown->AddRef -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CAPNDataObject::AddRef( ) { return static_cast< ULONG >( InterlockedIncrement( &m_nRefCnt ) ); } -//------------------------------------------------------------------------ + // IUnknown->Release -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CAPNDataObject::Release( ) { @@ -155,9 +155,9 @@ STDMETHODIMP_(ULONG) CAPNDataObject::Release( ) return nRefCnt; } -//------------------------------------------------------------------------ + // IDataObject->GetData -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ) { @@ -174,9 +174,9 @@ STDMETHODIMP CAPNDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmediu return hr; } -//------------------------------------------------------------------------ + // IDataObject->EnumFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc ) { @@ -193,9 +193,9 @@ STDMETHODIMP CAPNDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** return hr; } -//------------------------------------------------------------------------ + // IDataObject->QueryGetData -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::QueryGetData( LPFORMATETC pFormatetc ) { @@ -212,9 +212,9 @@ STDMETHODIMP CAPNDataObject::QueryGetData( LPFORMATETC pFormatetc ) return hr; } -//------------------------------------------------------------------------ + // IDataObject->GetDataHere -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ) { @@ -231,9 +231,9 @@ STDMETHODIMP CAPNDataObject::GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pm return hr; } -//------------------------------------------------------------------------ + // IDataObject->GetCanonicalFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatectIn, LPFORMATETC pFormatetcOut) { @@ -250,9 +250,9 @@ STDMETHODIMP CAPNDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatectIn, LPF return hr; } -//------------------------------------------------------------------------ + // IDataObject->SetData -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium, BOOL fRelease ) { @@ -269,9 +269,9 @@ STDMETHODIMP CAPNDataObject::SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmediu return hr; } -//------------------------------------------------------------------------ + // IDataObject->DAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD * pdwConnection ) { @@ -288,9 +288,9 @@ STDMETHODIMP CAPNDataObject::DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVI return hr; } -//------------------------------------------------------------------------ + // IDataObject->DUnadvise -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::DUnadvise( DWORD dwConnection ) { @@ -307,9 +307,9 @@ STDMETHODIMP CAPNDataObject::DUnadvise( DWORD dwConnection ) return hr; } -//------------------------------------------------------------------------ + // IDataObject->EnumDAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CAPNDataObject::EnumDAdvise( LPENUMSTATDATA * ppenumAdvise ) { @@ -326,18 +326,18 @@ STDMETHODIMP CAPNDataObject::EnumDAdvise( LPENUMSTATDATA * ppenumAdvise ) return hr; } -//------------------------------------------------------------------------ + // for our convenience -//------------------------------------------------------------------------ + CAPNDataObject::operator IDataObject*( ) { return static_cast< IDataObject* >( this ); } -//------------------------------------------------------------------------ + // helper function -//------------------------------------------------------------------------ + HRESULT CAPNDataObject::MarshalIDataObjectIntoCurrentApartment( IDataObject** ppIDataObj ) { diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx index ff1e8bb1fceb..56c5dde01ca0 100644 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -31,9 +31,9 @@ #include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp> #include <comphelper/processfactory.hxx> -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace std; using namespace osl; @@ -45,9 +45,9 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + namespace { @@ -65,9 +65,9 @@ namespace } // end namespace -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CDOTransferable::CDOTransferable( const Reference< XComponentContext >& rxContext, IDataObjectPtr rDataObject ) : @@ -79,9 +79,9 @@ CDOTransferable::CDOTransferable( { } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) throw( UnsupportedFlavorException, IOException, RuntimeException ) @@ -90,16 +90,16 @@ Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) MutexGuard aGuard( m_aMutex ); - //------------------------------------------------ + // convert dataflavor to formatetc - //------------------------------------------------ + CFormatEtc fetc = m_DataFormatTranslator.getFormatEtcFromDataFlavor( aFlavor ); OSL_ASSERT( CF_INVALID != fetc.getClipformat() ); - //------------------------------------------------ + // get the data from clipboard in a byte stream - //------------------------------------------------ + ByteSequence_t clipDataStream; @@ -137,16 +137,16 @@ Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) throw; // pass through exception } - //------------------------------------------------ + // return the data as any - //------------------------------------------------ + return byteStreamToAny( clipDataStream, aFlavor.DataType ); } -//------------------------------------------------------------------------ + // getTransferDataFlavors -//------------------------------------------------------------------------ + Sequence< DataFlavor > SAL_CALL CDOTransferable::getTransferDataFlavors( ) throw( RuntimeException ) @@ -154,11 +154,11 @@ Sequence< DataFlavor > SAL_CALL CDOTransferable::getTransferDataFlavors( ) return m_FlavorList; } -//------------------------------------------------------------------------ + // isDataFlavorSupported // returns true if we find a DataFlavor with the same MimeType and // DataType -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFlavor ) throw( RuntimeException ) @@ -172,7 +172,7 @@ sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFla return sal_False; } -//------------------------------------------------------------------------ + // helper function // the list of datafalvors currently on the clipboard will be initialized // only once; if the client of this Transferable will hold a reference @@ -182,7 +182,7 @@ sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFla // an synthesize this format on the fly if requested, to accomplish this // we save the first offered text format which we will later use for the // conversion -//------------------------------------------------------------------------ + void SAL_CALL CDOTransferable::initFlavorList( ) { @@ -231,9 +231,9 @@ void SAL_CALL CDOTransferable::initFlavorList( ) } } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline void SAL_CALL CDOTransferable::addSupportedFlavor( const DataFlavor& aFlavor ) @@ -248,9 +248,9 @@ void SAL_CALL CDOTransferable::addSupportedFlavor( const DataFlavor& aFlavor ) } } -//------------------------------------------------------------------------ + // helper function -//------------------------------------------------------------------------ + //inline DataFlavor SAL_CALL CDOTransferable::formatEtcToDataFlavor( const FORMATETC& aFormatEtc ) @@ -268,10 +268,10 @@ DataFlavor SAL_CALL CDOTransferable::formatEtcToDataFlavor( const FORMATETC& aFo return m_DataFormatTranslator.getDataFlavorFromFormatEtc( aFormatEtc, lcid ); } -//------------------------------------------------------------------------ + // returns the current locale on clipboard; if there is no locale on // clipboard the function returns the current thread locale -//------------------------------------------------------------------------ + LCID SAL_CALL CDOTransferable::getLocaleFromClipboard( ) { @@ -297,11 +297,11 @@ LCID SAL_CALL CDOTransferable::getLocaleFromClipboard( ) return lcid; } -//------------------------------------------------------------------------ + // i think it's not necessary to call ReleaseStgMedium // in case of failures because nothing should have been // allocated etc. -//------------------------------------------------------------------------ + CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFormatEtc& aFormatEtc ) { @@ -377,9 +377,9 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor return byteStream; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CDOTransferable::synthesizeUnicodeText( ) { @@ -422,9 +422,9 @@ OUString SAL_CALL CDOTransferable::synthesizeUnicodeText( ) return OUString(pWChar); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CDOTransferable::clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, ByteSequence_t& aByteSequence ) { @@ -458,9 +458,9 @@ void CDOTransferable::clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, memTransferHelper.read( aByteSequence.getArray( ), nMemSize ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline Any CDOTransferable::byteStreamToAny( ByteSequence_t& aByteStream, const Type& aRequestedDataType ) @@ -478,9 +478,9 @@ Any CDOTransferable::byteStreamToAny( ByteSequence_t& aByteStream, const Type& a return aAny; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline OUString CDOTransferable::byteStreamToOUString( ByteSequence_t& aByteStream ) @@ -498,9 +498,9 @@ OUString CDOTransferable::byteStreamToOUString( ByteSequence_t& aByteStream ) return OUString( reinterpret_cast< sal_Unicode* >( aByteStream.getArray( ) ), nWChars ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDOTransferable::compareDataFlavors( const DataFlavor& lhs, const DataFlavor& rhs ) @@ -531,9 +531,9 @@ sal_Bool SAL_CALL CDOTransferable::compareDataFlavors( return bRet; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDOTransferable::cmpFullMediaType( const Reference< XMimeContentType >& xLhs, const Reference< XMimeContentType >& xRhs ) const @@ -541,9 +541,9 @@ sal_Bool SAL_CALL CDOTransferable::cmpFullMediaType( return xLhs->getFullMediaType().equalsIgnoreAsciiCase( xRhs->getFullMediaType( ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDOTransferable::cmpAllContentTypeParameter( const Reference< XMimeContentType >& xLhs, const Reference< XMimeContentType >& xRhs ) const diff --git a/dtrans/source/win32/dtobj/DTransHelper.cxx b/dtrans/source/win32/dtobj/DTransHelper.cxx index ee7352c83f0f..6f7094351cdd 100644 --- a/dtrans/source/win32/dtobj/DTransHelper.cxx +++ b/dtrans/source/win32/dtobj/DTransHelper.cxx @@ -21,9 +21,9 @@ #include <osl/diagnose.h> #include "DTransHelper.hxx" -//------------------------------------------------------------------------ + // implementation -//------------------------------------------------------------------------ + CStgTransferHelper::CStgTransferHelper( sal_Bool bAutoInit, HGLOBAL hGlob, @@ -35,9 +35,9 @@ CStgTransferHelper::CStgTransferHelper( sal_Bool bAutoInit, init( hGlob, m_bDelStgOnRelease ); } -//------------------------------------------------------------------------ + // dtor -//------------------------------------------------------------------------ + CStgTransferHelper::~CStgTransferHelper( ) @@ -46,9 +46,9 @@ CStgTransferHelper::~CStgTransferHelper( ) m_lpStream->Release( ); } -//------------------------------------------------------------------------ + // TransferData into the -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::write( const void* lpData, ULONG cb, ULONG* cbWritten ) { @@ -71,9 +71,9 @@ void SAL_CALL CStgTransferHelper::write( const void* lpData, ULONG cb, ULONG* cb #endif } -//------------------------------------------------------------------------ + // read -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::read( LPVOID pv, ULONG cb, ULONG* pcbRead ) { @@ -86,9 +86,9 @@ void SAL_CALL CStgTransferHelper::read( LPVOID pv, ULONG cb, ULONG* pcbRead ) throw CStgTransferException( hr ); } -//------------------------------------------------------------------------ + // GetHGlobal -//------------------------------------------------------------------------ + HGLOBAL SAL_CALL CStgTransferHelper::getHGlobal( ) const { @@ -106,9 +106,9 @@ HGLOBAL SAL_CALL CStgTransferHelper::getHGlobal( ) const return hGlob; } -//------------------------------------------------------------------------ + // getIStream -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::getIStream( LPSTREAM* ppStream ) { @@ -118,9 +118,9 @@ void SAL_CALL CStgTransferHelper::getIStream( LPSTREAM* ppStream ) static_cast< LPUNKNOWN >( *ppStream )->AddRef( ); } -//------------------------------------------------------------------------ + // Init -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::init( SIZE_T newSize, sal_uInt32 uiFlags, @@ -149,9 +149,9 @@ void SAL_CALL CStgTransferHelper::init( SIZE_T newSize, #endif } -//------------------------------------------------------------------------ + // Init -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::init( HGLOBAL hGlob, sal_Bool bDelStgOnRelease ) @@ -165,9 +165,9 @@ void SAL_CALL CStgTransferHelper::init( HGLOBAL hGlob, throw CStgTransferException( hr ); } -//------------------------------------------------------------------------ + // free the global memory and invalidate the stream pointer -//------------------------------------------------------------------------ + void SAL_CALL CStgTransferHelper::cleanup( ) { @@ -185,9 +185,9 @@ void SAL_CALL CStgTransferHelper::cleanup( ) } } -//------------------------------------------------------------------------ + // return the size of memory we point to -//------------------------------------------------------------------------ + sal_uInt32 SAL_CALL CStgTransferHelper::memSize( CLIPFORMAT cf ) const { diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/dtrans/source/win32/dtobj/DataFmtTransl.cxx index 058ab5dc0f1b..90fa35d471aa 100644 --- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx +++ b/dtrans/source/win32/dtobj/DataFmtTransl.cxx @@ -41,9 +41,9 @@ #endif -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace std; using namespace com::sun::star::uno; @@ -63,18 +63,18 @@ const OUString HPNAME_OEM_ANSI_TEXT ("OEM/ANSI Text"); const OUString HTML_FORMAT_NAME_WINDOWS ("HTML Format"); const OUString HTML_FORMAT_NAME_SOFFICE ("HTML (HyperText Markup Language)"); -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext >& rxContext ) { m_XDataFormatTranslator = DataFormatTranslator::create( rxContext ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc CDataFormatTranslator::getFormatEtcFromDataFlavor( const DataFlavor& aDataFlavor ) const { @@ -116,9 +116,9 @@ CFormatEtc CDataFormatTranslator::getFormatEtcFromDataFlavor( const DataFlavor& return sal::static_int_cast<CFormatEtc>(getFormatEtcForClipformat( sal::static_int_cast<CLIPFORMAT>(cf) )); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const FORMATETC& aFormatEtc, LCID lcid ) const { @@ -173,9 +173,9 @@ DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const FORMATETC& a return aFlavor; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc SAL_CALL CDataFormatTranslator::getFormatEtcForClipformatName( const OUString& aClipFmtName ) const { @@ -187,9 +187,9 @@ CFormatEtc SAL_CALL CDataFormatTranslator::getFormatEtcForClipformatName( const return getFormatEtcForClipformat( cf ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString CDataFormatTranslator::getClipboardFormatName( CLIPFORMAT aClipformat ) const { @@ -201,9 +201,9 @@ OUString CDataFormatTranslator::getClipboardFormatName( CLIPFORMAT aClipformat ) return OUString( wBuff, nLen ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc SAL_CALL CDataFormatTranslator::getFormatEtcForClipformat( CLIPFORMAT cf ) const { @@ -238,36 +238,36 @@ CFormatEtc SAL_CALL CDataFormatTranslator::getFormatEtcForClipformat( CLIPFORMAT return fetc; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDataFormatTranslator::isOemOrAnsiTextFormat( CLIPFORMAT cf ) const { return ( (cf == CF_TEXT) || (cf == CF_OEMTEXT) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDataFormatTranslator::isUnicodeTextFormat( CLIPFORMAT cf ) const { return ( cf == CF_UNICODETEXT ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDataFormatTranslator::isTextFormat( CLIPFORMAT cf ) const { return ( isOemOrAnsiTextFormat( cf ) || isUnicodeTextFormat( cf ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDataFormatTranslator::isHTMLFormat( CLIPFORMAT cf ) const { @@ -275,9 +275,9 @@ sal_Bool SAL_CALL CDataFormatTranslator::isHTMLFormat( CLIPFORMAT cf ) const return ( clipFormatName == HTML_FORMAT_NAME_WINDOWS ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CDataFormatTranslator::isTextHtmlFormat( CLIPFORMAT cf ) const { @@ -285,9 +285,9 @@ sal_Bool SAL_CALL CDataFormatTranslator::isTextHtmlFormat( CLIPFORMAT cf ) const return ( clipFormatName.equalsIgnoreAsciiCase( HTML_FORMAT_NAME_SOFFICE ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CDataFormatTranslator::getTextCharsetFromLCID( LCID lcid, CLIPFORMAT aClipformat ) const { diff --git a/dtrans/source/win32/dtobj/DtObjFactory.cxx b/dtrans/source/win32/dtobj/DtObjFactory.cxx index 9909dfa489b5..174972463a21 100644 --- a/dtrans/source/win32/dtobj/DtObjFactory.cxx +++ b/dtrans/source/win32/dtobj/DtObjFactory.cxx @@ -23,17 +23,17 @@ #include "DOTransferable.hxx" -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace com::sun::star::uno; using namespace com::sun::star::datatransfer; using namespace com::sun::star::lang; -//------------------------------------------------------------------------ + // implementation -//------------------------------------------------------------------------ + IDataObjectPtr SAL_CALL CDTransObjFactory::createDataObjFromTransferable(const Reference<XComponentContext>& rxContext, const Reference< XTransferable >& refXTransferable) diff --git a/dtrans/source/win32/dtobj/Fetc.cxx b/dtrans/source/win32/dtobj/Fetc.cxx index 3a7284f60c62..b237b865f124 100644 --- a/dtrans/source/win32/dtobj/Fetc.cxx +++ b/dtrans/source/win32/dtobj/Fetc.cxx @@ -21,9 +21,9 @@ #include "Fetc.hxx" #include "../misc/ImplHelper.hxx" -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::CFormatEtc( ) { @@ -34,27 +34,27 @@ CFormatEtc::CFormatEtc( ) m_FormatEtc.tymed = TYMED_NULL; } -//------------------------------------------------------------------------ + // transfer of ownership -//------------------------------------------------------------------------ + CFormatEtc::CFormatEtc( const FORMATETC& aFormatEtc ) { CopyFormatEtc( &m_FormatEtc, &const_cast< FORMATETC& >( aFormatEtc ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::~CFormatEtc( ) { DeleteTargetDevice( m_FormatEtc.ptd ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::CFormatEtc( CLIPFORMAT cf, DWORD tymed, DVTARGETDEVICE* ptd, DWORD dwAspect, LONG lindex ) { @@ -65,9 +65,9 @@ CFormatEtc::CFormatEtc( CLIPFORMAT cf, DWORD tymed, DVTARGETDEVICE* ptd, DWORD d m_FormatEtc.tymed = tymed; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::CFormatEtc( const CFormatEtc& theOther ) { @@ -78,9 +78,9 @@ CFormatEtc::CFormatEtc( const CFormatEtc& theOther ) m_FormatEtc.tymed = theOther.m_FormatEtc.tymed; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc& CFormatEtc::operator=( const CFormatEtc& theOther ) { @@ -98,27 +98,27 @@ CFormatEtc& CFormatEtc::operator=( const CFormatEtc& theOther ) return *this; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::operator FORMATETC*( ) { return &m_FormatEtc; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtc::operator FORMATETC( ) { return m_FormatEtc; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::getFORMATETC( LPFORMATETC lpFormatEtc ) { @@ -128,27 +128,27 @@ void CFormatEtc::getFORMATETC( LPFORMATETC lpFormatEtc ) CopyFormatEtc( lpFormatEtc, &m_FormatEtc ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CLIPFORMAT CFormatEtc::getClipformat( ) const { return m_FormatEtc.cfFormat; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + DWORD CFormatEtc::getTymed( ) const { return m_FormatEtc.tymed; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::getTargetDevice( DVTARGETDEVICE** lpDvTargetDevice ) const { @@ -161,45 +161,45 @@ void CFormatEtc::getTargetDevice( DVTARGETDEVICE** lpDvTargetDevice ) const *lpDvTargetDevice = CopyTargetDevice( m_FormatEtc.ptd ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + DWORD CFormatEtc::getDvAspect( ) const { return m_FormatEtc.dwAspect; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + LONG CFormatEtc::getLindex( ) const { return m_FormatEtc.lindex; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::setClipformat( CLIPFORMAT cf ) { m_FormatEtc.cfFormat = cf; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::setTymed( DWORD tymed ) { m_FormatEtc.tymed = tymed; } -//------------------------------------------------------------------------ + // transfer of ownership! -//------------------------------------------------------------------------ + void CFormatEtc::setTargetDevice( DVTARGETDEVICE* ptd ) { @@ -207,36 +207,36 @@ void CFormatEtc::setTargetDevice( DVTARGETDEVICE* ptd ) m_FormatEtc.ptd = ptd; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::setDvAspect( DWORD dwAspect ) { m_FormatEtc.dwAspect = dwAspect; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtc::setLindex( LONG lindex ) { m_FormatEtc.lindex = lindex; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs ) { return CompareFormatEtc( &lhs.m_FormatEtc, &rhs.m_FormatEtc ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs ) { diff --git a/dtrans/source/win32/dtobj/FetcList.cxx b/dtrans/source/win32/dtobj/FetcList.cxx index 561f8945fa22..1ac231364011 100644 --- a/dtrans/source/win32/dtobj/FetcList.cxx +++ b/dtrans/source/win32/dtobj/FetcList.cxx @@ -31,9 +31,9 @@ #include "MimeAttrib.hxx" -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace com::sun::star::uno; using namespace com::sun::star::datatransfer; @@ -42,34 +42,34 @@ using namespace com::sun::star::container; using namespace std; -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + LCID CFormatRegistrar::m_TxtLocale = 0; sal_uInt32 CFormatRegistrar::m_TxtCodePage = GetACP( ); -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatEtcContainer::CFormatEtcContainer( ) { m_EnumIterator = m_FormatMap.begin( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtcContainer::addFormatEtc( const CFormatEtc& fetc ) { m_FormatMap.push_back( CFormatEtc( fetc ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CFormatEtcContainer::removeFormatEtc( const CFormatEtc& fetc ) { @@ -80,18 +80,18 @@ void SAL_CALL CFormatEtcContainer::removeFormatEtc( const CFormatEtc& fetc ) m_FormatMap.erase( iter ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CFormatEtcContainer::removeAllFormatEtc( ) { m_FormatMap.clear( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool CFormatEtcContainer::hasFormatEtc( const CFormatEtc& fetc ) const { @@ -101,27 +101,27 @@ sal_Bool CFormatEtcContainer::hasFormatEtc( const CFormatEtc& fetc ) const return ( iter != m_FormatMap.end( ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool CFormatEtcContainer::hasElements( ) const { return !m_FormatMap.empty(); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void CFormatEtcContainer::beginEnumFormatEtc( ) { m_EnumIterator = m_FormatMap.begin( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_uInt32 SAL_CALL CFormatEtcContainer::nextFormatEtc( LPFORMATETC lpFetc, sal_uInt32 aNum ) @@ -142,9 +142,9 @@ sal_uInt32 SAL_CALL CFormatEtcContainer::nextFormatEtc( LPFORMATETC lpFetc, } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatEtcContainer::skipFormatEtc( sal_uInt32 aNum ) { @@ -161,9 +161,9 @@ sal_Bool SAL_CALL CFormatEtcContainer::skipFormatEtc( sal_uInt32 aNum ) //######################################################################### -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + CFormatRegistrar::CFormatRegistrar( const Reference< XComponentContext >& rxContext, const CDataFormatTranslator& aDataFormatTranslator ) : @@ -173,7 +173,7 @@ CFormatRegistrar::CFormatRegistrar( const Reference< XComponentContext >& rxCont { } -// ---------------------------------------------------------------------------------------- + // this function converts all DataFlavors of the given FlavorList into // an appropriate FORMATETC structure, for some formats like unicodetext, // text and text/html we will offer an accompany format e.g.: @@ -193,7 +193,7 @@ CFormatRegistrar::CFormatRegistrar( const Reference< XComponentContext >& rxCont // // if some tries to register different text formats with different charsets the last // registered wins and the others are ignored -// ---------------------------------------------------------------------------------------- + void SAL_CALL CFormatRegistrar::RegisterFormats( const Reference< XTransferable >& aXTransferable, CFormatEtcContainer& aFormatEtcContainer ) @@ -277,45 +277,45 @@ void SAL_CALL CFormatRegistrar::RegisterFormats( } } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatRegistrar::hasSynthesizedLocale( ) const { return m_bHasSynthesizedLocale; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + LCID SAL_CALL CFormatRegistrar::getSynthesizedLocale( ) const { return m_TxtLocale; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_uInt32 SAL_CALL CFormatRegistrar::getRegisteredTextCodePage( ) const { return m_TxtCodePage; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + DataFlavor SAL_CALL CFormatRegistrar::getRegisteredTextFlavor( ) const { return m_RegisteredTextFlavor; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatRegistrar::isSynthesizeableFormat( const CFormatEtc& aFormatEtc ) const { @@ -324,9 +324,9 @@ sal_Bool SAL_CALL CFormatRegistrar::isSynthesizeableFormat( const CFormatEtc& aF m_DataFormatTranslator.isHTMLFormat( aFormatEtc.getClipformat() ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline sal_Bool SAL_CALL CFormatRegistrar::needsToSynthesizeAccompanyFormats( const CFormatEtc& aFormatEtc ) const @@ -336,9 +336,9 @@ sal_Bool SAL_CALL CFormatRegistrar::needsToSynthesizeAccompanyFormats( const CFo m_DataFormatTranslator.isTextHtmlFormat( aFormatEtc.getClipformat( ) ) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + OUString SAL_CALL CFormatRegistrar::getCharsetFromDataFlavor( const DataFlavor& aFlavor ) { @@ -367,9 +367,9 @@ OUString SAL_CALL CFormatRegistrar::getCharsetFromDataFlavor( const DataFlavor& return charset; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatRegistrar::hasUnicodeFlavor( const Reference< XTransferable >& aXTransferable ) const { @@ -381,9 +381,9 @@ sal_Bool SAL_CALL CFormatRegistrar::hasUnicodeFlavor( const Reference< XTransfer return aXTransferable->isDataFlavorSupported( aFlavor ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline sal_Bool CFormatRegistrar::isEqualCurrentSystemCodePage( sal_uInt32 aCodePage ) const @@ -391,9 +391,9 @@ sal_Bool CFormatRegistrar::isEqualCurrentSystemCodePage( sal_uInt32 aCodePage ) return ( (aCodePage == GetOEMCP()) || (aCodePage == GetACP()) ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatRegistrar::findLocaleForTextCodePage( ) { @@ -402,9 +402,9 @@ sal_Bool SAL_CALL CFormatRegistrar::findLocaleForTextCodePage( ) return ( IsValidLocale( m_TxtLocale, LCID_INSTALLED ) ) ? sal_True : sal_False; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + sal_Bool SAL_CALL CFormatRegistrar::isLocaleCodePage( LCID lcid, LCTYPE lctype, sal_uInt32 codepage ) { @@ -420,9 +420,9 @@ sal_Bool SAL_CALL CFormatRegistrar::isLocaleCodePage( LCID lcid, LCTYPE lctype, return ( localeCodePage == codepage ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline sal_Bool SAL_CALL CFormatRegistrar::isLocaleOemCodePage( LCID lcid, sal_uInt32 codepage ) @@ -430,9 +430,9 @@ sal_Bool SAL_CALL CFormatRegistrar::isLocaleOemCodePage( LCID lcid, sal_uInt32 c return isLocaleCodePage( lcid, LOCALE_IDEFAULTCODEPAGE, codepage ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline sal_Bool SAL_CALL CFormatRegistrar::isLocaleAnsiCodePage( LCID lcid, sal_uInt32 codepage ) @@ -440,9 +440,9 @@ sal_Bool SAL_CALL CFormatRegistrar::isLocaleAnsiCodePage( LCID lcid, sal_uInt32 return isLocaleCodePage( lcid, LOCALE_IDEFAULTANSICODEPAGE, codepage ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + BOOL CALLBACK CFormatRegistrar::EnumLocalesProc( LPSTR lpLocaleStr ) { diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index 4adbc933dfc1..27842aeac7b8 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -56,9 +56,9 @@ struct METAFILEHEADER }; #pragma pack() -//------------------------------------------------------------------------ + // convert a windows metafile picture to a openoffice metafile picture -//------------------------------------------------------------------------ + Sequence< sal_Int8 > SAL_CALL WinMFPictToOOMFPict( Sequence< sal_Int8 >& aMetaFilePict ) { @@ -128,9 +128,9 @@ Sequence< sal_Int8 > SAL_CALL WinMFPictToOOMFPict( Sequence< sal_Int8 >& aMetaFi return mfpictStream; } -//------------------------------------------------------------- + // convert a windows enhanced metafile to a openoffice metafile -//------------------------------------------------------------- + Sequence< sal_Int8 > SAL_CALL WinENHMFPictToOOMFPict( HENHMETAFILE hEnhMetaFile ) { @@ -149,9 +149,9 @@ Sequence< sal_Int8 > SAL_CALL WinENHMFPictToOOMFPict( HENHMETAFILE hEnhMetaFile return aRet; } -//------------------------------------------------------------------------ + // convert a openoffice metafile picture to a windows metafile picture -//------------------------------------------------------------------------ + HMETAFILEPICT SAL_CALL OOMFPictToWinMFPict( Sequence< sal_Int8 >& aOOMetaFilePict ) { @@ -173,9 +173,9 @@ HMETAFILEPICT SAL_CALL OOMFPictToWinMFPict( Sequence< sal_Int8 >& aOOMetaFilePic return hPict; } -//----------------------------------------------------------------------------- + // convert a openoffice metafile picture to a windows enhanced metafile picture -//----------------------------------------------------------------------------- + HENHMETAFILE SAL_CALL OOMFPictToWinENHMFPict( Sequence< sal_Int8 >& aOOMetaFilePict ) { @@ -184,9 +184,9 @@ HENHMETAFILE SAL_CALL OOMFPictToWinENHMFPict( Sequence< sal_Int8 >& aOOMetaFileP return hEnhMtf; } -//------------------------------------------------------------------------ + // convert a windows device independent bitmap into a openoffice bitmap -//------------------------------------------------------------------------ + Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const Sequence< sal_Int8 >& aWinDIB ) { @@ -219,9 +219,9 @@ Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const Sequence< sal_Int8 >& aWinDIB return ooBmpStream; } -//------------------------------------------------------------------------ + // convert a openoffice bitmap into a windows device independent bitmap -//------------------------------------------------------------------------ + Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( Sequence< sal_Int8 >& aOOBmp ) { @@ -234,7 +234,7 @@ Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( Sequence< sal_Int8 >& aOOBmp ) return winDIBStream; } -//------------------------------------------------------------------------------ + // converts the openoffice text/html clipboard format to the HTML Format // well known under MS Windows // the MS HTML Format has a header before the real html data @@ -257,7 +257,7 @@ Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( Sequence< sal_Int8 >& aOOBmp ) // The fragment should be preceded and followed by the HTML comments // <!--StartFragment--> and <!--EndFragment--> (no space between !-- and the // text -//------------------------------------------------------------------------------ + /* Sequence< sal_Int8 > SAL_CALL TextHtmlToHTMLFormat( Sequence< sal_Int8 >& aTextHtml ) { @@ -525,9 +525,9 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal) return FileListToByteSequence(files); } -//------------------------------------------------------------------------ + // convert a windows bitmap handle into a openoffice bitmap -//------------------------------------------------------------------------ + Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP ) { diff --git a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx index 2f5128c5f59d..2a0dfe78f604 100644 --- a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx +++ b/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx @@ -25,9 +25,9 @@ using namespace ::com::sun::star::datatransfer; using namespace ::com::sun::star::uno; -//------------------------------------------------------------------ + // assuming a '\0' terminated string if no length specified -//------------------------------------------------------------------ + int CalcBuffSizeForTextConversion( UINT code_page, LPCSTR lpMultiByteString, int nLen = -1 ) { @@ -39,9 +39,9 @@ int CalcBuffSizeForTextConversion( UINT code_page, LPCSTR lpMultiByteString, int 0 ) * sizeof( sal_Unicode ) ); } -//------------------------------------------------------------------ + // assuming a '\0' terminated string if no length specified -//------------------------------------------------------------------ + int CalcBuffSizeForTextConversion( UINT code_page, LPCWSTR lpWideCharString, int nLen = -1 ) { @@ -55,11 +55,11 @@ int CalcBuffSizeForTextConversion( UINT code_page, LPCWSTR lpWideCharString, int NULL ); } -//------------------------------------------------------------------ + // converts text in one code page into unicode text // automatically calculates the necessary buffer size and allocates // the buffer -//------------------------------------------------------------------ + int MultiByteToWideCharEx( UINT cp_src, LPCSTR lpMultiByteString, @@ -91,11 +91,11 @@ int MultiByteToWideCharEx( UINT cp_src, ptrHGlob.MemSize( ) ); } -//------------------------------------------------------------------ + // converts unicode text into text of the specified code page // automatically calculates the necessary buffer size and allocates // the buffer -//------------------------------------------------------------------ + int WideCharToMultiByteEx( UINT cp_dest, LPCWSTR lpWideCharString, diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index 2ba89c176f5d..754beadaa505 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -45,9 +45,9 @@ #define __uuidof(I) IID_##I #endif -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace com::sun::star::datatransfer; using namespace com::sun::star::datatransfer::clipboard; @@ -55,9 +55,9 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; -//------------------------------------------------------------------------ + // a helper class that will be thrown by the function validateFormatEtc -//------------------------------------------------------------------------ + class CInvalidFormatEtcException { @@ -66,9 +66,9 @@ public: CInvalidFormatEtcException( HRESULT hr ) : m_hr( hr ) {}; }; -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CXTDataObject::CXTDataObject( const Reference< XComponentContext >& rxContext, const Reference< XTransferable >& aXTransferable ) @@ -80,9 +80,9 @@ CXTDataObject::CXTDataObject( const Reference< XComponentContext >& rxContext, { } -//------------------------------------------------------------------------ + // IUnknown->QueryInterface -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -103,18 +103,18 @@ STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//------------------------------------------------------------------------ + // IUnknown->AddRef -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::AddRef( ) { return static_cast< ULONG >( InterlockedIncrement( &m_nRefCnt ) ); } -//------------------------------------------------------------------------ + // IUnknown->Release -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::Release( ) { @@ -127,9 +127,9 @@ STDMETHODIMP_(ULONG) CXTDataObject::Release( ) return nRefCnt; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ) { @@ -175,9 +175,9 @@ STDMETHODIMP CXTDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium return S_OK; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + // inline void SAL_CALL CXTDataObject::renderDataAndSetupStgMedium( @@ -204,9 +204,9 @@ void SAL_CALL CXTDataObject::renderDataAndSetupStgMedium( setupStgMedium( fetc, stgTransfHelper, stgmedium ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + //inline void SAL_CALL CXTDataObject::renderLocaleAndSetupStgMedium( @@ -226,9 +226,9 @@ void SAL_CALL CXTDataObject::renderLocaleAndSetupStgMedium( throw CInvalidFormatEtcException( DV_E_FORMATETC ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + //inline void SAL_CALL CXTDataObject::renderUnicodeAndSetupStgMedium( @@ -263,9 +263,9 @@ void SAL_CALL CXTDataObject::renderUnicodeAndSetupStgMedium( stgmedium ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + //inline void SAL_CALL CXTDataObject::renderAnyDataAndSetupStgMedium( @@ -337,9 +337,9 @@ void SAL_CALL CXTDataObject::renderAnyDataAndSetupStgMedium( stgmedium ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + HRESULT SAL_CALL CXTDataObject::renderSynthesizedFormatAndSetupStgMedium( FORMATETC& fetc, STGMEDIUM& stgmedium ) { @@ -377,9 +377,9 @@ HRESULT SAL_CALL CXTDataObject::renderSynthesizedFormatAndSetupStgMedium( FORMAT return hr; } -//------------------------------------------------------------------------ + // the transferable must have only text, so we will synthesize unicode text -//------------------------------------------------------------------------ + void SAL_CALL CXTDataObject::renderSynthesizedUnicodeAndSetupStgMedium( FORMATETC& fetc, STGMEDIUM& stgmedium ) { @@ -410,9 +410,9 @@ void SAL_CALL CXTDataObject::renderSynthesizedUnicodeAndSetupStgMedium( FORMATET setupStgMedium( fetc, stgTransfHelper, stgmedium ); } -//------------------------------------------------------------------------ + // the transferable must have only unicode text so we will sythesize text -//------------------------------------------------------------------------ + void SAL_CALL CXTDataObject::renderSynthesizedTextAndSetupStgMedium( FORMATETC& fetc, STGMEDIUM& stgmedium ) { @@ -446,9 +446,9 @@ void SAL_CALL CXTDataObject::renderSynthesizedTextAndSetupStgMedium( FORMATETC& setupStgMedium( fetc, stgTransfHelper, stgmedium ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + void SAL_CALL CXTDataObject::renderSynthesizedHtmlAndSetupStgMedium( FORMATETC& fetc, STGMEDIUM& stgmedium ) { @@ -486,9 +486,9 @@ void SAL_CALL CXTDataObject::renderSynthesizedHtmlAndSetupStgMedium( FORMATETC& stgmedium ); } -//------------------------------------------------------------------------ + // IDataObject->EnumFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc ) @@ -517,9 +517,9 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc( return hr; } -//------------------------------------------------------------------------ + // IDataObject->QueryGetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc ) { @@ -531,72 +531,72 @@ STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc ) return m_FormatEtcContainer.hasFormatEtc( *pFormatetc ) ? S_OK : S_FALSE; } -//------------------------------------------------------------------------ + // IDataObject->GetDataHere -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetDataHere( LPFORMATETC, LPSTGMEDIUM ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->GetCanonicalFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetCanonicalFormatEtc( LPFORMATETC, LPFORMATETC ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->SetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::SetData( LPFORMATETC, LPSTGMEDIUM, BOOL ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DAdvise( LPFORMATETC, DWORD, LPADVISESINK, DWORD * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DUnadvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DUnadvise( DWORD ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->EnumDAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumDAdvise( LPENUMSTATDATA * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // for our convenience -//------------------------------------------------------------------------ + CXTDataObject::operator IDataObject*( ) { return static_cast< IDataObject* >( this ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline DataFlavor SAL_CALL CXTDataObject::formatEtcToDataFlavor( const FORMATETC& aFormatEtc ) const @@ -615,9 +615,9 @@ DataFlavor SAL_CALL CXTDataObject::formatEtcToDataFlavor( const FORMATETC& aForm return aFlavor; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline void CXTDataObject::validateFormatEtc( LPFORMATETC lpFormatEtc ) const @@ -646,9 +646,9 @@ void CXTDataObject::validateFormatEtc( LPFORMATETC lpFormatEtc ) const throw CInvalidFormatEtcException( DV_E_TYMED ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + //inline void SAL_CALL CXTDataObject::setupStgMedium( const FORMATETC& fetc, @@ -681,9 +681,9 @@ void SAL_CALL CXTDataObject::setupStgMedium( const FORMATETC& fetc, OSL_ASSERT( sal_False ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline void SAL_CALL CXTDataObject::invalidateStgMedium( STGMEDIUM& stgmedium ) const @@ -691,9 +691,9 @@ void SAL_CALL CXTDataObject::invalidateStgMedium( STGMEDIUM& stgmedium ) const stgmedium.tymed = TYMED_NULL; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline HRESULT SAL_CALL CXTDataObject::translateStgExceptionCode( HRESULT hr ) const @@ -714,9 +714,9 @@ HRESULT SAL_CALL CXTDataObject::translateStgExceptionCode( HRESULT hr ) const return hrTransl; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + inline void SAL_CALL CXTDataObject::InitializeFormatEtcContainer( ) { @@ -731,9 +731,9 @@ inline void SAL_CALL CXTDataObject::InitializeFormatEtcContainer( ) // CEnumFormatEtc //============================================================================ -//---------------------------------------------------------------------------- + // ctor -//---------------------------------------------------------------------------- + CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN lpUnkOuter, const CFormatEtcContainer& aFormatEtcContainer ) : m_nRefCnt( 0 ), @@ -743,9 +743,9 @@ CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN lpUnkOuter, const CFormatEtcContainer& Reset( ); } -//---------------------------------------------------------------------------- + // IUnknown->QueryInterface -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -767,9 +767,9 @@ STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//---------------------------------------------------------------------------- + // IUnknown->AddRef -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) { @@ -778,9 +778,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) return InterlockedIncrement( &m_nRefCnt ); } -//---------------------------------------------------------------------------- + // IUnknown->Release -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) { @@ -794,9 +794,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) return nRefCnt; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Next -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Next( ULONG nRequested, LPFORMATETC lpDest, ULONG* lpFetched ) { @@ -813,18 +813,18 @@ STDMETHODIMP CEnumFormatEtc::Next( ULONG nRequested, LPFORMATETC lpDest, ULONG* return (nFetched == nRequested) ? S_OK : S_FALSE; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Skip -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt ) { return m_FormatEtcContainer.skipFormatEtc( celt ) ? S_OK : S_FALSE; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Reset -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Reset( ) { @@ -832,9 +832,9 @@ STDMETHODIMP CEnumFormatEtc::Reset( ) return S_OK; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Clone -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Clone( IEnumFORMATETC** ppenum ) { diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx index f0f5daf6e266..13efa57f694e 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/dtrans/source/win32/ftransl/ftransl.cxx @@ -48,9 +48,9 @@ const OUString Windows_FormatName ("windows_formatname"); const com::sun::star::uno::Type CppuType_ByteSequence = ::getCppuType((const com::sun::star::uno::Sequence<sal_Int8>*)0); const com::sun::star::uno::Type CppuType_String = ::getCppuType((const OUString*)0); -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace osl; using namespace cppu; @@ -60,9 +60,9 @@ using namespace com::sun::star::lang; using namespace com::sun::star::datatransfer; using namespace com::sun::star::container; -//------------------------------------------------------------------------ + // helper functions -//------------------------------------------------------------------------ + namespace MODULE_PRIVATE { @@ -74,17 +74,17 @@ namespace MODULE_PRIVATE } } -//------------------------------------------------ + // -//------------------------------------------------ + FormatEntry::FormatEntry() { } -//------------------------------------------------ + // -//------------------------------------------------ + FormatEntry::FormatEntry( const char* mime_content_type, @@ -105,9 +105,9 @@ FormatEntry::FormatEntry( aStandardFormatId = std_clipboard_format_id; } -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext >& rxContext ) : m_xContext( rxContext ) @@ -115,9 +115,9 @@ CDataFormatTranslator::CDataFormatTranslator( const Reference< XComponentContext initTranslationTable( ); } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + Any SAL_CALL CDataFormatTranslator::getSystemDataTypeFromDataFlavor( const DataFlavor& aDataFlavor ) throw( RuntimeException ) @@ -174,9 +174,9 @@ Any SAL_CALL CDataFormatTranslator::getSystemDataTypeFromDataFlavor( const DataF return aAny; } -//------------------------------------------------------------------------ + // -//------------------------------------------------------------------------ + DataFlavor SAL_CALL CDataFormatTranslator::getDataFlavorFromSystemDataType( const Any& aSysDataType ) throw( RuntimeException ) @@ -205,9 +205,9 @@ DataFlavor SAL_CALL CDataFormatTranslator::getDataFlavorFromSystemDataType( cons return aFlavor; } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + OUString SAL_CALL CDataFormatTranslator::getImplementationName( ) throw( RuntimeException ) @@ -222,9 +222,9 @@ sal_Bool SAL_CALL CDataFormatTranslator::supportsService( const OUString& Servic return cppu::supportsService(this, ServiceName); } -// ------------------------------------------------- + // XServiceInfo -// ------------------------------------------------- + Sequence< OUString > SAL_CALL CDataFormatTranslator::getSupportedServiceNames( ) throw( RuntimeException ) @@ -232,14 +232,14 @@ Sequence< OUString > SAL_CALL CDataFormatTranslator::getSupportedServiceNames( ) return DataFormatTranslator_getSupportedServiceNames( ); } -// ------------------------------------------------- + // to optimize searching we add all entries with a // standard clipboard format number first, in the // table before the entries with CF_INVALID // if we are searching for a standard clipboard // format number we can stop if we find the first // CF_INVALID -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::initTranslationTable() { @@ -492,9 +492,9 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable() m_TranslTable.push_back(FormatEntry("application/x-openoffice-dummy4;windows_formatname=\"SO_DUMMYFORMAT_4\"", "SO_DUMMYFORMAT_4", NULL, CF_INVALID, CPPUTYPE_DEFAULT)); } -// ------------------------------------------------- + // -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::findDataFlavorForStandardFormatId( sal_Int32 aStandardFormatId, DataFlavor& aDataFlavor ) const { @@ -518,9 +518,9 @@ void SAL_CALL CDataFormatTranslator::findDataFlavorForStandardFormatId( sal_Int3 } } -// ------------------------------------------------- + // -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::findDataFlavorForNativeFormatName( const OUString& aNativeFormatName, DataFlavor& aDataFlavor ) const { @@ -537,9 +537,9 @@ void SAL_CALL CDataFormatTranslator::findDataFlavorForNativeFormatName( const OU } } -// ------------------------------------------------- + // -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::findStandardFormatIdForCharset( const OUString& aCharset, Any& aAny ) const { @@ -553,9 +553,9 @@ void SAL_CALL CDataFormatTranslator::findStandardFormatIdForCharset( const OUStr } } -// ------------------------------------------------- + // -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::setStandardFormatIdForNativeFormatName( const OUString& aNativeFormatName, Any& aAny ) const { @@ -571,9 +571,9 @@ void SAL_CALL CDataFormatTranslator::setStandardFormatIdForNativeFormatName( con } } -// ------------------------------------------------- + // -// ------------------------------------------------- + void SAL_CALL CDataFormatTranslator::findStdFormatIdOrNativeFormatNameForFullMediaType( const Reference< XMimeContentTypeFactory >& aRefXMimeFactory, @@ -601,18 +601,18 @@ void SAL_CALL CDataFormatTranslator::findStdFormatIdOrNativeFormatNameForFullMed } } -// ------------------------------------------------- + // -// ------------------------------------------------- + inline sal_Bool CDataFormatTranslator::isTextPlainMediaType( const OUString& fullMediaType ) const { return fullMediaType.equalsIgnoreAsciiCase("text/plain"); } -// ------------------------------------------------- + // -// ------------------------------------------------- + DataFlavor SAL_CALL CDataFormatTranslator::mkDataFlv(const OUString& cnttype, const OUString& hpname, Type dtype) { diff --git a/dtrans/source/win32/ftransl/ftranslentry.cxx b/dtrans/source/win32/ftransl/ftranslentry.cxx index efa971528cff..b0bc48cc722e 100644 --- a/dtrans/source/win32/ftransl/ftranslentry.cxx +++ b/dtrans/source/win32/ftransl/ftranslentry.cxx @@ -25,9 +25,9 @@ #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp> #include "ftransl.hxx" -//----------------------------------------------------------------- + // some defines -//----------------------------------------------------------------- + // the service names #define SERVICE_NAME "com.sun.star.datatransfer.DataFormatTranslator" @@ -35,9 +35,9 @@ // the implementation names #define IMPL_NAME "com.sun.star.datatransfer.DataFormatTranslator" -//----------------------------------------------------------------------------------------------------------- + // namespace directives -//----------------------------------------------------------------------------------------------------------- + using namespace ::rtl ; using namespace ::cppu ; @@ -46,18 +46,18 @@ using namespace ::com::sun::star::registry ; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::datatransfer; -//----------------------------------------------------------------- + // create a static object to initialize the shell9x library -//----------------------------------------------------------------- + namespace { - //----------------------------------------------------------------------------------------------------------- + // functions to create a new Clipboad instance; is needed by factory helper implementation // @param rServiceManager - service manager, useful if the component needs other uno services // so we should give it to every UNO-Implementation component - //----------------------------------------------------------------------------------------------------------- + Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { @@ -67,10 +67,10 @@ namespace extern "C" { -//---------------------------------------------------------------------- + // component_getFactory // returns a factory to create XFilePicker-Services -//---------------------------------------------------------------------- + SAL_DLLPUBLIC_EXPORT void* SAL_CALL ftransl_component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx index 3337644f63ab..3b6c75ce010a 100644 --- a/dtrans/source/win32/misc/ImplHelper.cxx +++ b/dtrans/source/win32/misc/ImplHelper.cxx @@ -41,15 +41,15 @@ #define FORMATETC_PARTIAL_MATCH -1 #define FORMATETC_NO_MATCH 0 -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ + + // returns a windows codepage appropriate to the // given mime charset parameter value -//------------------------------------------------------------------------ + sal_uInt32 SAL_CALL getWinCPFromMimeCharset( const OUString& charset ) { @@ -79,10 +79,10 @@ sal_uInt32 SAL_CALL getWinCPFromMimeCharset( const OUString& charset ) return winCP; } -//-------------------------------------------------- + // returns a windows codepage appropriate to the // given locale and locale type -//-------------------------------------------------- + OUString SAL_CALL getWinCPFromLocaleId( LCID lcid, LCTYPE lctype ) { @@ -129,22 +129,22 @@ OUString SAL_CALL getWinCPFromLocaleId( LCID lcid, LCTYPE lctype ) return winCP; } -//-------------------------------------------------- + // returns a mime charset parameter value appropriate // to the given codepage, optional a prefix can be // given, e.g. "windows-" or "cp" -//-------------------------------------------------- + OUString SAL_CALL getMimeCharsetFromWinCP( sal_uInt32 cp, const OUString& aPrefix ) { return aPrefix + cptostr( cp ); } -//-------------------------------------------------- + // returns a mime charset parameter value appropriate // to the given locale id and locale type, optional a // prefix can be given, e.g. "windows-" or "cp" -//-------------------------------------------------- + OUString SAL_CALL getMimeCharsetFromLocaleId( LCID lcid, LCTYPE lctype, const OUString& aPrefix ) { @@ -152,9 +152,9 @@ OUString SAL_CALL getMimeCharsetFromLocaleId( LCID lcid, LCTYPE lctype, const OU return aPrefix + charset; } -//------------------------------------------------------------------------ + // IsOEMCP -//------------------------------------------------------------------------ + sal_Bool SAL_CALL IsOEMCP( sal_uInt32 codepage ) { @@ -172,9 +172,9 @@ sal_Bool SAL_CALL IsOEMCP( sal_uInt32 codepage ) return sal_False; } -//------------------------------------------------------------------------ + // converts a codepage into its string representation -//------------------------------------------------------------------------ + OUString SAL_CALL cptostr( sal_uInt32 codepage ) { @@ -183,7 +183,7 @@ OUString SAL_CALL cptostr( sal_uInt32 codepage ) return OUString::number( static_cast<sal_Int64>( codepage ) ); } -//------------------------------------------------------------------------- + // OleStdDeleteTargetDevice() // // Purpose: @@ -192,7 +192,7 @@ OUString SAL_CALL cptostr( sal_uInt32 codepage ) // // Return Value: // SCODE - S_OK if successful -//------------------------------------------------------------------------- + void SAL_CALL DeleteTargetDevice( DVTARGETDEVICE* ptd ) { @@ -223,7 +223,7 @@ void SAL_CALL DeleteTargetDevice( DVTARGETDEVICE* ptd ) -//------------------------------------------------------------------------- + // OleStdCopyTargetDevice() // // Purpose: @@ -239,7 +239,7 @@ void SAL_CALL DeleteTargetDevice( DVTARGETDEVICE* ptd ) // pointer to allocated copy of ptdSrc // if ptdSrc==NULL then retuns NULL is returned. // if ptdSrc!=NULL and memory allocation fails, then NULL is returned -//------------------------------------------------------------------------- + DVTARGETDEVICE* SAL_CALL CopyTargetDevice( DVTARGETDEVICE* ptdSrc ) { @@ -273,7 +273,7 @@ DVTARGETDEVICE* SAL_CALL CopyTargetDevice( DVTARGETDEVICE* ptdSrc ) } -//------------------------------------------------------------------------- + // OleStdCopyFormatEtc() // // Purpose: @@ -297,7 +297,7 @@ DVTARGETDEVICE* SAL_CALL CopyTargetDevice( DVTARGETDEVICE* ptdSrc ) // returns TRUE if copy was successful; // retuns FALSE if not successful, e.g. one or both of the pointers // were invalid or the pointers were equal -//------------------------------------------------------------------------- + sal_Bool SAL_CALL CopyFormatEtc( LPFORMATETC petcDest, LPFORMATETC petcSrc ) { @@ -344,13 +344,13 @@ sal_Bool SAL_CALL CopyFormatEtc( LPFORMATETC petcDest, LPFORMATETC petcSrc ) return bRet; } -//------------------------------------------------------------------------- + // returns: // 1 for exact match, // 0 for no match, // -1 for partial match (which is defined to mean the left is a subset // of the right: fewer aspects, null target device, fewer medium). -//------------------------------------------------------------------------- + sal_Int32 SAL_CALL CompareFormatEtc( const FORMATETC* pFetcLhs, const FORMATETC* pFetcRhs ) { @@ -420,9 +420,9 @@ sal_Int32 SAL_CALL CompareFormatEtc( const FORMATETC* pFetcLhs, const FORMATETC* } -//------------------------------------------------------------------------- + // -//------------------------------------------------------------------------- + sal_Bool SAL_CALL CompareTargetDevice( DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE* ptdRight ) { diff --git a/dtrans/source/win32/workbench/XTDo.cxx b/dtrans/source/win32/workbench/XTDo.cxx index 20ac2f0dae8e..b4d2b10dbf09 100644 --- a/dtrans/source/win32/workbench/XTDo.cxx +++ b/dtrans/source/win32/workbench/XTDo.cxx @@ -34,9 +34,9 @@ #include <memory> #include <tchar.h> -//------------------------------------------------------------------------ + // namespace directives -//------------------------------------------------------------------------ + using namespace ::std; @@ -44,9 +44,9 @@ using namespace ::std; // OTWrapperDataObject //============================================================================ -//------------------------------------------------------------------------ + // ctor -//------------------------------------------------------------------------ + /* in the constructor we enumerate all formats offered by the transferable and convert the formats into formatetc structures @@ -64,9 +64,9 @@ CXTDataObject::CXTDataObject( ) : } -//------------------------------------------------------------------------ + // IUnknown->QueryInterface -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -89,18 +89,18 @@ STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//------------------------------------------------------------------------ + // IUnknown->AddRef -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::AddRef( ) { return static_cast< ULONG >( InterlockedIncrement( &m_nRefCnt ) ); } -//------------------------------------------------------------------------ + // IUnknown->Release -//------------------------------------------------------------------------ + STDMETHODIMP_(ULONG) CXTDataObject::Release( ) { @@ -156,9 +156,9 @@ STDMETHODIMP CXTDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium return hr; } -//------------------------------------------------------------------------ + // IDataObject->EnumFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc ) { @@ -179,72 +179,72 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** p return hr; } -//------------------------------------------------------------------------ + // IDataObject->QueryGetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->GetDataHere -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetDataHere( LPFORMATETC, LPSTGMEDIUM ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->GetCanonicalFormatEtc -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::GetCanonicalFormatEtc( LPFORMATETC, LPFORMATETC ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->SetData -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::SetData( LPFORMATETC, LPSTGMEDIUM, BOOL ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DAdvise( LPFORMATETC, DWORD, LPADVISESINK, DWORD * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->DUnadvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::DUnadvise( DWORD ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // IDataObject->EnumDAdvise -//------------------------------------------------------------------------ + STDMETHODIMP CXTDataObject::EnumDAdvise( LPENUMSTATDATA * ) { return E_NOTIMPL; } -//------------------------------------------------------------------------ + // for our convenience -//------------------------------------------------------------------------ + CXTDataObject::operator IDataObject*( ) { @@ -256,9 +256,9 @@ CXTDataObject::operator IDataObject*( ) // CEnumFormatEtc //============================================================================ -//---------------------------------------------------------------------------- + // ctor -//---------------------------------------------------------------------------- + CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) : m_nRefCnt( 0 ), @@ -267,9 +267,9 @@ CEnumFormatEtc::CEnumFormatEtc( LPUNKNOWN pUnkDataObj ) : { } -//---------------------------------------------------------------------------- + // IUnknown->QueryInterface -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) { @@ -290,9 +290,9 @@ STDMETHODIMP CEnumFormatEtc::QueryInterface( REFIID iid, LPVOID* ppvObject ) return hr; } -//---------------------------------------------------------------------------- + // IUnknown->AddRef -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) { @@ -301,9 +301,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::AddRef( ) return InterlockedIncrement( &m_nRefCnt ); } -//---------------------------------------------------------------------------- + // IUnknown->Release -//---------------------------------------------------------------------------- + STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) { @@ -320,9 +320,9 @@ STDMETHODIMP_(ULONG) CEnumFormatEtc::Release( ) return nRefCnt; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Next -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFetched ) { @@ -358,9 +358,9 @@ STDMETHODIMP CEnumFormatEtc::Next( ULONG celt, LPFORMATETC rgelt, ULONG* pceltFe return hr; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Skip -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt ) { @@ -377,9 +377,9 @@ STDMETHODIMP CEnumFormatEtc::Skip( ULONG celt ) return hr; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Reset -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Reset( ) { @@ -387,9 +387,9 @@ STDMETHODIMP CEnumFormatEtc::Reset( ) return S_OK; } -//---------------------------------------------------------------------------- + // IEnumFORMATETC->Clone -//---------------------------------------------------------------------------- + STDMETHODIMP CEnumFormatEtc::Clone( IEnumFORMATETC** ppenum ) { diff --git a/dtrans/source/win32/workbench/test_wincb.cxx b/dtrans/source/win32/workbench/test_wincb.cxx index 9dae8556c490..175c58b0ac44 100644 --- a/dtrans/source/win32/workbench/test_wincb.cxx +++ b/dtrans/source/win32/workbench/test_wincb.cxx @@ -46,9 +46,9 @@ #include <process.h> -//------------------------------------------------------------- + // my defines -//------------------------------------------------------------- + #define TEST_CLIPBOARD #define RDB_SYSPATH "d:\\projects\\src623\\dtrans\\wntmsci7\\bin\\applicat.rdb" @@ -58,9 +58,9 @@ #define EVT_INIT_NONSIGNALED FALSE #define EVT_NONAME "" -//------------------------------------------------------------ + // namesapces -//------------------------------------------------------------ + using namespace ::rtl; using namespace ::std; @@ -71,25 +71,25 @@ 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,18 +109,18 @@ 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,9 +129,9 @@ 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,9 +141,9 @@ private: OUString m_Data; }; -//---------------------------------------------------------------- + // ctor -//---------------------------------------------------------------- + CTransferable::CTransferable( ) : m_FlavorList( 1 ), @@ -160,9 +160,9 @@ CTransferable::CTransferable( ) : m_FlavorList[0] = df; } -//---------------------------------------------------------------- + // getTransferData -//---------------------------------------------------------------- + Any SAL_CALL CTransferable::getTransferData( const DataFlavor& aFlavor ) throw(UnsupportedFlavorException, IOException, RuntimeException) @@ -192,9 +192,9 @@ Any SAL_CALL CTransferable::getTransferData( const DataFlavor& aFlavor ) return anyData; } -//---------------------------------------------------------------- + // getTransferDataFlavors -//---------------------------------------------------------------- + Sequence< DataFlavor > SAL_CALL CTransferable::getTransferDataFlavors( ) throw(RuntimeException) @@ -202,9 +202,9 @@ Sequence< DataFlavor > SAL_CALL CTransferable::getTransferDataFlavors( ) return m_FlavorList; } -//---------------------------------------------------------------- + // isDataFlavorSupported -//---------------------------------------------------------------- + sal_Bool SAL_CALL CTransferable::isDataFlavorSupported( const DataFlavor& aFlavor ) throw(RuntimeException) @@ -218,9 +218,9 @@ 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 ) @@ -229,9 +229,9 @@ 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[] ) { @@ -249,9 +249,9 @@ 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,9 +263,9 @@ 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 ) ); @@ -305,9 +305,9 @@ 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 ); diff --git a/dtrans/source/win32/workbench/testmarshal.cxx b/dtrans/source/win32/workbench/testmarshal.cxx index 30d8fe48b2c1..0789b0d41b76 100644 --- a/dtrans/source/win32/workbench/testmarshal.cxx +++ b/dtrans/source/win32/workbench/testmarshal.cxx @@ -36,9 +36,9 @@ #include <process.h> #include "XTDo.hxx" -//------------------------------------------------------------- + // my defines -//------------------------------------------------------------- + #define WRITE_CB #define EVT_MANUAL_RESET TRUE @@ -47,16 +47,16 @@ #define WAIT_MSGLOOP #define RAW_MARSHALING -//------------------------------------------------------------ + // namesapces -//------------------------------------------------------------ + using namespace ::rtl; using namespace ::std; -//------------------------------------------------------------ + // globales -//------------------------------------------------------------ + HANDLE g_hEvtThreadWakeup; @@ -116,9 +116,9 @@ unsigned int _stdcall ThreadProc(LPVOID pParam) //################################################################ -//---------------------------------------------------------------- + // main -//---------------------------------------------------------------- + int SAL_CALL main( int nArgc, char* Argv[] ) { |