Kaydet (Commit) 126ec8f9 authored tarafından Caolán McNamara's avatar Caolán McNamara

Move forcing existence of tabpages to TabControl::GetOptimalSize

rather than just for SfxTabDialog, do it for all TabControls

Change-Id: I29a19c51c7ce3baec428df716e2ee3595e496c39
üst cbcb304b
......@@ -727,17 +727,6 @@ sal_Bool SfxTabDialog::IsApplyButtonEnabled() const
void SfxTabDialog::Start_Impl()
{
//We need to force all tabs to exist to get overall optimal size for dialog
for (sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n)
{
sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n);
if (!m_pTabCtrl->GetTabPage(nPageId))
{
m_pTabCtrl->SetCurPageId(nPageId);
ActivatePageHdl(m_pTabCtrl);
}
}
DBG_ASSERT( pImpl->pData->Count() == m_pTabCtrl->GetPageCount(), "not all pages registered" );
sal_uInt16 nActPage = m_pTabCtrl->GetPageId( 0 );
......
......@@ -2205,6 +2205,17 @@ Size TabControl::calculateRequisition() const
{
const TabPage *pPage = it->mpTabPage;
//it's a real nuisance if the page is not inserted yet :-(
//We need to force all tabs to exist to get overall optimal size for dialog
if (!pPage)
{
TabControl *pThis = const_cast<TabControl*>(this);
sal_uInt16 nLastPageId = pThis->GetCurPageId();
pThis->SetCurPageId(it->mnId);
pThis->ActivatePage();
pThis->SetCurPageId(nLastPageId);
pPage = it->mpTabPage;
}
if (!pPage)
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment