diff options
Diffstat (limited to 'dtrans/source/win32/dtobj/DOTransferable.cxx')
-rw-r--r-- | dtrans/source/win32/dtobj/DOTransferable.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
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 |