diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-10 11:36:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-10 13:55:33 +0200 |
commit | 3455c3efff86b12835261e2165ec563b2e0df2d3 (patch) | |
tree | 8743b79c816aeff1f7a86a21666960d9b99ebc17 /vcl | |
parent | 3882a1811155415cba63ffc08f0f4863c0dbb3b7 (diff) |
loplugin:unnecessaryreturn RoadmapWizard
Change-Id: I269fd92a6076fe9ebe18646e537e7031aec47fef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116976
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/wizdlg.hxx | 8 | ||||
-rw-r--r-- | vcl/source/control/wizardmachine.cxx | 21 |
2 files changed, 11 insertions, 18 deletions
diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index 7c6af8636260..d1dd68f0cde3 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -120,7 +120,7 @@ namespace vcl virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; bool ShowPage( sal_uInt16 nLevel ); - bool Finish( tools::Long nResult = 0 ); + void Finish( tools::Long nResult = 0 ); sal_uInt16 GetCurLevel() const { return mnCurLevel; } void AddPage( TabPage* pPage ); @@ -182,10 +182,10 @@ namespace vcl WizardTypes::WizardState determineNextState(WizardTypes::WizardState nCurrentState) const; /// travel to the next state - bool travelNext(); + void travelNext(); /// travel to the previous state - bool travelPrevious(); + void travelPrevious(); /** enables the automatic enabled/disabled state of the "Next" button @@ -270,7 +270,7 @@ namespace vcl bool isTravelingSuspended() const; protected: - TabPage* GetOrCreatePage(const WizardTypes::WizardState i_nState); + void GetOrCreatePage(const WizardTypes::WizardState i_nState); private: void ImplCalcSize( Size& rSize ); diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx index 919b54bbdc00..59554f275663 100644 --- a/vcl/source/control/wizardmachine.cxx +++ b/vcl/source/control/wizardmachine.cxx @@ -484,7 +484,7 @@ namespace vcl return Dialog::EventNotify( rNEvt ); } - TabPage* RoadmapWizard::GetOrCreatePage( const WizardTypes::WizardState i_nState ) + void RoadmapWizard::GetOrCreatePage( const WizardTypes::WizardState i_nState ) { if ( nullptr == GetPage( i_nState ) ) { @@ -508,7 +508,6 @@ namespace vcl // already had this page - just change it SetPage( i_nState, pNewPage ); } - return GetPage( i_nState ); } void RoadmapWizard::ActivatePage() @@ -527,13 +526,12 @@ namespace vcl return true; } - bool RoadmapWizard::Finish( tools::Long nResult ) + void RoadmapWizard::Finish( tools::Long nResult ) { if ( IsInExecute() ) EndDialog( nResult ); else if ( GetStyle() & WB_CLOSEABLE ) Close(); - return true; } void RoadmapWizard::AddPage( TabPage* pPage ) @@ -753,17 +751,17 @@ namespace vcl return true; } - bool RoadmapWizard::travelNext() + void RoadmapWizard::travelNext() { // allowed to leave the current page? if ( !prepareLeaveCurrentState( WizardTypes::eTravelForward ) ) - return false; + return; // determine the next state to travel to WizardTypes::WizardState nCurrentState = getCurrentState(); WizardTypes::WizardState nNextState = determineNextState(nCurrentState); if (WZS_INVALID_STATE == nNextState) - return false; + return; // the state history is used by the enterState method // all fine @@ -771,19 +769,16 @@ namespace vcl if (!ShowPage(nNextState)) { m_xWizardImpl->aStateHistory.pop(); - return false; } - - return true; } - bool RoadmapWizard::travelPrevious() + void RoadmapWizard::travelPrevious() { DBG_ASSERT(!m_xWizardImpl->aStateHistory.empty(), "RoadmapWizard::travelPrevious: have no previous page!"); // allowed to leave the current page? if ( !prepareLeaveCurrentState( WizardTypes::eTravelBackward ) ) - return false; + return; // the next state to switch to WizardTypes::WizardState nPreviousState = m_xWizardImpl->aStateHistory.top(); @@ -794,11 +789,9 @@ namespace vcl if (!ShowPage(nPreviousState)) { m_xWizardImpl->aStateHistory.push(nPreviousState); - return false; } // all fine - return true; } void RoadmapWizard::removePageFromHistory( WizardTypes::WizardState nToRemove ) |