diff options
22 files changed, 171 insertions, 164 deletions
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx index 17da73233a6a..fbf84d893741 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx @@ -54,9 +54,9 @@ CreationWizard::CreationWizard( vcl::Window* pParent, const uno::Reference< fram , const uno::Reference< uno::XComponentContext >& xContext , sal_Int32 nOnePageOnlyIndex ) : svt::RoadmapWizard( pParent, - static_cast<sal_uInt32>((nOnePageOnlyIndex >= 0 && nOnePageOnlyIndex < nPageCount) - ? WZB_HELP | WZB_CANCEL | WZB_FINISH - : WZB_HELP | WZB_CANCEL | WZB_PREVIOUS | WZB_NEXT | WZB_FINISH) + (nOnePageOnlyIndex >= 0 && nOnePageOnlyIndex < nPageCount) + ? WizardButtonFlags::HELP | WizardButtonFlags::CANCEL | WizardButtonFlags::FINISH + : WizardButtonFlags::HELP | WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT | WizardButtonFlags::FINISH ) , m_xChartModel(xChartModel,uno::UNO_QUERY) , m_xCC( xContext ) @@ -69,7 +69,7 @@ CreationWizard::CreationWizard( vcl::Window* pParent, const uno::Reference< fram , m_bCanTravel( true ) { m_pDialogModel.reset( new DialogModel( m_xChartModel, m_xCC )); - defaultButton( WZB_FINISH ); + defaultButton( WizardButtonFlags::FINISH ); if( m_nOnePageOnlyIndex < 0 || m_nOnePageOnlyIndex >= nPageCount ) { @@ -169,8 +169,8 @@ svt::WizardTypes::WizardState CreationWizard::determineNextState( WizardState nC void CreationWizard::enterState(WizardState nState) { m_aTimerTriggeredControllerLock.startTimer(); - enableButtons( WZB_PREVIOUS, bool( nState > m_nFirstState ) ); - enableButtons( WZB_NEXT, bool( nState < m_nLastState ) ); + enableButtons( WizardButtonFlags::PREVIOUS, bool( nState > m_nFirstState ) ); + enableButtons( WizardButtonFlags::NEXT, bool( nState < m_nLastState ) ); if( isStateEnabled( nState )) svt::RoadmapWizard::enterState(nState); } diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index b778fd68587e..24c1a7c6432c 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -146,8 +146,8 @@ namespace dbmm SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MAP_APPFONT ) ); SetRoadmapInteractive( true ); enableAutomaticNextButtonState(); - defaultButton( WZB_NEXT ); - enableButtons( WZB_FINISH, true ); + defaultButton( WizardButtonFlags::NEXT ); + enableButtons( WizardButtonFlags::FINISH, true ); ActivatePage(); OSL_PRECOND( m_pData->xDocumentModel.is(), "MacroMigrationDialog::MacroMigrationDialog: illegal document!" ); @@ -191,7 +191,7 @@ namespace dbmm switch ( _nState ) { case STATE_CLOSE_SUB_DOCS: - enableButtons( WZB_FINISH, false ); + enableButtons( WizardButtonFlags::FINISH, false ); enableState( STATE_MIGRATE, false ); enableState( STATE_SUMMARY, false ); break; @@ -211,7 +211,7 @@ namespace dbmm enableState( STATE_BACKUP_DBDOC, false ); enableState( STATE_SUMMARY, false ); - enableButtons( WZB_FINISH | WZB_CANCEL | WZB_PREVIOUS | WZB_NEXT, false ); + enableButtons( WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT, false ); // start the migration asynchronously PostUserEvent( LINK( this, MacroMigrationDialog, OnStartMigration ) ); @@ -227,9 +227,9 @@ namespace dbmm dynamic_cast< ResultPage& >( *GetPage( STATE_SUMMARY ) ).displayMigrationLog( m_pData->bMigrationSuccess, m_pData->aLogger.getCompleteLog() ); - enableButtons( WZB_FINISH, m_pData->bMigrationSuccess ); - enableButtons( WZB_CANCEL, m_pData->bMigrationFailure ); - defaultButton( m_pData->bMigrationSuccess ? WZB_FINISH : WZB_CANCEL ); + enableButtons( WizardButtonFlags::FINISH, m_pData->bMigrationSuccess ); + enableButtons( WizardButtonFlags::CANCEL, m_pData->bMigrationFailure ); + defaultButton( m_pData->bMigrationSuccess ? WizardButtonFlags::FINISH : WizardButtonFlags::CANCEL ); break; default: @@ -293,7 +293,7 @@ namespace dbmm m_pData->bMigrationFailure = !m_pData->bMigrationSuccess; // re-enable the UI - enableButtons( WZB_FINISH | WZB_NEXT, true ); + enableButtons( WizardButtonFlags::FINISH | WizardButtonFlags::NEXT, true ); enableState( STATE_SUMMARY, true ); updateTravelUI(); diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 566c30af0fa0..fe2b76f5fec7 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -67,7 +67,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent ,const Reference< XComponentContext >& _rxORB ,const ::com::sun::star::uno::Any& _aDataSourceName ) - :OWizardMachine(_pParent, WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP ) + :OWizardMachine(_pParent, WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP ) ,m_pOutSet(NULL) ,m_bResetting(false) ,m_bApplied(false) @@ -82,8 +82,8 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent m_eType = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(*m_pOutSet); SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MAP_APPFONT)); - defaultButton(WZB_NEXT); - enableButtons(WZB_FINISH, false); + defaultButton(WizardButtonFlags::NEXT); + enableButtons(WizardButtonFlags::FINISH, false); enableAutomaticNextButtonState( true ); m_pPrevPage->SetHelpId(HID_DBWIZ_PREVIOUS); @@ -115,8 +115,8 @@ IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage) { m_eType = _pTabPage->GetSelectedType(); const bool bURLRequired = m_pCollection->isConnectionUrlRequired(m_eType); - enableButtons(WZB_NEXT,bURLRequired); - enableButtons(WZB_FINISH,!bURLRequired); + enableButtons(WizardButtonFlags::NEXT,bURLRequired); + enableButtons(WizardButtonFlags::FINISH,!bURLRequired); return 1L; } @@ -293,8 +293,8 @@ VclPtr<TabPage> ODbTypeWizDialog::createPage(WizardState _nState) static_cast<OGenericAdministrationPage*>(pPage.get())->SetServiceFactory( m_pImpl->getORB() ); static_cast<OGenericAdministrationPage*>(pPage.get())->SetAdminDialog(this,this); pPage->SetText(ModuleRes(nStringId)); - defaultButton( _nState == START_PAGE ? WZB_NEXT : WZB_FINISH ); - enableButtons( WZB_FINISH, _nState != START_PAGE); + defaultButton( _nState == START_PAGE ? WizardButtonFlags::NEXT : WizardButtonFlags::FINISH ); + enableButtons( WizardButtonFlags::FINISH, _nState != START_PAGE); pPage->Show(); } return pPage; @@ -315,7 +315,7 @@ void ODbTypeWizDialog::setTitle(const OUString& _sTitle) void ODbTypeWizDialog::enableConfirmSettings( bool _bEnable ) { - enableButtons( WZB_FINISH, _bEnable ); + enableButtons( WizardButtonFlags::FINISH, _bEnable ); // TODO: // this is hacky. At the moment, this method is used in only one case. // As soon as it is to be used more wide-spread, we should find a proper concept diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index b063828432e3..f7fe59ff2594 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -105,7 +105,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent ,const Reference< XComponentContext >& _rxORB ,const ::com::sun::star::uno::Any& _aDataSourceName ) - :svt::RoadmapWizard( _pParent, static_cast<sal_uInt32>(WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP) ) + :svt::RoadmapWizard( _pParent, WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP ) , m_pOutSet(NULL) , m_bResetting(false) @@ -148,8 +148,8 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent m_pImpl->translateProperties(xDatasource, *m_pOutSet); SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MAP_APPFONT)); - defaultButton(WZB_NEXT); - enableButtons(WZB_FINISH, true); + defaultButton(WizardButtonFlags::NEXT); + enableButtons(WizardButtonFlags::FINISH, true); enableAutomaticNextButtonState(); ::dbaccess::ODsnTypeCollection::TypeIterator aIter = m_pCollection->begin(); @@ -328,7 +328,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() activatePath( static_cast< PathId >( nCreateNewDBIndex + 1 ), true ); enableState(PAGE_DBSETUPWIZARD_FINAL, true ); - enableButtons( WZB_FINISH, true); + enableButtons( WizardButtonFlags::FINISH, true); } break; case OGeneralPageWizard::eConnectExternal: @@ -347,14 +347,14 @@ void ODbTypeWizDialogSetup::activateDatabasePath() case OGeneralPageWizard::eOpenExisting: { activatePath( static_cast<PathId>(m_pCollection->size() + 1), true ); - enableButtons( WZB_FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); + enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); } break; default: OSL_FAIL( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" ); } - enableButtons( WZB_NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPageWizard::eOpenExisting ); + enableButtons( WizardButtonFlags::NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPageWizard::eOpenExisting ); // TODO: this should go into the base class. Point is, we activate a path whose *last* // step is also the current one. The base class should automatically disable // the Next button in such a case. However, not for this patch ... @@ -374,7 +374,7 @@ void ODbTypeWizDialogSetup::updateTypeDependentStates() } enableState(PAGE_DBSETUPWIZARD_AUTHENTIFICATION, bDoEnable); enableState(PAGE_DBSETUPWIZARD_FINAL, bDoEnable ); - enableButtons( WZB_FINISH, bDoEnable); + enableButtons( WizardButtonFlags::FINISH, bDoEnable); } bool ODbTypeWizDialogSetup::IsConnectionUrlRequired() @@ -566,9 +566,9 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState) pPage->SetServiceFactory( m_pImpl->getORB() ); pPage->SetAdminDialog(this, this); - defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WZB_FINISH : WZB_NEXT ); - enableButtons( WZB_FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL ); - enableButtons( WZB_NEXT, _nState != PAGE_DBSETUPWIZARD_FINAL ); + defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WizardButtonFlags::FINISH : WizardButtonFlags::NEXT ); + enableButtons( WizardButtonFlags::FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL ); + enableButtons( WizardButtonFlags::NEXT, _nState != PAGE_DBSETUPWIZARD_FINAL ); pPage->Show(); } return pPage; @@ -580,10 +580,10 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplModifiedHdl, OGenericAdministrationPage*, _ enableState(PAGE_DBSETUPWIZARD_FINAL, m_bIsConnectable); enableState(PAGE_DBSETUPWIZARD_AUTHENTIFICATION, m_bIsConnectable); if (getCurrentState() == PAGE_DBSETUPWIZARD_FINAL) - enableButtons( WZB_FINISH, true); + enableButtons( WizardButtonFlags::FINISH, true); else - enableButtons( WZB_FINISH, m_bIsConnectable); - enableButtons( WZB_NEXT, m_bIsConnectable && (getCurrentState() != PAGE_DBSETUPWIZARD_FINAL)); + enableButtons( WizardButtonFlags::FINISH, m_bIsConnectable); + enableButtons( WizardButtonFlags::NEXT, m_bIsConnectable && (getCurrentState() != PAGE_DBSETUPWIZARD_FINAL)); return sal_True; } @@ -614,7 +614,7 @@ IMPL_LINK(ODbTypeWizDialogSetup, OnChangeCreationMode, OGeneralPageWizard*, /*_p IMPL_LINK(ODbTypeWizDialogSetup, OnRecentDocumentSelected, OGeneralPageWizard*, /*_pGeneralPage*/) { - enableButtons( WZB_FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); + enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() ); return 0L; } @@ -635,7 +635,7 @@ void ODbTypeWizDialogSetup::enterState(WizardState _nState) m_sOldURL = m_sURL; break; case PAGE_DBSETUPWIZARD_FINAL: - enableButtons( WZB_FINISH, true); + enableButtons( WizardButtonFlags::FINISH, true); if ( m_pFinalPage ) m_pFinalPage->enableTableWizardCheckBox(m_pCollection->supportsTableCreation(m_sURL)); break; @@ -1020,7 +1020,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument() return SaveDatabaseDocument() && OWizardMachine::onFinish(); else { - enableButtons( WZB_FINISH, false ); + enableButtons( WizardButtonFlags::FINISH, false ); return false; } } diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx index bb9e12a31d8d..d1e74a74c9bd 100644 --- a/extensions/source/abpilot/abpfinalpage.cxx +++ b/extensions/source/abpilot/abpfinalpage.cxx @@ -169,7 +169,7 @@ namespace abp m_pLocation->GrabFocus(); // default the finish button - getDialog()->defaultButton( WZB_FINISH ); + getDialog()->defaultButton( WizardButtonFlags::FINISH ); } @@ -178,9 +178,9 @@ namespace abp AddressBookSourcePage::DeactivatePage(); // default the "next" button, again - getDialog()->defaultButton( WZB_NEXT ); + getDialog()->defaultButton( WizardButtonFlags::NEXT ); // disable the finish button - getDialog()->enableButtons( WZB_FINISH, false ); + getDialog()->enableButtons( WizardButtonFlags::FINISH, false ); } @@ -197,7 +197,7 @@ namespace abp bool bEmptyLocation = m_pLocation->GetText().isEmpty(); // enable or disable the finish button - getDialog()->enableButtons( WZB_FINISH, !bEmptyLocation && (!m_pRegisterName->IsChecked() || bValidName) ); + getDialog()->enableButtons( WizardButtonFlags::FINISH, !bEmptyLocation && (!m_pRegisterName->IsChecked() || bValidName) ); // show the error message for an invalid name m_pDuplicateNameError->Show( !bValidName && !bEmptyName ); diff --git a/extensions/source/abpilot/abspage.cxx b/extensions/source/abpilot/abspage.cxx index b8f16632eb1d..078a8b150610 100644 --- a/extensions/source/abpilot/abspage.cxx +++ b/extensions/source/abpilot/abspage.cxx @@ -38,7 +38,7 @@ namespace abp void AddressBookSourcePage::DeactivatePage() { AddressBookSourcePage_Base::DeactivatePage(); - getDialog()->enableButtons(WZB_NEXT, true); + getDialog()->enableButtons(WizardButtonFlags::NEXT, true); } diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index f06fa97156f9..2617e35d7f6a 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -60,7 +60,7 @@ namespace abp OAddessBookSourcePilot::OAddessBookSourcePilot(vcl::Window* _pParent, const Reference< XComponentContext >& _rxORB) :OAddessBookSourcePilot_Base( _pParent, - static_cast<sal_uInt32>(WZB_HELP | WZB_FINISH | WZB_CANCEL | WZB_NEXT | WZB_PREVIOUS) ) + WizardButtonFlags::HELP | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS ) ,m_xORB(_rxORB) ,m_aNewDataSource(_rxORB) ,m_eNewDataSourceType( AST_INVALID ) @@ -119,8 +119,8 @@ namespace abp m_aSettings.bRegisterDataSource = false; m_aSettings.bIgnoreNoTable = false; - defaultButton(WZB_NEXT); - enableButtons(WZB_FINISH, false); + defaultButton(WizardButtonFlags::NEXT); + enableButtons(WizardButtonFlags::FINISH, false); ActivatePage(); typeSelectionChanged( m_aSettings.eType ); diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index f732eff901b4..f93957962ff9 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -191,14 +191,14 @@ namespace abp } } - getDialog()->enableButtons(WZB_PREVIOUS, false); + getDialog()->enableButtons(WizardButtonFlags::PREVIOUS, false); } void TypeSelectionPage::DeactivatePage() { AddressBookSourcePage::DeactivatePage(); - getDialog()->enableButtons(WZB_PREVIOUS, true); + getDialog()->enableButtons(WizardButtonFlags::PREVIOUS, true); } diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 9128bbbf4589..ab334d0a1d75 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -242,15 +242,15 @@ namespace dbp OControlWizard::OControlWizard( vcl::Window* _pParent, const Reference< XPropertySet >& _rxObjectModel, const Reference< XComponentContext >& _rxContext ) - :OWizardMachine(_pParent, WZB_CANCEL | WZB_PREVIOUS | WZB_NEXT | WZB_FINISH) + :OWizardMachine(_pParent, WizardButtonFlags::CANCEL | WizardButtonFlags::PREVIOUS | WizardButtonFlags::NEXT | WizardButtonFlags::FINISH) ,m_xContext(_rxContext) { m_aContext.xObjectModel = _rxObjectModel; initContext(); SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MAP_APPFONT)); - defaultButton(WZB_NEXT); - enableButtons(WZB_FINISH, false); + defaultButton(WizardButtonFlags::NEXT); + enableButtons(WizardButtonFlags::FINISH, false); } OControlWizard::~OControlWizard() diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index aec86cd649ca..b2bfbae8e8c0 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -259,13 +259,13 @@ namespace dbp { OControlWizard::enterState(_nState); - enableButtons(WZB_PREVIOUS, m_bHadDataSelection ? (GW_STATE_DATASOURCE_SELECTION < _nState) : GW_STATE_FIELDSELECTION < _nState); - enableButtons(WZB_NEXT, GW_STATE_FIELDSELECTION != _nState); + enableButtons(WizardButtonFlags::PREVIOUS, m_bHadDataSelection ? (GW_STATE_DATASOURCE_SELECTION < _nState) : GW_STATE_FIELDSELECTION < _nState); + enableButtons(WizardButtonFlags::NEXT, GW_STATE_FIELDSELECTION != _nState); if (_nState < GW_STATE_FIELDSELECTION) - enableButtons(WZB_FINISH, false); + enableButtons(WizardButtonFlags::FINISH, false); if (GW_STATE_FIELDSELECTION == _nState) - defaultButton(WZB_FINISH); + defaultButton(WizardButtonFlags::FINISH); } @@ -275,7 +275,7 @@ namespace dbp return false; if (GW_STATE_FIELDSELECTION == _nState) - defaultButton(WZB_NEXT); + defaultButton(WizardButtonFlags::NEXT); return true; } @@ -395,7 +395,7 @@ namespace dbp m_pDeselectOne->Enable(m_pSelFields->GetSelectEntryCount() != 0); m_pDeselectAll->Enable(m_pSelFields->GetEntryCount() != 0); - getDialog()->enableButtons(WZB_FINISH, 0 != m_pSelFields->GetEntryCount()); + getDialog()->enableButtons(WizardButtonFlags::FINISH, 0 != m_pSelFields->GetEntryCount()); } diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index fbcaa668990b..89f56cde8ec1 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -144,14 +144,14 @@ namespace dbp // setting the def button .... to be done before the base class is called, too, 'cause the base class // calls the pages, which are allowed to override our def button behaviour - defaultButton(GBW_STATE_FINALIZE == _nState ? WZB_FINISH : WZB_NEXT); + defaultButton(GBW_STATE_FINALIZE == _nState ? WizardButtonFlags::FINISH : WizardButtonFlags::NEXT); // allow "finish" on the last page only - enableButtons(WZB_FINISH, GBW_STATE_FINALIZE == _nState); + enableButtons(WizardButtonFlags::FINISH, GBW_STATE_FINALIZE == _nState); // allow previous on all pages but the first one - enableButtons(WZB_PREVIOUS, GBW_STATE_OPTIONLIST != _nState); + enableButtons(WizardButtonFlags::PREVIOUS, GBW_STATE_OPTIONLIST != _nState); // allow next on all pages but the last one - enableButtons(WZB_NEXT, GBW_STATE_FINALIZE != _nState); + enableButtons(WizardButtonFlags::NEXT, GBW_STATE_FINALIZE != _nState); OControlWizard::enterState(_nState); } @@ -323,7 +323,7 @@ namespace dbp m_pMoveLeft->Enable(bSelectedSome); m_pMoveRight->Enable(bUnfinishedInput); - getDialog()->enableButtons(WZB_NEXT, bHaveSome); + getDialog()->enableButtons(WizardButtonFlags::NEXT, bHaveSome); if (bUnfinishedInput) { @@ -333,7 +333,7 @@ namespace dbp else { if (WB_DEFBUTTON == (m_pMoveRight->GetStyle() & WB_DEFBUTTON)) - getDialog()->defaultButton(WZB_NEXT); + getDialog()->defaultButton(WizardButtonFlags::NEXT); } } diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 0173584e3455..458f9743df07 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -128,13 +128,13 @@ namespace dbp { OControlWizard::enterState(_nState); - enableButtons(WZB_PREVIOUS, m_bHadDataSelection ? (LCW_STATE_DATASOURCE_SELECTION < _nState) : LCW_STATE_TABLESELECTION < _nState); - enableButtons(WZB_NEXT, getFinalState() != _nState); + enableButtons(WizardButtonFlags::PREVIOUS, m_bHadDataSelection ? (LCW_STATE_DATASOURCE_SELECTION < _nState) : LCW_STATE_TABLESELECTION < _nState); + enableButtons(WizardButtonFlags::NEXT, getFinalState() != _nState); if (_nState < getFinalState()) - enableButtons(WZB_FINISH, false); + enableButtons(WizardButtonFlags::FINISH, false); if (getFinalState() == _nState) - defaultButton(WZB_FINISH); + defaultButton(WizardButtonFlags::FINISH); } @@ -144,7 +144,7 @@ namespace dbp return false; if (getFinalState() == _nState) - defaultButton(WZB_NEXT); + defaultButton(WizardButtonFlags::NEXT); return true; } @@ -508,7 +508,7 @@ namespace dbp { bool bInvalidSelection = (COMBOBOX_ENTRY_NOTFOUND == m_pValueListField->GetEntryPos(m_pValueListField->GetText())); bInvalidSelection |= (COMBOBOX_ENTRY_NOTFOUND == m_pTableField->GetEntryPos(m_pTableField->GetText())); - getDialog()->enableButtons(WZB_FINISH, !bInvalidSelection); + getDialog()->enableButtons(WizardButtonFlags::FINISH, !bInvalidSelection); } @@ -550,7 +550,7 @@ namespace dbp void OComboDBFieldPage::ActivatePage() { ODBFieldPage::ActivatePage(); - getDialog()->enableButtons(WZB_FINISH, true); + getDialog()->enableButtons(WizardButtonFlags::FINISH, true); } diff --git a/include/svtools/roadmapwizard.hxx b/include/svtools/roadmapwizard.hxx index 237d0f17d78b..c79577d6b7a2 100644 --- a/include/svtools/roadmapwizard.hxx +++ b/include/svtools/roadmapwizard.hxx @@ -70,11 +70,11 @@ namespace svt RoadmapWizard( vcl::Window* _pParent, const WinBits i_nStyle, - sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP + WizardButtonFlags _nButtonFlags = WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP ); RoadmapWizard( vcl::Window* _pParent, - sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP + WizardButtonFlags _nButtonFlags = WizardButtonFlags::NEXT | WizardButtonFlags::PREVIOUS | WizardButtonFlags::FINISH | WizardButtonFlags::CANCEL | WizardButtonFlags::HELP ); virtual ~RoadmapWizard( ); virtual void dispose() SAL_OVERRIDE; diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx index 6865c4e2e74a..e2c2d6bd8618 100644 --- a/include/svtools/wizardmachine.hxx +++ b/include/svtools/wizardmachine.hxx @@ -23,20 +23,27 @@ #include <svtools/wizdlg.hxx> #include <vcl/button.hxx> #include <vcl/tabpage.hxx> +#include <o3tl/typed_flags_set.hxx> class Bitmap; -namespace svt +enum class WizardButtonFlags +{ + NONE = 0x0000, + NEXT = 0x0001, + PREVIOUS = 0x0002, + FINISH = 0x0004, + CANCEL = 0x0008, + HELP = 0x0010, +}; +namespace o3tl { + template<> struct typed_flags<WizardButtonFlags> : is_typed_flags<WizardButtonFlags, 0x001f> {}; +} +namespace svt +{ -// wizard buttons -#define WZB_NONE 0x0000 -#define WZB_NEXT 0x0001 -#define WZB_PREVIOUS 0x0002 -#define WZB_FINISH 0x0004 -#define WZB_CANCEL 0x0008 -#define WZB_HELP 0x0010 // wizard states #define WZS_INVALID_STATE ((WizardState)-1) @@ -76,7 +83,7 @@ namespace svt The default implementation always returns <TRUE/>. */ - virtual bool canAdvance() const = 0; + virtual bool canAdvance() const = 0; protected: ~IWizardPageController() {} @@ -109,14 +116,14 @@ namespace svt protected: // TabPage overridables - virtual void ActivatePage() SAL_OVERRIDE; + virtual void ActivatePage() SAL_OVERRIDE; /** updates the travel-related UI elements of the OWizardMachine we live in (if any) If the parent of the tab page is a OWizardMachine, then updateTravelUI at this instance is called. Otherwise, nothing happens. */ - void updateDialogTravelUI(); + void updateDialogTravelUI(); }; @@ -162,33 +169,29 @@ namespace svt VclPtr<HelpButton> m_pHelp; private: + // hold members in this structure to allow keeping compatible when members are added WizardMachineImplData* m_pImpl; - // hold members in this structure to allow keeping compatible when members are added SVT_DLLPRIVATE void addButtons(vcl::Window* _pParent, sal_uInt32 _nButtonFlags); public: - /** ctor - - For the button flags, use any combination of the WZB_* flags. - */ - OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags ); - OWizardMachine(vcl::Window* _pParent, sal_uInt32 _nButtonFlags ); + OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, WizardButtonFlags _nButtonFlags ); + OWizardMachine(vcl::Window* _pParent, WizardButtonFlags _nButtonFlags ); virtual ~OWizardMachine(); virtual void dispose() SAL_OVERRIDE; /// enable (or disable) buttons - void enableButtons(sal_uInt32 _nWizardButtonFlags, bool _bEnable); + void enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable); /// set the default style for a button - void defaultButton(sal_uInt32 _nWizardButtonFlags); + void defaultButton(WizardButtonFlags _nWizardButtonFlags); /// set the default style for a button - void defaultButton(PushButton* _pNewDefButton); + void defaultButton(PushButton* _pNewDefButton); /// set the base of the title to use - the title of the current page is appended - void setTitleBase(const OUString& _rTitleBase); + void setTitleBase(const OUString& _rTitleBase); /// determines whether there is a next state to which we can advance - virtual bool canAdvance() const; + virtual bool canAdvance() const; /** updates the user interface which deals with traveling in the wizard @@ -196,7 +199,7 @@ namespace svt itself allow to advance to the next state (<code>canAdvance</code>), and enables the "Next" button if and only if this is the case. */ - virtual void updateTravelUI(); + virtual void updateTravelUI(); protected: // WizardDialog overridables @@ -310,8 +313,8 @@ namespace svt For instance, if you want to travel two steps backward at a time, you could used two travelPrevious calls, but this would <em>show</em> both pages, which is not necessary, - since you're interested in the target page only. Using <member>skipBackwardUntil</member> reliefs - you from this. + since you're interested in the target page only. Using <member>skipBackwardUntil</member> relieves + you of this. @return <TRUE/> if and only if traveling was successful @@ -332,27 +335,31 @@ namespace svt /** retrieves a copy of the state history, i.e. all states we already visited */ - void getStateHistory( ::std::vector< WizardState >& _out_rHistory ); + void getStateHistory( ::std::vector< WizardState >& _out_rHistory ); public: - class AccessGuard { friend class WizardTravelSuspension; private: AccessGuard() { } }; + class AccessGuard + { + friend class WizardTravelSuspension; + private: + AccessGuard() { } + }; - void suspendTraveling( AccessGuard ); - void resumeTraveling( AccessGuard ); - bool isTravelingSuspended() const; + void suspendTraveling( AccessGuard ); + void resumeTraveling( AccessGuard ); + bool isTravelingSuspended() const; protected: TabPage* GetOrCreatePage( const WizardState i_nState ); private: - // long OnNextPage( PushButton* ); DECL_DLLPRIVATE_LINK(OnNextPage, void*); DECL_DLLPRIVATE_LINK(OnPrevPage, void*); DECL_DLLPRIVATE_LINK(OnFinish, void*); SVT_DLLPRIVATE void implResetDefault(vcl::Window* _pWindow); SVT_DLLPRIVATE void implUpdateTitle(); - SVT_DLLPRIVATE void implConstruct( const sal_uInt32 _nButtonFlags ); + SVT_DLLPRIVATE void implConstruct( const WizardButtonFlags _nButtonFlags ); }; /// helper class to temporarily suspend any traveling in the wizard diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 71d751fdf455..83ef2f42f767 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -113,14 +113,14 @@ namespace svt } //= RoadmapWizard - RoadmapWizard::RoadmapWizard( vcl::Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags ) + RoadmapWizard::RoadmapWizard( vcl::Window* _pParent, const WinBits i_nStyle, WizardButtonFlags _nButtonFlags ) :OWizardMachine( _pParent, i_nStyle, _nButtonFlags ) ,m_pImpl( new RoadmapWizardImpl ) { impl_construct(); } - RoadmapWizard::RoadmapWizard( vcl::Window* _pParent, sal_uInt32 _nButtonFlags ) + RoadmapWizard::RoadmapWizard( vcl::Window* _pParent, WizardButtonFlags _nButtonFlags ) :OWizardMachine( _pParent, _nButtonFlags ) ,m_pImpl( new RoadmapWizardImpl ) { @@ -457,7 +457,7 @@ namespace svt bHaveEnabledState = true; } - enableButtons( WZB_PREVIOUS, bHaveEnabledState ); + enableButtons( WizardButtonFlags::PREVIOUS, bHaveEnabledState ); implUpdateRoadmap(); } diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 8864376ed343..278df80c2d37 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -106,7 +106,7 @@ namespace svt } }; - OWizardMachine::OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags ) + OWizardMachine::OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, WizardButtonFlags _nButtonFlags ) :WizardDialog( _pParent, i_nStyle ) ,m_pFinish(NULL) ,m_pCancel(NULL) @@ -118,7 +118,7 @@ namespace svt implConstruct( _nButtonFlags ); } - OWizardMachine::OWizardMachine(vcl::Window* _pParent, sal_uInt32 _nButtonFlags ) + OWizardMachine::OWizardMachine(vcl::Window* _pParent, WizardButtonFlags _nButtonFlags ) :WizardDialog( _pParent, "WizardDialog", "svt/ui/wizarddialog.ui" ) ,m_pFinish(NULL) ,m_pCancel(NULL) @@ -131,13 +131,13 @@ namespace svt } - void OWizardMachine::implConstruct( const sal_uInt32 _nButtonFlags ) + void OWizardMachine::implConstruct( const WizardButtonFlags _nButtonFlags ) { m_pImpl->sTitleBase = GetText(); // create the buttons according to the wizard button flags // the help button - if (_nButtonFlags & WZB_HELP) + if (_nButtonFlags & WizardButtonFlags::HELP) { m_pHelp= VclPtr<HelpButton>::Create(this, WB_TABSTOP); m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); @@ -146,7 +146,7 @@ namespace svt } // the previous button - if (_nButtonFlags & WZB_PREVIOUS) + if (_nButtonFlags & WizardButtonFlags::PREVIOUS) { m_pPrevPage = VclPtr<PushButton>::Create(this, WB_TABSTOP); m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS ); @@ -154,7 +154,7 @@ namespace svt m_pPrevPage->SetText(SVT_RESSTR(STR_WIZDLG_PREVIOUS)); m_pPrevPage->Show(); - if (_nButtonFlags & WZB_NEXT) + if (_nButtonFlags & WizardButtonFlags::NEXT) AddButton( m_pPrevPage, ( WIZARDDIALOG_BUTTON_SMALLSTDOFFSET_X) ); // half x-offset to the next button else AddButton( m_pPrevPage, WIZARDDIALOG_BUTTON_STDOFFSET_X ); @@ -163,7 +163,7 @@ namespace svt } // the next button - if (_nButtonFlags & WZB_NEXT) + if (_nButtonFlags & WizardButtonFlags::NEXT) { m_pNextPage = VclPtr<PushButton>::Create(this, WB_TABSTOP); m_pNextPage->SetHelpId( HID_WIZARD_NEXT ); @@ -177,7 +177,7 @@ namespace svt } // the finish button - if (_nButtonFlags & WZB_FINISH) + if (_nButtonFlags & WizardButtonFlags::FINISH) { m_pFinish = VclPtr<OKButton>::Create(this, WB_TABSTOP); m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); @@ -189,7 +189,7 @@ namespace svt } // the cancel button - if (_nButtonFlags & WZB_CANCEL) + if (_nButtonFlags & WizardButtonFlags::CANCEL) { m_pCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP); m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); @@ -291,19 +291,19 @@ namespace svt } - void OWizardMachine::defaultButton(sal_uInt32 _nWizardButtonFlags) + void OWizardMachine::defaultButton(WizardButtonFlags _nWizardButtonFlags) { // the new default button PushButton* pNewDefButton = NULL; - if (m_pFinish && (_nWizardButtonFlags & WZB_FINISH)) + if (m_pFinish && (_nWizardButtonFlags & WizardButtonFlags::FINISH)) pNewDefButton = m_pFinish; - if (m_pNextPage && (_nWizardButtonFlags & WZB_NEXT)) + if (m_pNextPage && (_nWizardButtonFlags & WizardButtonFlags::NEXT)) pNewDefButton = m_pNextPage; - if (m_pPrevPage && (_nWizardButtonFlags & WZB_PREVIOUS)) + if (m_pPrevPage && (_nWizardButtonFlags & WizardButtonFlags::PREVIOUS)) pNewDefButton = m_pPrevPage; - if (m_pHelp && (_nWizardButtonFlags & WZB_HELP)) + if (m_pHelp && (_nWizardButtonFlags & WizardButtonFlags::HELP)) pNewDefButton = m_pHelp; - if (m_pCancel && (_nWizardButtonFlags & WZB_CANCEL)) + if (m_pCancel && (_nWizardButtonFlags & WizardButtonFlags::CANCEL)) pNewDefButton = m_pCancel; if ( pNewDefButton ) @@ -355,17 +355,17 @@ namespace svt } - void OWizardMachine::enableButtons(sal_uInt32 _nWizardButtonFlags, bool _bEnable) + void OWizardMachine::enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable) { - if (m_pFinish && (_nWizardButtonFlags & WZB_FINISH)) + if (m_pFinish && (_nWizardButtonFlags & WizardButtonFlags::FINISH)) m_pFinish->Enable(_bEnable); - if (m_pNextPage && (_nWizardButtonFlags & WZB_NEXT)) + if (m_pNextPage && (_nWizardButtonFlags & WizardButtonFlags::NEXT)) m_pNextPage->Enable(_bEnable); - if (m_pPrevPage && (_nWizardButtonFlags & WZB_PREVIOUS)) + if (m_pPrevPage && (_nWizardButtonFlags & WizardButtonFlags::PREVIOUS)) m_pPrevPage->Enable(_bEnable); - if (m_pHelp && (_nWizardButtonFlags & WZB_HELP)) + if (m_pHelp && (_nWizardButtonFlags & WizardButtonFlags::HELP)) m_pHelp->Enable(_bEnable); - if (m_pCancel && (_nWizardButtonFlags & WZB_CANCEL)) + if (m_pCancel && (_nWizardButtonFlags & WizardButtonFlags::CANCEL)) m_pCancel->Enable(_bEnable); } @@ -379,9 +379,9 @@ namespace svt pController->initializePage(); if ( isAutomaticNextButtonStateEnabled() ) - enableButtons( WZB_NEXT, canAdvance() ); + enableButtons( WizardButtonFlags::NEXT, canAdvance() ); - enableButtons( WZB_PREVIOUS, !m_pImpl->aStateHistory.empty() ); + enableButtons( WizardButtonFlags::PREVIOUS, !m_pImpl->aStateHistory.empty() ); // set the new title - it depends on the current page (i.e. state) implUpdateTitle(); @@ -673,7 +673,7 @@ namespace svt bool bCanAdvance = ( !pController || pController->canAdvance() ) // the current page allows to advance && canAdvance(); // the dialog as a whole allows to advance - enableButtons( WZB_NEXT, bCanAdvance ); + enableButtons( WizardButtonFlags::NEXT, bCanAdvance ); } diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 3980085246df..7b9cade8d85a 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -72,19 +72,19 @@ namespace { namespace { - sal_uInt32 lcl_convertWizardButtonToWZB( const sal_Int16 i_nWizardButton ) + WizardButtonFlags lcl_convertWizardButtonToWZB( const sal_Int16 i_nWizardButton ) { switch ( i_nWizardButton ) { - case WizardButton::NONE: return WZB_NONE; - case WizardButton::NEXT: return WZB_NEXT; - case WizardButton::PREVIOUS: return WZB_PREVIOUS; - case WizardButton::FINISH: return WZB_FINISH; - case WizardButton::CANCEL: return WZB_CANCEL; - case WizardButton::HELP: return WZB_HELP; + case WizardButton::NONE: return WizardButtonFlags::NONE; + case WizardButton::NEXT: return WizardButtonFlags::NEXT; + case WizardButton::PREVIOUS: return WizardButtonFlags::PREVIOUS; + case WizardButton::FINISH: return WizardButtonFlags::FINISH; + case WizardButton::CANCEL: return WizardButtonFlags::CANCEL; + case WizardButton::HELP: return WizardButtonFlags::HELP; } OSL_FAIL( "lcl_convertWizardButtonToWZB: invalid WizardButton constant!" ); - return WZB_NONE; + return WizardButtonFlags::NONE; } } diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 068b08ffd54f..3a235582c605 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -43,7 +43,7 @@ using namespace ::com::sun::star; SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem) : RoadmapWizard(&rView.GetViewFrame()->GetWindow(), - static_cast<sal_uInt32>(WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP)), + WizardButtonFlags::NEXT|WizardButtonFlags::PREVIOUS|WizardButtonFlags::FINISH|WizardButtonFlags::CANCEL|WizardButtonFlags::HELP), m_pSwView(&rView), m_bDocumentLoad( false ), m_rConfigItem(rItem), @@ -59,8 +59,8 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem m_sFinish( SW_RES( ST_FINISH )), m_nRestartPage( MM_DOCUMENTSELECTPAGE ) { - defaultButton(WZB_NEXT); - enableButtons(WZB_FINISH, false); + defaultButton(WizardButtonFlags::NEXT); + enableButtons(WizardButtonFlags::FINISH, false); m_pFinish->SetText(m_sFinish); m_pNextPage->SetHelpId(HID_MM_NEXT_PAGE); @@ -165,8 +165,8 @@ void SwMailMergeWizard::enterState( WizardState _nState ) bEnableNext = false; break; } - enableButtons( WZB_PREVIOUS, bEnablePrev); - enableButtons( WZB_NEXT, bEnableNext); + enableButtons( WizardButtonFlags::PREVIOUS, bEnablePrev); + enableButtons( WizardButtonFlags::NEXT, bEnableNext); UpdateRoadmap(); } diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 37a06cc86276..3c455092c585 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -176,7 +176,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl) rConfigItem.SetFilter( sFilter ); InsertDataHdl_Impl(0); GetWizard()->UpdateRoadmap(); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + GetWizard()->enableButtons(WizardButtonFlags::NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); } } catch (const uno::Exception& e) @@ -210,7 +210,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton) } pDlg.reset(); GetWizard()->UpdateRoadmap(); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + GetWizard()->enableButtons(WizardButtonFlags::NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); return 0; } @@ -226,7 +226,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton) //preview update InsertDataHdl_Impl(0); GetWizard()->UpdateRoadmap(); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + GetWizard()->enableButtons(WizardButtonFlags::NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); } return 0; } @@ -261,7 +261,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressBlockSelectHdl_Impl) m_pWizard->GetConfigItem())); m_pWizard->GetConfigItem().SetCurrentAddressBlockIndex( nSel ); GetWizard()->UpdateRoadmap(); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + GetWizard()->enableButtons(WizardButtonFlags::NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); return 0; } @@ -310,7 +310,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, InsertDataHdl_Impl, ImageButton*, pButton m_pPrevSetIB->Enable(bEnable); m_pDocumentIndexFI->SetText(m_sDocument.replaceFirst("%1", OUString::number(nPos))); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + GetWizard()->enableButtons(WizardButtonFlags::NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); bool bHasResultSet = rConfig.GetResultSet().is(); m_pCurrentAddressFI->Show(bHasResultSet); if(bHasResultSet) diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx index 50fe45c17446..76035a2f3ef2 100644 --- a/sw/source/ui/dbui/mmdocselectpage.cxx +++ b/sw/source/ui/dbui/mmdocselectpage.cxx @@ -114,7 +114,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, DocSelectHdl, RadioButton*, pButton) m_pRecentDocLB->Enable(m_pRecentDocRB == pButton); m_pWizard->UpdateRoadmap(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE)); return 0; } @@ -169,7 +169,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton) } } m_pWizard->UpdateRoadmap(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_OUTPUTTYPETPAGE)); return 0; } diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 717b1e1be2a3..171478787c69 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -98,7 +98,7 @@ IMPL_LINK_NOARG(SwGreetingsHandler, IndividualHdl_Impl) { m_pWizard->GetConfigItem().SetIndividualGreeting(bIndividual, false); m_pWizard->UpdateRoadmap(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } UpdatePreview(); return 0; @@ -118,7 +118,7 @@ IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton) if(m_bIsTabPage) { m_pWizard->UpdateRoadmap(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } UpdatePreview(); } @@ -139,7 +139,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton) { UpdatePreview(); m_pWizard->UpdateRoadmap(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } return 0; } @@ -328,7 +328,7 @@ void SwMailMergeGreetingsPage::ActivatePage() m_pFemaleFieldCB->SaveValue(); UpdatePreview(); - m_pWizard->enableButtons(WZB_NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); + m_pWizard->enableButtons(WizardButtonFlags::NEXT, m_pWizard->isStateEnabled(MM_PREPAREMERGEPAGE)); } bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason ) diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 6c92c26f8b8c..5fc51147d4c5 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -583,7 +583,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveStartHdl_Impl, PushButton*, pButton) rConfigItem.AddSavedDocument( aURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); pButton->Enable(false); - m_pWizard->enableButtons(WZB_FINISH, true); + m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); pButton->Enable(false); } @@ -739,7 +739,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) ); m_bCancelSaving = false; aSaveMonitor->Show(); - m_pWizard->enableButtons(WZB_CANCEL, false); + m_pWizard->enableButtons(WizardButtonFlags::CANCEL, false); for(sal_uInt32 nDoc = nBegin; nDoc < nEnd && !m_bCancelSaving; ++nDoc) { @@ -817,8 +817,8 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) } ::osl::File::remove( sTargetTempURL ); } - m_pWizard->enableButtons(WZB_CANCEL, true); - m_pWizard->enableButtons(WZB_FINISH, true); + m_pWizard->enableButtons(WizardButtonFlags::CANCEL, true); + m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); return 0; } @@ -906,7 +906,7 @@ IMPL_LINK_NOARG(SwMailMergeOutputPage, PrintHdl_Impl) SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell(); SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh)); SfxBoolItem aMergeSilent(SID_SILENT, false); - m_pWizard->enableButtons(WZB_CANCEL, false); + m_pWizard->enableButtons(WizardButtonFlags::CANCEL, false); uno::Sequence < beans::PropertyValue > aProps( 2 ); aProps[0]. Name = "MonitorVisible"; @@ -918,8 +918,8 @@ IMPL_LINK_NOARG(SwMailMergeOutputPage, PrintHdl_Impl) SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh)); pTargetView->SetMailMergeConfigItem(0, 0, false); - m_pWizard->enableButtons(WZB_CANCEL, true); - m_pWizard->enableButtons(WZB_FINISH, true); + m_pWizard->enableButtons(WizardButtonFlags::CANCEL, true); + m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); return 0; } @@ -1308,7 +1308,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) pDlg->EnableDesctruction(); ::osl::File::remove( sTargetTempURL ); - m_pWizard->enableButtons(WZB_FINISH, true); + m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); //the dialog deletes itself //delete pDlg; return 0; |