summaryrefslogtreecommitdiff
path: root/embedserv/source/embed/ed_ipersiststr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'embedserv/source/embed/ed_ipersiststr.cxx')
-rw-r--r--embedserv/source/embed/ed_ipersiststr.cxx40
1 files changed, 17 insertions, 23 deletions
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx
index 68d3a45dd94b..698bbe13f586 100644
--- a/embedserv/source/embed/ed_ipersiststr.cxx
+++ b/embedserv/source/embed/ed_ipersiststr.cxx
@@ -175,7 +175,6 @@ EmbedDocument_Impl::EmbedDocument_Impl( const uno::Reference< lang::XMultiServic
{
m_xOwnAccess = new EmbeddedDocumentInstanceAccess_Impl( this );
m_pDocHolder = new DocumentHolder( xFactory, m_xOwnAccess );
- m_pDocHolder->acquire();
}
EmbedDocument_Impl::~EmbedDocument_Impl()
@@ -192,28 +191,25 @@ EmbedDocument_Impl::~EmbedDocument_Impl()
m_pDocHolder->CloseDocument();
m_pDocHolder->CloseFrame();
}
-
- m_pDocHolder->release();
}
uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Impl( uno::Reference< io::XInputStream > const & xStream, DWORD /*nStreamMode*/, LPCOLESTR pFilePath )
{
- uno::Sequence< beans::PropertyValue > aArgs( 3 );
-
- sal_Int32 nInd = 0; // must not be bigger than the preset size
- aArgs[nInd].Name = "FilterName";
- aArgs[nInd++].Value <<= getFilterNameFromGUID_Impl( &m_guid );
+ uno::Sequence< beans::PropertyValue > aArgs( xStream.is() ? 3 : 2 );
+ auto pArgs = aArgs.getArray();
+ pArgs[0].Name = "FilterName";
+ pArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid );
if ( xStream.is() )
{
- aArgs[nInd].Name = "InputStream";
- aArgs[nInd++].Value <<= xStream;
- aArgs[nInd].Name = "URL";
- aArgs[nInd++].Value <<= OUString( "private:stream" );
+ pArgs[1].Name = "InputStream";
+ pArgs[1].Value <<= xStream;
+ pArgs[2].Name = "URL";
+ pArgs[2].Value <<= OUString( "private:stream" );
}
else
{
- aArgs[nInd].Name = "URL";
+ pArgs[1].Name = "URL";
OUString sDocUrl;
if ( pFilePath )
@@ -227,11 +223,9 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp
sDocUrl = aURL.Complete;
}
- aArgs[nInd++].Value <<= sDocUrl;
+ pArgs[1].Value <<= sDocUrl;
}
- aArgs.realloc( nInd );
-
// aArgs[].Name = "ReadOnly";
// aArgs[].Value <<= sal_False; //( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False );
@@ -241,14 +235,14 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp
uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForStoring_Impl( uno::Reference< io::XOutputStream > const & xStream)
{
uno::Sequence< beans::PropertyValue > aArgs( xStream.is() ? 2 : 1 );
-
- aArgs[0].Name = "FilterName";
- aArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid );
+ auto pArgs = aArgs.getArray();
+ pArgs[0].Name = "FilterName";
+ pArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid );
if ( xStream.is() )
{
- aArgs[1].Name = "OutputStream";
- aArgs[1].Value <<= xStream;
+ pArgs[1].Name = "OutputStream";
+ pArgs[1].Value <<= xStream;
}
return aArgs;
@@ -274,7 +268,7 @@ HRESULT EmbedDocument_Impl::SaveTo_Impl( IStorage* pStg )
// IUnknown
-COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::QueryInterface( REFIID riid, void FAR* FAR* ppv )
+COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::QueryInterface(REFIID riid, void** ppv)
{
if(IsEqualIID(riid, IID_IUnknown))
{
@@ -588,7 +582,7 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::Save( IStorage *pStgSave,
if ( !fSameAsLoad && pStgSave != m_pMasterStorage )
{
OSL_ENSURE( m_pMasterStorage, "How could the document be initialized without storage!??" );
- HRESULT hr = m_pMasterStorage->CopyTo( NULL, nullptr, nullptr, pStgSave );
+ HRESULT hr = m_pMasterStorage->CopyTo( 0, nullptr, nullptr, pStgSave );
if ( FAILED( hr ) ) return E_FAIL;
STATSTG aStat;