Kaydet (Commit) 70c477e8 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#108187 fatal exception on testing if ooxml is a odf

Change-Id: Ie88a66aa8d73bb3c4045629604756470ce51b92b
Reviewed-on: https://gerrit.libreoffice.org/38352Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1d432c0e
......@@ -658,30 +658,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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment