diff options
Diffstat (limited to 'svtools/source/uno/wizard')
-rw-r--r-- | svtools/source/uno/wizard/unowizard.cxx | 28 | ||||
-rw-r--r-- | svtools/source/uno/wizard/wizardshell.cxx | 16 | ||||
-rw-r--r-- | svtools/source/uno/wizard/wizardshell.hxx | 5 |
3 files changed, 21 insertions, 28 deletions
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index b0998a583420..3980085246df 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -136,7 +136,7 @@ namespace { virtual ~Wizard(); protected: - virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; + virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE; virtual void destroyDialog() SAL_OVERRIDE; private: @@ -268,12 +268,12 @@ namespace { } - Dialog* Wizard::createDialog( vcl::Window* i_pParent ) + VclPtr<Dialog> Wizard::createDialog( vcl::Window* i_pParent ) { - WizardShell* pDialog( new WizardShell( i_pParent, m_xController, m_aWizardSteps ) ); + VclPtrInstance<WizardShell> pDialog( i_pParent, m_xController, m_aWizardSteps ); pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) ); pDialog->setTitleBase( m_sTitle ); - return pDialog; + return pDialog.get(); } @@ -359,7 +359,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enableButtons: invalid dialog implementation!" ); pWizardImpl->enableButtons( lcl_convertWizardButtonToWZB( i_WizardButton ), i_Enable ); @@ -371,7 +371,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::setDefaultButton: invalid dialog implementation!" ); pWizardImpl->defaultButton( lcl_convertWizardButtonToWZB( i_WizardButton ) ); @@ -383,7 +383,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelNext: invalid dialog implementation!" ); return pWizardImpl->travelNext(); @@ -395,7 +395,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelPrevious: invalid dialog implementation!" ); return pWizardImpl->travelPrevious(); @@ -407,7 +407,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enablePage: invalid dialog implementation!" ); if ( !pWizardImpl->knowsPage( i_PageID ) ) @@ -425,7 +425,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::updateTravelUI: invalid dialog implementation!" ); pWizardImpl->updateTravelUI(); @@ -437,7 +437,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::advanceTo: invalid dialog implementation!" ); return pWizardImpl->advanceTo( i_PageId ); @@ -449,7 +449,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::goBackTo: invalid dialog implementation!" ); return pWizardImpl->goBackTo( i_PageId ); @@ -461,7 +461,7 @@ namespace { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( m_aMutex ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() ); return pWizardImpl->getCurrentWizardPage(); @@ -476,7 +476,7 @@ namespace { if ( ( i_PathIndex < 0 ) || ( i_PathIndex >= m_aWizardSteps.getLength() ) ) throw NoSuchElementException( OUString(), *this ); - WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); + WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog.get() ); ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::activatePath: invalid dialog implementation!" ); pWizardImpl->activatePath( i_PathIndex, i_Final ); diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx index d10db321ee60..b3504d9d5f55 100644 --- a/svtools/source/uno/wizard/wizardshell.cxx +++ b/svtools/source/uno/wizard/wizardshell.cxx @@ -90,11 +90,6 @@ namespace svt { namespace uno } - WizardShell::~WizardShell() - { - } - - short WizardShell::Execute() { ActivatePage(); @@ -187,17 +182,17 @@ namespace svt { namespace uno } - TabPage* WizardShell::createPage( WizardState i_nState ) + VclPtr<TabPage> WizardShell::createPage( WizardState i_nState ) { ENSURE_OR_RETURN( m_xController.is(), "WizardShell::createPage: no WizardController!", NULL ); ::boost::shared_ptr< WizardPageController > pController( new WizardPageController( *this, m_xController, impl_stateToPageId( i_nState ) ) ); - TabPage* pPage = pController->getTabPage(); - OSL_ENSURE( pPage != NULL, "WizardShell::createPage: illegal tab page!" ); - if ( pPage == NULL ) + VclPtr<TabPage> pPage = pController->getTabPage(); + OSL_ENSURE( pPage, "WizardShell::createPage: illegal tab page!" ); + if ( !pPage ) { // fallback for ill-behaved clients: empty page - pPage = new TabPage( this, 0 ); + pPage = VclPtr<TabPage>::Create( this, 0 ); pPage->SetSizePixel( LogicToPixel( Size( 280, 185 ), MAP_APPFONT ) ); } @@ -205,7 +200,6 @@ namespace svt { namespace uno return pPage; } - IWizardPageController* WizardShell::getPageController( TabPage* i_pCurrentPage ) const { return impl_getController( i_pCurrentPage ).get(); diff --git a/svtools/source/uno/wizard/wizardshell.hxx b/svtools/source/uno/wizard/wizardshell.hxx index 4d2e3e8f0315..68650dd067cf 100644 --- a/svtools/source/uno/wizard/wizardshell.hxx +++ b/svtools/source/uno/wizard/wizardshell.hxx @@ -48,13 +48,12 @@ namespace svt { namespace uno const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizardController >& i_rController, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int16 > >& i_rPaths ); - virtual ~WizardShell(); // Dialog overridables virtual short Execute() SAL_OVERRIDE; // OWizardMachine overridables - virtual TabPage* createPage( WizardState i_nState ) SAL_OVERRIDE; + virtual VclPtr<TabPage> createPage( WizardState i_nState ) SAL_OVERRIDE; virtual void enterState( WizardState i_nState ) SAL_OVERRIDE; virtual bool leaveState( WizardState i_nState ) SAL_OVERRIDE; virtual OUString getStateDisplayName( WizardState i_nState ) const SAL_OVERRIDE; @@ -118,7 +117,7 @@ namespace svt { namespace uno using WizardShell_Base::activatePath; private: - typedef ::std::map< TabPage*, PWizardPageController > Page2ControllerMap; + typedef ::std::map< VclPtr<TabPage>, PWizardPageController > Page2ControllerMap; const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XWizardController > m_xController; const sal_Int16 m_nFirstPageID; |