diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-06 12:19:57 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-04-11 08:26:01 +0200 |
commit | e5dd156a44625865684b5dfa90a95108259deb50 (patch) | |
tree | bb0da749c95d7fb1929f2c7d8757a53e73720807 /sfx2 | |
parent | 4cbcec9ed4c51277b00c155a5fa097880c0dee4b (diff) |
loplugin:constantparam
Change-Id: Ie690088d7a7d568703afd22f544628fc8012a7e1
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index d57d37116d94..6e51edbab5aa 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -60,18 +60,16 @@ struct Data_Impl CreateTabPage fnCreatePage; // Pointer to Factory GetTabPageRanges fnGetRanges; // Pointer to Ranges-Function VclPtr<SfxTabPage> pTabPage; // The TabPage itself - bool bOnDemand; // Flag: ItemSet onDemand bool bRefresh; // Flag: Page must be re-initialized // Constructor Data_Impl( sal_uInt16 Id, CreateTabPage fnPage, - GetTabPageRanges fnRanges, bool bDemand ) : + GetTabPageRanges fnRanges ) : nId ( Id ), fnCreatePage( fnPage ), fnGetRanges ( fnRanges ), pTabPage ( nullptr ), - bOnDemand ( bDemand ), bRefresh ( false ) { if ( !fnCreatePage ) @@ -366,8 +364,6 @@ void SfxTabDialog::dispose() aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( aPageData ) ) ); } - if ( pDataObject->bOnDemand ) - delete &pDataObject->pTabPage->GetItemSet(); pDataObject->pTabPage.disposeAndClear(); } delete pDataObject; @@ -593,7 +589,7 @@ sal_uInt16 SfxTabDialog::AddTabPage { sal_uInt16 nId = m_pTabCtrl->GetPageId(rName); m_pImpl->aData.push_back( - new Data_Impl( nId, pCreateFunc, pRangesFunc, false/*bItemsOnDemand*/ ) ); + new Data_Impl( nId, pCreateFunc, pRangesFunc ) ); return nId; } @@ -613,7 +609,7 @@ sal_uInt16 SfxTabDialog::AddTabPage assert(pCreateFunc); GetTabPageRanges pRangesFunc = pFact->GetTabPageRangesFunc(nPageCreateId); sal_uInt16 nPageId = m_pTabCtrl->GetPageId(rName); - m_pImpl->aData.push_back(new Data_Impl(nPageId, pCreateFunc, pRangesFunc, false)); + m_pImpl->aData.push_back(new Data_Impl(nPageId, pCreateFunc, pRangesFunc)); return nPageId; } @@ -637,8 +633,7 @@ void SfxTabDialog::AddTabPage DBG_ASSERT( TAB_PAGE_NOTFOUND == m_pTabCtrl->GetPagePos( nId ), "Double Page-Ids in the Tabpage" ); m_pTabCtrl->InsertPage( nId, rRiderText, nPos ); - m_pImpl->aData.push_back( - new Data_Impl( nId, pCreateFunc, pRangesFunc, false/*bItemsOnDemand*/ ) ); + m_pImpl->aData.push_back( new Data_Impl( nId, pCreateFunc, pRangesFunc ) ); } void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) @@ -674,8 +669,6 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId ) aPageOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( aPageData ) ) ); } - if ( pDataObject->bOnDemand ) - delete &pDataObject->pTabPage->GetItemSet(); pDataObject->pTabPage.disposeAndClear(); } @@ -787,13 +780,7 @@ short SfxTabDialog::Ok() if ( pTabPage ) { - if ( pDataObject->bOnDemand ) - { - SfxItemSet& rSet = (SfxItemSet&)pTabPage->GetItemSet(); - rSet.ClearItem(); - bModified |= pTabPage->FillItemSet( &rSet ); - } - else if ( m_pSet && !pTabPage->HasExchangeSupport() ) + if ( m_pSet && !pTabPage->HasExchangeSupport() ) { SfxItemSet aTmp( *m_pSet->GetPool(), m_pSet->GetRanges() ); @@ -965,14 +952,7 @@ IMPL_LINK_NOARG_TYPED(SfxTabDialog, ResetHdl, Button*, void) Data_Impl* pDataObject = Find( m_pImpl->aData, nId ); DBG_ASSERT( pDataObject, "Id not known" ); - if ( pDataObject->bOnDemand ) - { - // CSet on AIS has problems here, thus separated - const SfxItemSet* pItemSet = &pDataObject->pTabPage->GetItemSet(); - pDataObject->pTabPage->Reset( pItemSet ); - } - else - pDataObject->pTabPage->Reset( m_pSet ); + pDataObject->pTabPage->Reset( m_pSet ); } @@ -1101,7 +1081,7 @@ IMPL_LINK_TYPED( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void ) pTmpSet = m_pSet; } - if ( pTmpSet && !pDataObject->bOnDemand ) + if ( pTmpSet ) pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, pTmpSet ); else pTabPage = (pDataObject->fnCreatePage) @@ -1134,10 +1114,7 @@ IMPL_LINK_TYPED( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void ) PageCreated( nId, *pTabPage ); - if ( pDataObject->bOnDemand ) - pTabPage->Reset( &pTabPage->GetItemSet() ); - else - pTabPage->Reset( m_pSet ); + pTabPage->Reset( m_pSet ); pTabCtrl->SetTabPage( nId, pTabPage ); } @@ -1176,10 +1153,6 @@ IMPL_LINK_TYPED( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl, bool ) #ifdef DBG_UTIL Data_Impl* pDataObject = Find( m_pImpl->aData, pTabCtrl->GetCurPageId() ); DBG_ASSERT( pDataObject, "no Data structure for current page" ); - if ( pPage->HasExchangeSupport() && pDataObject->bOnDemand ) - { - SAL_INFO( "sfx.config", "Data exchange in ItemsOnDemand is not desired!" ); - } #endif int nRet = SfxTabPage::LEAVE_PAGE; |