diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-02 11:57:30 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-06-15 11:20:18 +0200 |
commit | 3f9f35973d935784edcc11b20c02382e47c13f70 (patch) | |
tree | 08eec761fd6e48b4d0ac5d199e11b4e98f78e73a /sd | |
parent | 590f0fc2e294d3b168d1d9b512b317ba02d2eec0 (diff) |
Resolves: tdf#108187 fatal exception on testing if ooxml is a odf
Change-Id: Ie88a66aa8d73bb3c4045629604756470ce51b92b
Reviewed-on: https://gerrit.libreoffice.org/38354
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit 5e0e1facbdf1c4a2a3db253aa39c6253506a2f1b)
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index d1a0b7472dd8..3ab1e5ad9a5e 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -662,30 +662,39 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl, Control&, void) { WaitObject aWait( GetParentDialog() ); + bool bHideTreeDocument = true; + // is it a draw file? // open with READ, otherwise the Storages might write into the file! uno::Reference < embed::XStorage > xStorage = aMedium.GetStorage(); DBG_ASSERT( xStorage.is(), "No storage!" ); uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY ); - if( xAccess.is() && - ( xAccess->hasByName( pStarDrawXMLContent ) || - xAccess->hasByName( pStarDrawOldXMLContent ) ) ) + if (xAccess.is()) { - SdDrawDocument* pBookmarkDoc = mpDoc->OpenBookmarkDoc( aFile ); - if( pBookmarkDoc ) + try + { + if (xAccess->hasByName(pStarDrawXMLContent) || + xAccess->hasByName(pStarDrawOldXMLContent)) + { + if (SdDrawDocument* pBookmarkDoc = mpDoc->OpenBookmarkDoc(aFile)) + { + aLastFile = aFile; + + m_pLbTreeDocument->Clear(); + m_pLbTreeDocument->Fill(pBookmarkDoc, true, aFile); + mpDoc->CloseBookmarkDoc(); + m_pLbTreeDocument->Show(); + bHideTreeDocument = false; + } + } + } + catch (...) { - aLastFile = aFile; - - m_pLbTreeDocument->Clear(); - m_pLbTreeDocument->Fill( pBookmarkDoc, true, aFile ); - mpDoc->CloseBookmarkDoc(); - m_pLbTreeDocument->Show(); } - else - m_pLbTreeDocument->Hide(); } - else + + if (bHideTreeDocument) m_pLbTreeDocument->Hide(); } |