summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-20 13:15:44 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2023-02-21 11:43:50 +0000
commite7dd0fa490c671267a4419a6c2ef8a1367114209 (patch)
treec0e40f56efdaf77abaf2959e15bfc7e9a6532fad /vcl
parentf02c2912e50df357125c93eaaadfc96f02a05db0 (diff)
tdf#132110 page ids might not be state ids
Change-Id: I9f8946acbcf593e9adf6d31631b82cdafcd3f472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147327 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit cdf7b51229f2353376fb4e9de309fb9ee5580b3a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147356 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/roadmapwizard.cxx16
-rw-r--r--vcl/source/control/wizardmachine.cxx12
2 files changed, 19 insertions, 9 deletions
diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx
index fe4c53b92e02..49c28de9bfe9 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -470,7 +470,7 @@ namespace vcl
GetOrCreatePage(nState);
}
- OString sIdent(OString::number(nState));
+ OString sIdent(getPageIdentForState(nState));
m_xAssistant->set_page_index(sIdent, nItemIndex);
m_xAssistant->set_page_title(sIdent, getStateDisplayName(nState));
@@ -639,9 +639,9 @@ namespace vcl
IMPL_LINK(RoadmapWizardMachine, OnRoadmapItemSelected, const OString&, rCurItemId, bool)
{
- int nCurItemId = rCurItemId.toInt32();
+ WizardTypes::WizardState nSelectedState = getStateFromPageIdent(rCurItemId);
- if ( nCurItemId == getCurrentState() )
+ if (nSelectedState == getCurrentState())
// nothing to do
return false;
@@ -651,7 +651,7 @@ namespace vcl
WizardTravelSuspension aTravelGuard( *this );
sal_Int32 nCurrentIndex = m_pImpl->getStateIndexInPath( getCurrentState(), m_pImpl->nActivePath );
- sal_Int32 nNewIndex = m_pImpl->getStateIndexInPath( nCurItemId, m_pImpl->nActivePath );
+ sal_Int32 nNewIndex = m_pImpl->getStateIndexInPath( nSelectedState, m_pImpl->nActivePath );
DBG_ASSERT( ( nCurrentIndex != -1 ) && ( nNewIndex != -1 ),
"RoadmapWizard::OnRoadmapItemSelected: something's wrong here!" );
@@ -663,8 +663,8 @@ namespace vcl
bool bResult = true;
if ( nNewIndex > nCurrentIndex )
{
- bResult = skipUntil( static_cast<WizardTypes::WizardState>(nCurItemId) );
- WizardTypes::WizardState nTemp = static_cast<WizardTypes::WizardState>(nCurItemId);
+ bResult = skipUntil(nSelectedState);
+ WizardTypes::WizardState nTemp = nSelectedState;
while( nTemp )
{
if( m_pImpl->aDisabledStates.find( --nTemp ) != m_pImpl->aDisabledStates.end() )
@@ -672,7 +672,7 @@ namespace vcl
}
}
else
- bResult = skipBackwardUntil( static_cast<WizardTypes::WizardState>(nCurItemId) );
+ bResult = skipBackwardUntil(nSelectedState);
return bResult;
}
@@ -746,7 +746,7 @@ namespace vcl
}
// if the state is currently in the roadmap, reflect it's new status
- m_xAssistant->set_page_sensitive(OString::number(_nState), _bEnable);
+ m_xAssistant->set_page_sensitive(getPageIdentForState(_nState), _bEnable);
}
bool RoadmapWizardMachine::knowsState( WizardTypes::WizardState i_nState ) const
diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx
index 86176f2fc7ac..fc76037c5ae1 100644
--- a/vcl/source/control/wizardmachine.cxx
+++ b/vcl/source/control/wizardmachine.cxx
@@ -893,6 +893,16 @@ namespace vcl
implUpdateTitle();
}
+ OString WizardMachine::getPageIdentForState(WizardTypes::WizardState nState) const
+ {
+ return OString::number(nState);
+ }
+
+ WizardTypes::WizardState WizardMachine::getStateFromPageIdent(const OString& rIdent) const
+ {
+ return rIdent.toInt32();
+ }
+
BuilderPage* WizardMachine::GetOrCreatePage( const WizardTypes::WizardState i_nState )
{
if ( nullptr == GetPage( i_nState ) )
@@ -1174,7 +1184,7 @@ namespace vcl
if (pOldTabPage)
pOldTabPage->Deactivate();
- m_xAssistant->set_current_page(OString::number(nState));
+ m_xAssistant->set_current_page(getPageIdentForState(nState));
m_pCurTabPage = GetPage(m_nCurState);
m_pCurTabPage->Activate();