diff options
author | Andras Timar <andras.timar@collabora.com> | 2014-04-24 21:50:26 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-05-01 12:24:59 +0200 |
commit | 03bf7af2e38b68f6ad9f84ddd8dab3c14137cf73 (patch) | |
tree | b62fbd03569e18fafc33a9b87dad31f8331730f7 | |
parent | fdc32efbd036e6ba933030b062c521cfac2823b9 (diff) |
fdo#77242 fix crash
Change-Id: Ic28b2dccc02627446a794929fe970495b15eb0e1
Reviewed-on: https://gerrit.libreoffice.org/9154
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 95bdbad10760..065a23c8e3d4 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -1270,7 +1270,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) */ { - sal_uInt16 const nId = pTabCtrl->GetCurPageId(); + sal_uInt16 nId = pTabCtrl->GetCurPageId(); DBG_ASSERT( pImpl->aData.size(), "no Pages registered" ); SFX_APP(); @@ -1278,6 +1278,16 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) // Tab Page schon da? SfxTabPage* pTabPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId )); Data_Impl* pDataObject = Find( pImpl->aData, nId ); + + //UUUU fallback to 1st page when requested one does not exist + if(!pDataObject && pTabCtrl->GetPageCount()) + { + pTabCtrl->SetCurPageId(pTabCtrl->GetPageId(0)); + nId = pTabCtrl->GetCurPageId(); + pTabPage = dynamic_cast< SfxTabPage* >(pTabCtrl->GetTabPage(nId)); + pDataObject = Find(pImpl->aData, nId); + } + DBG_ASSERT( pDataObject, "Id not known" ); // Create TabPage if possible: |