summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-08 17:01:31 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-08-09 10:18:33 +0200
commit8f0e5308fac99f4c47fae98674f29a6a6a2948e5 (patch)
tree5f1adaa08725a09baa4215290ce3909d378162cb /sfx2/source
parent0c9c3f75d7f0d44efc4fe1d6320a07de8c04b36e (diff)
sfx2: check saved last tab page name exists before restoring it
since GetPage might return nullptr on a nonexisting page See https://crashreport.libreoffice.org/stats/signature/SfxHelpIndexWindow_Impl::ActivatePageHdl(rtl::OString%20const%20&) Change-Id: I26e21f783645e8a87d56cbe76c0126de8947bf3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137990 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/newhelp.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 8cc649675d8b..d708e55c5e19 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1309,7 +1309,11 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent, w
OString sPageId("index");
SvtViewOptions aViewOpt( EViewType::TabDialog, CONFIGNAME_INDEXWIN );
if ( aViewOpt.Exists() )
- sPageId = aViewOpt.GetPageID();
+ {
+ OString sSavedPageId = aViewOpt.GetPageID();
+ if (m_xTabCtrl->get_page_index(sSavedPageId) != -1)
+ sPageId = sSavedPageId;
+ }
m_xTabCtrl->set_current_page(sPageId);
ActivatePageHdl(sPageId);
m_xActiveLB->connect_changed(LINK(this, SfxHelpIndexWindow_Impl, SelectHdl));