summaryrefslogtreecommitdiff
path: root/svtools/source/dialogs/roadmapwizard.cxx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-05-25 10:17:24 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-05-25 10:17:24 +0200
commitf786d740fb0e108efbd471c8628daf3bf5f4bfe9 (patch)
treed9decfe22751022843d042129caf1aaeb731a957 /svtools/source/dialogs/roadmapwizard.cxx
parent9c472983f28623f48fc098ddf0fc19faf3253419 (diff)
unoawt: completely separated the controller functionality of a wizard page from the wizard page itself,
by moving the canAdvance method from OWizardPage to the IWizardPage interface, which in this course has been renamed to IWizardPageController. This will later on allow to have implementations where the TabPage is provided by an external component (e.g. as UNO Service), but the controlling of those pages is still intercepted and handled internally.
Diffstat (limited to 'svtools/source/dialogs/roadmapwizard.cxx')
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index a2ffb8ad5849..c28cfe1d4b18 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -398,8 +398,14 @@ namespace svt
}
// can we advance from the current page?
- const OWizardPage* pCurrentPage = dynamic_cast< const OWizardPage* >( GetPage( getCurrentState() ) );
- const bool bCurrentPageCanAdvance = !pCurrentPage || pCurrentPage->canAdvance();
+ bool bCurrentPageCanAdvance = true;
+ TabPage* pCurrentPage = GetPage( getCurrentState() );
+ if ( pCurrentPage )
+ {
+ const IWizardPageController* pController = getPageController( GetPage( getCurrentState() ) );
+ OSL_ENSURE( pController != NULL, "RoadmapWizard::implUpdateRoadmap: no controller for the current page!" );
+ bCurrentPageCanAdvance = !pController || pController->canAdvance();
+ }
// now, we have to remove all items after nCurrentStatePathIndex, and insert the items from the active
// path, up to (excluding) nUpperStepBoundary