diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-06-05 15:15:56 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-06 07:02:20 +0000 |
commit | 11b4a6ddce31f173f10b703eb63fde2c88c0bc70 (patch) | |
tree | 5f635db51172fd421dffbcadfa021530634567cd /sfx2 | |
parent | 7d1b01070c330d45212cd69ea692b2263c23c2a6 (diff) |
Convert DeactivePage return code to scoped enum
Change-Id: Idd5372ad20fc6676864b31b3796f8b9bc0ad73dd
Reviewed-on: https://gerrit.libreoffice.org/25918
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/dialog/printopt.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/styledlg.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 26 |
6 files changed, 29 insertions, 29 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 594db9ff87dd..d694dee656a9 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -629,8 +629,8 @@ IMPL_LINK_NOARG_TYPED(SfxSingleTabDialog, OKHdl_Impl, Button*, void) if ( pImpl->m_pSfxPage->HasExchangeSupport() ) { - int nRet = pImpl->m_pSfxPage->DeactivatePage( GetOutputSetImpl() ); - if ( nRet != SfxTabPage::LEAVE_PAGE ) + DeactivateRC nRet = pImpl->m_pSfxPage->DeactivatePage( GetOutputSetImpl() ); + if ( nRet != DeactivateRC::LeavePage ) return; else bModified = ( GetOutputItemSet()->Count() > 0 ); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 644a43cc871f..a2d999086d85 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2261,11 +2261,11 @@ void SfxCustomPropertiesPage::Reset( const SfxItemSet* rItemSet ) } } -SfxTabPage::sfxpg SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) +DeactivateRC SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { - sfxpg nRet = LEAVE_PAGE; + DeactivateRC nRet = DeactivateRC::LeavePage; if ( !m_pPropertiesCtrl->AreAllLinesValid() ) - nRet = KEEP_PAGE; + nRet = DeactivateRC::KeepPage; return nRet; } @@ -2760,9 +2760,9 @@ void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet ) m_pPropertiesCtrl.setScrollRange(); } -SfxTabPage::sfxpg SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) +DeactivateRC SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) { - return LEAVE_PAGE; + return DeactivateRC::LeavePage; } VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet ) diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 3290ae18bddf..fb99cd388d5e 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -589,7 +589,7 @@ void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet) } -SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) +DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) /* [Description] @@ -606,7 +606,7 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet */ { - sfxpg nRet = SfxTabPage::LEAVE_PAGE; + DeactivateRC nRet = DeactivateRC::LeavePage; if ( m_pNameRw->IsModified() ) { @@ -620,7 +620,7 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet aBox->Execute(); m_pNameRw->GrabFocus(); m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); - return SfxTabPage::KEEP_PAGE; + return DeactivateRC::KeepPage; } bModified = true; } @@ -636,7 +636,7 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VclMessageType::Info); aBox->Execute(); m_pFollowLb->GrabFocus(); - return SfxTabPage::KEEP_PAGE; + return DeactivateRC::KeepPage; } bModified = true; } @@ -656,10 +656,10 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VclMessageType::Info); aBox->Execute(); m_pBaseLb->GrabFocus(); - return SfxTabPage::KEEP_PAGE; + return DeactivateRC::KeepPage; } bModified = true; - nRet = sfxpg(nRet | SfxTabPage::REFRESH_SET); + nRet = nRet | DeactivateRC::RefreshSet; } } diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index fd42d4a80e02..0b72c3478f14 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -185,12 +185,12 @@ void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet* /*rSet*/ ) ImplUpdateControls( m_pPrinterOutputRB->IsChecked() ? &maPrinterOptions : &maPrintFileOptions ); } -SfxTabPage::sfxpg SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet ) +DeactivateRC SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet ) { if( pItemSet ) FillItemSet( pItemSet ); - return LEAVE_PAGE; + return DeactivateRC::LeavePage; } void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions ) diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx index f2cac5859b15..879fcd9ebdb9 100644 --- a/sfx2/source/dialog/styledlg.cxx +++ b/sfx2/source/dialog/styledlg.cxx @@ -93,7 +93,7 @@ void SfxStyleDialog::RefreshInputSet() /* [Description] This is called when <SfxTabPage::DeactivatePage(SfxItemSet *)> - returns <SfxTabPage::REFRESH_SET>. + returns <DeactivateRC::RefreshSet>. */ { diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 3d88b4937d7f..55621bef6955 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -199,7 +199,7 @@ void SfxTabPage::ActivatePage( const SfxItemSet& ) { } -SfxTabPage::sfxpg SfxTabPage::DeactivatePage( SfxItemSet* ) +DeactivateRC SfxTabPage::DeactivatePage( SfxItemSet* ) /* [Description] @@ -213,11 +213,11 @@ SfxTabPage::sfxpg SfxTabPage::DeactivatePage( SfxItemSet* ) [Return value] - LEAVE_PAGE; Allow leaving the page + DeactivateRC::LeavePage; Allow leaving the page */ { - return LEAVE_PAGE; + return DeactivateRC::LeavePage; } @@ -827,7 +827,7 @@ void SfxTabDialog::RefreshInputSet() Default implementation of the virtual Method. This is called, when <SfxTabPage::DeactivatePage(SfxItemSet *)> - returns <SfxTabPage::REFRESH_SET>. + returns <DeactivateRC::RefreshSet>. */ { @@ -841,7 +841,7 @@ IMPL_LINK_NOARG_TYPED(SfxTabDialog, OkHdl, Button*, void) Handler of the Ok-Buttons This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>. - Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called + Returns <DeactivateRC::LeavePage>, <SfxTabDialog::Ok()> is called and the Dialog is ended. */ @@ -886,7 +886,7 @@ bool SfxTabDialog::PrepareLeaveCurrentPage() if ( pPage ) { - int nRet = SfxTabPage::LEAVE_PAGE; + DeactivateRC nRet = DeactivateRC::LeavePage; if ( m_pSet ) { SfxItemSet aTmp( *m_pSet->GetPool(), m_pSet->GetRanges() ); @@ -896,7 +896,7 @@ bool SfxTabDialog::PrepareLeaveCurrentPage() else nRet = pPage->DeactivatePage( nullptr ); - if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE + if ( ( DeactivateRC::LeavePage & nRet ) == DeactivateRC::LeavePage && aTmp.Count() ) { m_pExampleSet->Put( aTmp ); @@ -905,7 +905,7 @@ bool SfxTabDialog::PrepareLeaveCurrentPage() } else nRet = pPage->DeactivatePage( nullptr ); - bEnd = nRet; + bEnd = nRet != DeactivateRC::KeepPage; } return bEnd; @@ -918,7 +918,7 @@ IMPL_LINK_NOARG_TYPED(SfxTabDialog, UserHdl, Button*, void) Handler of the User-Buttons This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>. - returns this <SfxTabPage::LEAVE_PAGE> and <SfxTabDialog::Ok()> is called. + returns this <DeactivateRC::LeavePage> and <SfxTabDialog::Ok()> is called. Then the Dialog is ended with the Return value <SfxTabDialog::Ok()> */ @@ -1153,7 +1153,7 @@ IMPL_LINK_TYPED( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl, bool ) DBG_ASSERT( pDataObject, "no Data structure for current page" ); #endif - int nRet = SfxTabPage::LEAVE_PAGE; + DeactivateRC nRet = DeactivateRC::LeavePage; if ( !m_pExampleSet && pPage->HasExchangeSupport() && m_pSet ) m_pExampleSet = new SfxItemSet( *m_pSet->GetPool(), m_pSet->GetRanges() ); @@ -1166,7 +1166,7 @@ IMPL_LINK_TYPED( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl, bool ) nRet = pPage->DeactivatePage( &aTmp ); else nRet = pPage->DeactivatePage( nullptr ); - if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE && + if ( ( DeactivateRC::LeavePage & nRet ) == DeactivateRC::LeavePage && aTmp.Count() ) { m_pExampleSet->Put( aTmp ); @@ -1189,7 +1189,7 @@ IMPL_LINK_TYPED( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl, bool ) nRet = pPage->DeactivatePage( nullptr ); } - if ( nRet & SfxTabPage::REFRESH_SET ) + if ( nRet & DeactivateRC::RefreshSet ) { RefreshInputSet(); // Flag all Pages as to be initialized as new @@ -1204,7 +1204,7 @@ IMPL_LINK_TYPED( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl, bool ) pObj->bRefresh = false; } } - if ( nRet & SfxTabPage::LEAVE_PAGE ) + if ( nRet & DeactivateRC::LeavePage ) return true; else return false; |