diff options
author | Noel <noel.grandin@collabora.co.uk> | 2020-12-21 16:28:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-22 07:41:48 +0100 |
commit | db9f13986fc7ef3d4b44d71459c58e9ea0ae8bcb (patch) | |
tree | 5cea6356782106abd471e77aefcf43e20e68069a /sd/source | |
parent | 0eeb310d9ed8654ac4c96c444ebad49a567ad618 (diff) |
split SotStorageStream into two classes
since it has two completely different paths of control
Change-Id: I89b739d318d52245208a4bda1230f69d19f3ae0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108104
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/View.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/sdxfer.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 16 |
4 files changed, 12 insertions, 14 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 6302608f93cc..4752d85f16b0 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -559,7 +559,7 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo return bOK; } -bool SdTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pObject, sal_uInt32 nObjectType, const DataFlavor& ) +bool SdTransferable::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pObject, sal_uInt32 nObjectType, const DataFlavor& ) { bool bRet = false; @@ -580,8 +580,7 @@ bool SdTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* { css::uno::Reference<css::io::XOutputStream> xDocOut( new utl::OOutputStreamWrapper( *rxOStm ) ); - if( SvxDrawingLayerExport( pDoc, xDocOut, xComponent, (pDoc->GetDocumentType() == DocumentType::Impress) ? "com.sun.star.comp.Impress.XMLClipboardExporter" : "com.sun.star.comp.DrawingLayer.XMLExporter" ) ) - rxOStm->Commit(); + SvxDrawingLayerExport( pDoc, xDocOut, xComponent, (pDoc->GetDocumentType() == DocumentType::Impress) ? "com.sun.star.comp.Impress.XMLClipboardExporter" : "com.sun.star.comp.DrawingLayer.XMLExporter" ); } xComponent->dispose(); @@ -626,7 +625,6 @@ bool SdTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* } bRet = true; - rxOStm->Commit(); } catch ( Exception& ) {} diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 4693ce3e9596..3d0eca9750b5 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -167,7 +167,7 @@ public: SdrMediaObj* InsertMediaObj( const OUString& rURL, const OUString& rMimeType, sal_Int8& rAction, const Point& rPos, const Size& rSize ); - bool PasteRTFTable( const ::tools::SvRef<SotStorageStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ); + bool PasteRTFTable( const ::tools::SvRef<SotTempStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ); bool IsPresObjSelected(bool bOnPage = true, bool bOnMasterPage = true, bool bCheckPresObjListOnly = false, bool bCheckLayoutOnly = false) const; diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx index b142291e7124..7285ac0a620a 100644 --- a/sd/source/ui/inc/sdxfer.hxx +++ b/sd/source/ui/inc/sdxfer.hxx @@ -106,7 +106,7 @@ protected: virtual void AddSupportedFormats() override; virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override; - virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; + virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor& rFlavor ) override; virtual void ObjectReleased() override final; virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override; diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index d5c2f494c3e6..9657e76fc492 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -305,7 +305,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, // ImageMap? if( !pOwnData && aDataHelper.HasFormat( SotClipboardFormatId::SVIM ) ) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVIM, xStm ) ) { @@ -324,7 +324,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( ( bIsRTF || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ) && ! aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) ) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) ) { @@ -668,7 +668,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(!bReturn && CHECK_FORMAT_TRANS( SotClipboardFormatId::DRAWING )) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) ) { @@ -1193,7 +1193,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(!bReturn && (!bLink || pPickObj) && CHECK_FORMAT_TRANS(SotClipboardFormatId::SVXB)) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ) ) { @@ -1382,7 +1382,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::HTML)) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::HTML, xStm ) ) { @@ -1394,7 +1394,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT)) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT, xStm ) ) { OutlinerView* pOLV = GetTextEditOutlinerView(); @@ -1425,7 +1425,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, bool bIsRTF = CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF); if (bIsRTF || CHECK_FORMAT_TRANS(SotClipboardFormatId::RICHTEXT)) { - ::tools::SvRef<SotStorageStream> xStm; + ::tools::SvRef<SotTempStream> xStm; if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) ) { @@ -1523,7 +1523,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, return bReturn; } -bool View::PasteRTFTable( const ::tools::SvRef<SotStorageStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ) +bool View::PasteRTFTable( const ::tools::SvRef<SotTempStream>& xStm, SdrPage* pPage, SdrInsertFlags nPasteOptions ) { std::unique_ptr<SdDrawDocument> pModel(new SdDrawDocument( DocumentType::Impress, mpDocSh )); pModel->NewOrLoadCompleted(DocCreationMode::New); |