diff options
Diffstat (limited to 'sc/source/ui/dialogs')
-rw-r--r-- | sc/source/ui/dialogs/searchresults.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 4ea08c1d49..31444dbb3f 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -249,18 +249,22 @@ IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl, weld::TreeView&, void ) return; // Jump to the cell. - ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); - pScViewShell->SetTabNo(nTab); - pScViewShell->SetCursor(aPos.Col(), aPos.Row()); - pScViewShell->AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP); + if (ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell()) + { + pScViewShell->SetTabNo(nTab); + pScViewShell->SetCursor(aPos.Col(), aPos.Row()); + pScViewShell->AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP); + } } IMPL_STATIC_LINK( SearchResultsDlg, OnShowToggled, weld::Toggleable&, rButton, void ) { - ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); - ScViewOptions aViewOpt( pScViewShell->GetViewData().GetOptions() ); - aViewOpt.SetOption( VOPT_SUMMARY, rButton.get_active() ); - pScViewShell->GetViewData().SetOptions( aViewOpt ); + if (ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell()) + { + ScViewOptions aViewOpt( pScViewShell->GetViewData().GetOptions() ); + aViewOpt.SetOption( VOPT_SUMMARY, rButton.get_active() ); + pScViewShell->GetViewData().SetOptions( aViewOpt ); + } } SearchResultsDlgWrapper::SearchResultsDlgWrapper( |