[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sd/source
Caolán McNamara
caolanm at redhat.com
Fri Jun 2 11:25:59 UTC 2017
sd/source/ui/dlg/tpaction.cxx | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
New commits:
commit 57ccbbc1bae230b9f03f808d8b5d363f22fa1b25
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 2 11:57:30 2017 +0100
Resolves: tdf#108187 fatal exception on testing if ooxml is a odf
Change-Id: Ie88a66aa8d73bb3c4045629604756470ce51b92b
Reviewed-on: https://gerrit.libreoffice.org/38353
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index a0dec36b6c8c..d106886d8f31 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();
}
More information about the Libreoffice-commits
mailing list