SfxObjectShell may not have a medium

This commit is contained in:
Caolán McNamara 2011-12-20 15:41:18 +00:00
parent 545921f914
commit b0df6d86e4

View File

@ -63,7 +63,8 @@ namespace ooo
VBAHELPER_DLLPRIVATE inline bool isAlienDoc( SfxObjectShell& rDocShell, const char* pMimeType ) VBAHELPER_DLLPRIVATE inline bool isAlienDoc( SfxObjectShell& rDocShell, const char* pMimeType )
{ {
bool bRes( false ); bool bRes( false );
const SfxFilter *pFilt = rDocShell.GetMedium()->GetFilter(); const SfxMedium *pMedium = rDocShell.GetMedium();
const SfxFilter *pFilt = pMedium ? pMedium->GetFilter() : NULL;
if ( pFilt && pFilt->IsAlienFormat() ) if ( pFilt && pFilt->IsAlienFormat() )
bRes = ( pFilt->GetMimeType().compareToAscii( pMimeType ) == 0 ); bRes = ( pFilt->GetMimeType().compareToAscii( pMimeType ) == 0 );
return bRes; return bRes;