diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 13:40:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-18 15:36:16 +0100 |
commit | 15920e3e0843ad618898d20dc3b784c4778bcde4 (patch) | |
tree | 1e3c1d4cf608f567b344a7079cae3b57333f5b6f /svx | |
parent | b0f54746be824343379ea957d4220102e14c0f75 (diff) |
coverity#1215318 Uncaught exception
Change-Id: I784198cacba86fe1778e49ceebe574b9cbd6888b
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 41f607cef232..17204a0a05a6 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -94,10 +94,19 @@ GalleryTheme::~GalleryTheme() void GalleryTheme::ImplCreateSvDrawStorage() { - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); - // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) - if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + try + { + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); + // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) + if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + } + catch (const css::ucb::ContentCreationException& e) + { + SAL_WARN("svx", "failed to open: " + << GetSdvURL().GetMainURL(INetURLObject::NO_DECODE) + << "due to : " << e.Message); + } } bool GalleryTheme::ImplWriteSgaObject( const SgaObject& rObj, size_t nPos, GalleryObject* pExistentEntry ) |