summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-11-13 16:13:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-11-14 11:13:24 +0100
commit96aca98168cba4b9055f2e2a16bb1a8f6f6e57ce (patch)
tree2c3aa8c160e6ef2337137f57c3e50204daa9c8da
parentMinor clean-up (diff)
downloadcore-96aca98168cba4b9055f2e2a16bb1a8f6f6e57ce.tar.gz
core-96aca98168cba4b9055f2e2a16bb1a8f6f6e57ce.zip
Minor clean-up
Change-Id: I30a06f693704a8471af39e5232a7abef1056be32
-rw-r--r--include/sfx2/objsh.hxx1
-rw-r--r--sfx2/source/doc/objmisc.cxx12
2 files changed, 8 insertions, 5 deletions
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 3b51ad98ea77..fac2625698cd 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -255,7 +255,6 @@ public:
virtual SfxObjectFactory& GetFactory() const=0;
SfxMedium * GetMedium() const { return pMedium; }
- void ForgetMedium() { pMedium = 0; }
::com::sun::star::uno::Reference<
::com::sun::star::document::XDocumentProperties > getDocProperties();
void UpdateDocInfoForSave( );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 45f9bbcdb914..f1db22ed7c4b 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1351,10 +1351,10 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
// setting the new storage the medium will be based on
pTmpMedium->SetStorage_Impl( xTmpStor );
- ForgetMedium();
- if( !DoSaveCompleted( pTmpMedium ) )
- SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX ) );
- else
+ pMedium = 0;
+ bool ok = DoSaveCompleted( pTmpMedium );
+ assert(pMedium != 0);
+ if( ok )
{
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False );
sal_Bool bSalvage = pSalvageItem ? sal_True : sal_False;
@@ -1368,6 +1368,10 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
// the medium should not dispose the storage, DoSaveCompleted() has let it to do so
pTmpMedium->CanDisposeStorage_Impl( sal_False );
}
+ else
+ {
+ SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX ) );
+ }
}
else
{