Kaydet (Commit) 4d9d727a authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#736864 Dereference before null check

Change-Id: Ia26b4b391de088487e30a2767660ade6c147eeb4
üst 85834e2e
...@@ -748,6 +748,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ...@@ -748,6 +748,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_aTimer.SetTimeout( 120 ); m_aTimer.SetTimeout( 120 );
SwDocShell* pDocSh = PTR_CAST( SwDocShell, _pFrame->GetObjectShell() ); SwDocShell* pDocSh = PTR_CAST( SwDocShell, _pFrame->GetObjectShell() );
OSL_ENSURE( pDocSh, "view without DocShell." );
bool bOldModifyFlag = pDocSh->IsEnableSetModified(); bool bOldModifyFlag = pDocSh->IsEnableSetModified();
if(bOldModifyFlag) if(bOldModifyFlag)
pDocSh->EnableSetModified( false ); pDocSh->EnableSetModified( false );
...@@ -757,10 +758,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ...@@ -757,10 +758,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
// manually. // manually.
if( pDocSh->GetDoc()->get( IDocumentSettingAccess::EMBED_FONTS )) if( pDocSh->GetDoc()->get( IDocumentSettingAccess::EMBED_FONTS ))
pDocSh->UpdateFontList(); pDocSh->UpdateFontList();
OSL_ENSURE( pDocSh, "view without DocShell." ); bool bWebDShell = pDocSh->ISA(SwWebDocShell);
SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh );
const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell); const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
SwViewOption aUsrPref( *pUsrPref); SwViewOption aUsrPref( *pUsrPref);
//! get lingu options without loading lingu DLL //! get lingu options without loading lingu DLL
...@@ -804,7 +804,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) ...@@ -804,7 +804,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
{ {
SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc(); SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc();
if( !bOldShellWasSrcView && pWebDShell && !m_bOldShellWasPagePreview ) if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
aUsrPref.setBrowseMode( true ); aUsrPref.setBrowseMode( true );
else else
aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) ); aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) );
......
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