summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-21 16:28:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-22 07:41:48 +0100
commitdb9f13986fc7ef3d4b44d71459c58e9ea0ae8bcb (patch)
tree5cea6356782106abd471e77aefcf43e20e68069a /sc
parent0eeb310d9ed8654ac4c96c444ebad49a567ad618 (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 'sc')
-rw-r--r--sc/source/ui/app/drwtrans.cxx8
-rw-r--r--sc/source/ui/app/transobj.cxx3
-rw-r--r--sc/source/ui/inc/drwtrans.hxx2
-rw-r--r--sc/source/ui/inc/transobj.hxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx2
-rw-r--r--sc/source/ui/view/viewfun4.cxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx6
8 files changed, 11 insertions, 16 deletions
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 5aa2d53aa6a7..a3526cebb19d 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -428,7 +428,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c
return bOK;
}
-bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+bool ScDrawTransferObj::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const css::datatransfer::DataFlavor& /* rFlavor */ )
{
// called from SetObject, put data into stream
@@ -468,8 +468,7 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi
{
css::uno::Reference<css::io::XOutputStream> xDocOut( new utl::OOutputStreamWrapper( *rxOStm ) );
- if( SvxDrawingLayerExport( pDrawModel, xDocOut ) )
- rxOStm->Commit();
+ SvxDrawingLayerExport( pDrawModel, xDocOut );
}
bRet = ( rxOStm->GetError() == ERRCODE_NONE );
@@ -510,8 +509,6 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi
if ( xTrans.is() )
xTrans->commit();
}
-
- rxOStm->Commit();
}
catch ( uno::Exception& )
{
@@ -554,7 +551,6 @@ bool ScDrawTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, voi
xWorkStore->dispose();
xWorkStore.clear();
- rxOStm->Commit();
}
catch ( uno::Exception& )
{}
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 713a5d8e6ea8..b83a085d5c08 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -442,7 +442,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
return bOK;
}
-bool ScTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+bool ScTransferObj::WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const datatransfer::DataFlavor& rFlavor )
{
// called from SetObject, put data into stream
@@ -530,7 +530,6 @@ bool ScTransferObj::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* p
xWorkStore->dispose();
xWorkStore.clear();
- rxOStm->Commit();
}
break;
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index f45727674297..bfb5175738dc 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -72,7 +72,7 @@ public:
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,
+ virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const css::datatransfer::DataFlavor& rFlavor ) override;
virtual void DragFinished( sal_Int8 nDropAction ) override;
diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx
index 360b46f9a3e8..fdcfd6f408dc 100644
--- a/sc/source/ui/inc/transobj.hxx
+++ b/sc/source/ui/inc/transobj.hxx
@@ -73,7 +73,7 @@ public:
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,
+ virtual bool WriteObject( tools::SvRef<SotTempStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
const css::datatransfer::DataFlavor& rFlavor ) override;
virtual void DragFinished( sal_Int8 nDropAction ) override;
virtual sal_Bool SAL_CALL isComplex() override;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 243dd206f655..9dadd10d5927 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3931,7 +3931,7 @@ static SotClipboardFormatId lcl_GetDropFormatId( const uno::Reference<datatransf
// If it's a Writer object, insert RTF instead of OLE
bool bDoRtf = false;
- tools::SvRef<SotStorageStream> xStm;
+ tools::SvRef<SotTempStream> xStm;
TransferableObjectDescriptor aObjDesc;
if( aDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aObjDesc ) &&
aDataHelper.GetSotStorageStream( SotClipboardFormatId::EMBED_SOURCE, xStm ) )
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index af9e50ab2373..95b6bd3d7cde 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -777,7 +777,7 @@ bool ScViewFunc::PasteOnDrawObjectLinked(
if ( aDataHelper.HasFormat( SotClipboardFormatId::SVXB ) )
{
- tools::SvRef<SotStorageStream> xStm;
+ tools::SvRef<SotTempStream> xStm;
ScDrawView* pScDrawView = GetScDrawView();
if( pScDrawView && aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ) )
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index aae8c1bff580..5697b0ba2291 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -159,7 +159,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
ScAddress( nStartCol, nStartRow, GetViewData().GetTabNo() ) );
OUString aStr;
- tools::SvRef<SotStorageStream> xStream;
+ tools::SvRef<SotTempStream> xStream;
if ( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStream ) && xStream.is() )
// mba: clipboard always must contain absolute URLs (could be from alien source)
aImpEx.ImportStream( *xStream, OUString(), SotClipboardFormatId::RTF );
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index aad9b69a8719..e5d52fabfe83 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -300,7 +300,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
auto pStrBuffer = std::make_shared<OUString>();
- tools::SvRef<SotStorageStream> xStream;
+ tools::SvRef<SotTempStream> xStream;
if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.is() )
{
if (nFormatId == SotClipboardFormatId::HTML &&
@@ -497,7 +497,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
}
else if (nFormatId == SotClipboardFormatId::SVXB)
{
- tools::SvRef<SotStorageStream> xStm;
+ tools::SvRef<SotTempStream> xStm;
if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::SVXB, xStm ) )
{
Graphic aGraphic;
@@ -507,7 +507,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
}
else if ( nFormatId == SotClipboardFormatId::DRAWING )
{
- tools::SvRef<SotStorageStream> xStm;
+ tools::SvRef<SotTempStream> xStm;
if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) )
{
MakeDrawLayer(); // before loading model, so 3D factory has been created