diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-10-11 18:49:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-15 07:56:42 +0200 |
commit | 9ec8bf8f22fe74884185492ef2576ce79b41e4f1 (patch) | |
tree | 0b162c71c51a55125a2ce6055632d4f96180f431 /editeng | |
parent | a84e3df74eecc8778e3d5be5dd80ad4ddb511edf (diff) |
add SvStream::TellEnd
and simplify callsites to use it instead of the current
"seek to end, find pos, seek back to original pos"
pattern
Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c
Reviewed-on: https://gerrit.libreoffice.org/61738
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eeobj.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index ddac7cb5731b..3474bdc25be2 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -55,14 +55,10 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo // 2) Don't have the old pool defaults and the StyleSheetPool here. SvMemoryStream* pStream = (nT == SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT ) ? &GetODFStream() : &GetRTFStream(); - pStream->Seek( STREAM_SEEK_TO_END ); - sal_Int32 nLen = pStream->Tell(); + sal_Int32 nLen = pStream->TellEnd(); if (nLen < 0) { abort(); } - pStream->Seek(0); - uno::Sequence< sal_Int8 > aSeq( nLen ); - memcpy( aSeq.getArray(), pStream->GetData(), nLen ); - aAny <<= aSeq; + aAny <<= uno::Sequence< sal_Int8 >( static_cast< const sal_Int8* >(pStream->GetData()), pStream->TellEnd() ); } else { |