summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-11 19:52:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-11 21:05:58 +0100
commit4d9d727a23c9e42599a90a1759c85b3e443de493 (patch)
tree3d77c8074319ad5c5adcd99f562aaf0ef5fe1fd5 /sw
parent85834e2e18b3dbeb6d257e4bb83e4cc61e538f9e (diff)
coverity#736864 Dereference before null check
Change-Id: Ia26b4b391de088487e30a2767660ade6c147eeb4
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/uiview/view.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx
index 705514fcb967..1d3ecd94193d 100644
--- a/sw/source/core/uibase/uiview/view.cxx
+++ b/sw/source/core/uibase/uiview/view.cxx
@@ -748,6 +748,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_aTimer.SetTimeout( 120 );
SwDocShell* pDocSh = PTR_CAST( SwDocShell, _pFrame->GetObjectShell() );
+ OSL_ENSURE( pDocSh, "view without DocShell." );
bool bOldModifyFlag = pDocSh->IsEnableSetModified();
if(bOldModifyFlag)
pDocSh->EnableSetModified( false );
@@ -757,10 +758,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
// manually.
if( pDocSh->GetDoc()->get( IDocumentSettingAccess::EMBED_FONTS ))
pDocSh->UpdateFontList();
- OSL_ENSURE( pDocSh, "view without DocShell." );
- SwWebDocShell* pWebDShell = PTR_CAST( SwWebDocShell, pDocSh );
+ bool bWebDShell = pDocSh->ISA(SwWebDocShell);
- const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != pWebDShell);
+ const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(bWebDShell);
SwViewOption aUsrPref( *pUsrPref);
//! get lingu options without loading lingu DLL
@@ -804,7 +804,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
{
SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc();
- if( !bOldShellWasSrcView && pWebDShell && !m_bOldShellWasPagePreview )
+ if( !bOldShellWasSrcView && bWebDShell && !m_bOldShellWasPagePreview )
aUsrPref.setBrowseMode( true );
else
aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) );