summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-04-10 23:54:49 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-04-13 01:54:38 -0400
commitddd2a00ef18e7c8865dc5888d54f99d08aa4063f (patch)
treee2f29a009d1092e9a3e0194a2afe199630002738 /sfx2
parent4b3da418d665b7c9bb0f3a8783b7666330e1ec11 (diff)
Handle load error correctly.
When we fail to load a new document, we shouldn't manually delete the SfxMedium instance there since SfxObjectShell gets to own it after the DoLoadExternal call. And we need to throw an error instead of simply return from load(). Change-Id: Ic194d47dd1caaab3034aba1b9add54c9b5338a38
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a333a984af56..c84e2ad75eb3 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1856,8 +1856,8 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA
{
if (!m_pData->m_pObjectShell->DoLoadExternal(pMedium))
{
- delete pMedium;
- return;
+ throw task::ErrorCodeIOException(
+ OUString(), Reference<XInterface>(), ERRCODE_IO_CANTREAD);
}
pMedium->SetUpdatePickList(false);