tdf#163486: PVS: check getViewShellBase
V522 There might be dereferencing of a potential null pointer 'getViewShellBase()'. Change-Id: I19becd2a40a7e996b6634c20df309d171ebbaf1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175882 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
de4ef35350
commit
5c930b7e68
1 changed files with 12 additions and 10 deletions
|
@ -1756,17 +1756,19 @@ void SdOutliner::EnterEditMode (bool bGrabFocus)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<sd::ViewShell> pOverridingViewShell{};
|
||||
sd::ViewShellBase* pBase = getViewShellBase();
|
||||
if (auto pViewShellManager = pBase->GetViewShellManager())
|
||||
pOverridingViewShell = pViewShellManager->GetOverridingMainShell();
|
||||
|
||||
if (pOverridingViewShell)
|
||||
if (sd::ViewShellBase* pBase = getViewShellBase())
|
||||
{
|
||||
auto pMainViewShell = getViewShellBase()->GetMainViewShell().get();
|
||||
pMainViewShell->GetParentWindow()->GrabFocus();
|
||||
pMainViewShell->GetContentWindow()->GrabFocus();
|
||||
bGrabFocus = true;
|
||||
std::shared_ptr<sd::ViewShell> pOverridingViewShell{};
|
||||
if (auto pViewShellManager = pBase->GetViewShellManager())
|
||||
pOverridingViewShell = pViewShellManager->GetOverridingMainShell();
|
||||
|
||||
if (pOverridingViewShell)
|
||||
{
|
||||
auto pMainViewShell = pBase->GetMainViewShell().get();
|
||||
pMainViewShell->GetParentWindow()->GrabFocus();
|
||||
pMainViewShell->GetContentWindow()->GrabFocus();
|
||||
bGrabFocus = true;
|
||||
}
|
||||
}
|
||||
|
||||
mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView,
|
||||
|
|
Loading…
Reference in a new issue