diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:56:16 +0200 |
commit | a233dac0653f3f3054f7ad2da114ed989747e89a (patch) | |
tree | bf1e11438321c06125a94308649c496648061ccb /svtools/source/misc/transfer.cxx | |
parent | not link cairocanvas against stl anymore (diff) | |
parent | callcatcher: clean up Dir and DirEntry (diff) | |
download | core-a233dac0653f3f3054f7ad2da114ed989747e89a.tar.gz core-a233dac0653f3f3054f7ad2da114ed989747e89a.zip |
resyncing to master
Diffstat (limited to 'svtools/source/misc/transfer.cxx')
-rw-r--r-- | svtools/source/misc/transfer.cxx | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 4b24ed4330fd..cbb5eedb3bb3 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -65,6 +65,7 @@ #include <svtools/wmf.hxx> #include <svtools/imap.hxx> #include <svtools/transfer.hxx> +#include <rtl/strbuf.hxx> #include <cstdio> // -------------- @@ -879,15 +880,16 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, { case( SOT_FORMATSTR_ID_SOLK ): { - ByteString sURL( rBmk.GetURL(), eSysCSet ), - sDesc( rBmk.GetDescription(), eSysCSet ); - ByteString sOut( ByteString::CreateFromInt32( sURL.Len() )); - ( sOut += '@' ) += sURL; - sOut += ByteString::CreateFromInt32( sDesc.Len() ); - ( sOut += '@' ) += sDesc; - - Sequence< sal_Int8 > aSeq( sOut.Len() ); - memcpy( aSeq.getArray(), sOut.GetBuffer(), sOut.Len() ); + rtl::OString sURL(rtl::OUStringToOString(rBmk.GetURL(), eSysCSet)); + rtl::OString sDesc(rtl::OUStringToOString(rBmk.GetDescription(), eSysCSet)); + rtl::OStringBuffer sOut; + sOut.append(sURL.getLength()); + sOut.append('@').append(sURL); + sOut.append(sDesc.getLength()); + sOut.append('@').append(sDesc); + + Sequence< sal_Int8 > aSeq(sOut.getLength()); + memcpy(aSeq.getArray(), sOut.getStr(), sOut.getLength()); maAny <<= aSeq; } break; @@ -973,22 +975,6 @@ sal_Bool TransferableHelper::SetINetImage( const INetImage& rINtImg, // ----------------------------------------------------------------------------- -sal_Bool TransferableHelper::SetFileList( const FileList& rFileList, - const ::com::sun::star::datatransfer::DataFlavor& ) -{ - SvMemoryStream aMemStm( 4096, 4096 ); - - aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); - aMemStm << rFileList; - - maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), - aMemStm.Seek( STREAM_SEEK_TO_END ) ); - - return( maAny.hasValue() ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableHelper::SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const DataFlavor& rFlavor ) { SotStorageStreamRef xStm( new SotStorageStream( String() ) ); @@ -1020,15 +1006,6 @@ sal_Bool TransferableHelper::SetObject( void* pUserObject, sal_uInt32 nUserObjec // ----------------------------------------------------------------------------- -sal_Bool TransferableHelper::SetInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf, - const ::com::sun::star::datatransfer::DataFlavor& ) -{ - maAny <<= rIf; - return( maAny.hasValue() ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableHelper::WriteObject( SotStorageStreamRef&, void*, sal_uInt32, const DataFlavor& ) { OSL_FAIL( "TransferableHelper::WriteObject( ... ) not implemented" ); @@ -2212,15 +2189,6 @@ sal_Bool TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, Refe // ----------------------------------------------------------------------------- - -sal_Bool TransferableDataHelper::GetInterface( SotFormatStringId nFormat, Reference< XInterface >& rIf ) -{ - DataFlavor aFlavor; - return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetInterface( aFlavor, rIf ) ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableDataHelper::GetInterface( const DataFlavor& rFlavor, Reference< XInterface >& rIf ) { const Any aAny( GetAny( rFlavor ) ); |