diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-28 14:34:02 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-28 16:01:52 +0200 |
commit | 71bb4786a8888fd31c3c530f32bd58a1015501a9 (patch) | |
tree | 3d170b98745527cb88204fff10857e3cee6a56d5 /sd | |
parent | 835bedcf8b76cad05d07fceeb44598eb97203793 (diff) |
tdf#120703 PVS: dereference before nullptr check
V595 The 'mpViewShell' pointer was utilized before it was verified against nullptr.
Check lines: 193, 201.
Change-Id: I0d3cfee4d6f7bbb536c463b698361a1d299d2863
Reviewed-on: https://gerrit.libreoffice.org/71469
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index eb24ff617932..a5694b2c5af3 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -190,6 +190,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) OutlinerView* pOLV = mpView->GetTextEditOutlinerView(); SdrOutliner *pOutliner = mpView->GetTextEditOutliner(); + assert(mpViewShell); + if( dynamic_cast< const OutlineView *>( mpView ) != nullptr) { pOLV = static_cast<OutlineView*>(mpView)->GetViewByWindow( @@ -201,7 +203,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) if(pOLV && !pOLV->GetSelection().HasRange()) { - if( mpViewShell && mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow() ) + if (mpViewShell->GetViewShell() && mpViewShell->GetViewShell()->GetWindow()) { LanguageType nInputLang = mpViewShell->GetViewShell()->GetWindow()->GetInputLanguage(); if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM) |