diff options
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/QuerySaveDocument.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/docinsert.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/doctemplates.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/new.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 28 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/plugin.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 84 |
12 files changed, 119 insertions, 91 deletions
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx index 63d458f1c955..a6f5ec97b73f 100644 --- a/sfx2/source/doc/QuerySaveDocument.cxx +++ b/sfx2/source/doc/QuerySaveDocument.cxx @@ -29,9 +29,9 @@ short ExecuteQuerySaveDocument(vcl::Window* _pParent, const OUString& _rTitle) return RET_NO; } - MessageDialog aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui"); - aQBox.set_primary_text(aQBox.get_primary_text().replaceFirst("$(DOC)", _rTitle)); - return aQBox.Execute(); + ScopedVclPtrInstance< MessageDialog > aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui"); + aQBox->set_primary_text(aQBox->get_primary_text().replaceFirst("$(DOC)", _rTitle)); + return aQBox->Execute(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index d114453f1ce3..bd3ba50f01e3 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -190,12 +190,12 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl) if ( ( aValue >>= bPassWord ) && bPassWord ) { // ask for the password - SfxPasswordDialog aPasswordDlg( NULL ); - aPasswordDlg.ShowExtras( SfxShowExtras::CONFIRM ); - short nRet = aPasswordDlg.Execute(); + ScopedVclPtrInstance< SfxPasswordDialog > aPasswordDlg(nullptr); + aPasswordDlg->ShowExtras( SfxShowExtras::CONFIRM ); + short nRet = aPasswordDlg->Execute(); if ( RET_OK == nRet ) { - OUString aPasswd = aPasswordDlg.GetPassword(); + OUString aPasswd = aPasswordDlg->GetPassword(); m_pItemSet->Put( SfxStringItem( SID_PASSWORD, aPasswd ) ); } else diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index b33e4f865f4d..a4d4ef71da69 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -138,7 +138,8 @@ class WaitWindow_Impl : public WorkWindow public: WaitWindow_Impl(); - virtual ~WaitWindow_Impl(); + virtual ~WaitWindow_Impl(); + virtual void dispose() SAL_OVERRIDE; virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; }; @@ -470,8 +471,7 @@ void SfxDocTplService_Impl::init_Impl() aGuard.clear(); SolarMutexClearableGuard aSolarGuard; - WaitWindow_Impl* pWin = new WaitWindow_Impl(); - + VclPtrInstance< WaitWindow_Impl > pWin; aSolarGuard.clear(); ::osl::ClearableMutexGuard anotherGuard( maMutex ); @@ -480,7 +480,7 @@ void SfxDocTplService_Impl::init_Impl() anotherGuard.clear(); SolarMutexGuard aSecondSolarGuard; - delete pWin; + pWin.disposeAndClear(); } else if ( needsUpdate() ) // the UI should be shown only on the first update @@ -2449,7 +2449,13 @@ WaitWindow_Impl::WaitWindow_Impl() WaitWindow_Impl::~WaitWindow_Impl() { + disposeOnce(); +} + +void WaitWindow_Impl::dispose() +{ Hide(); + WorkWindow::dispose(); } diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 9610a8bd222b..a3aef2d2a21a 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -667,9 +667,9 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus ) { // notify the user that SaveAs is going to be done vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel ); - MessageDialog aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE), + ScopedVclPtrInstance<MessageDialog> aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL); - if ( aMessageBox.Execute() == RET_OK ) + if ( aMessageBox->Execute() == RET_OK ) nResult = STATUS_SAVEAS; else nResult = STATUS_NO_ACTION; @@ -1882,9 +1882,9 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod return true; vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel ); - SfxAlienWarningDialog aDlg( pWin, aOldUIName, aDefExtension, bDefIsAlien ); + ScopedVclPtrInstance< SfxAlienWarningDialog > aDlg( pWin, aOldUIName, aDefExtension, bDefIsAlien ); - return aDlg.Execute() == RET_OK; + return aDlg->Execute() == RET_OK; } vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel ) diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index a3dc009a9e38..0564141cb174 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -174,7 +174,7 @@ throw( uno::RuntimeException, std::exception ) { DBG_ASSERT( !mxFrame.is(), "Frame already existing!" ); vcl::Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - IFrameWindow_Impl* pWin = new IFrameWindow_Impl( pParent, maFrmDescr.IsFrameBorderOn() ); + VclPtr<IFrameWindow_Impl> pWin = VclPtr<IFrameWindow_Impl>::Create( pParent, maFrmDescr.IsFrameBorderOn() ); pWin->SetSizePixel( pParent->GetOutputSizePixel() ); pWin->SetBackground(); pWin->Show(); diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index e62676bca661..1d4f8e6fa858 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -123,19 +123,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxPreviewWin(vcl::Win class SfxNewFileDialog_Impl { - ListBox* m_pRegionLb; - ListBox* m_pTemplateLb; + VclPtr<ListBox> m_pRegionLb; + VclPtr<ListBox> m_pTemplateLb; - SfxPreviewWin_Impl* m_pPreviewWin; + VclPtr<SfxPreviewWin_Impl> m_pPreviewWin; - CheckBox* m_pTextStyleCB; - CheckBox* m_pFrameStyleCB; - CheckBox* m_pPageStyleCB; - CheckBox* m_pNumStyleCB; - CheckBox* m_pMergeStyleCB; - PushButton* m_pLoadFilePB; + VclPtr<CheckBox> m_pTextStyleCB; + VclPtr<CheckBox> m_pFrameStyleCB; + VclPtr<CheckBox> m_pPageStyleCB; + VclPtr<CheckBox> m_pNumStyleCB; + VclPtr<CheckBox> m_pMergeStyleCB; + VclPtr<PushButton> m_pLoadFilePB; - VclExpander* m_pMoreBt; + VclPtr<VclExpander> m_pMoreBt; Idle aPrevIdle; OUString aNone; OUString sLoadTemplate; @@ -143,7 +143,7 @@ class SfxNewFileDialog_Impl sal_uInt16 nFlags; SfxDocumentTemplates aTemplates; SfxObjectShellLock xDocShell; - SfxNewFileDialog* pAntiImpl; + VclPtr<SfxNewFileDialog> pAntiImpl; DECL_LINK( Update, void * ); @@ -454,7 +454,13 @@ SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags) SfxNewFileDialog::~SfxNewFileDialog() { + disposeOnce(); +} + +void SfxNewFileDialog::dispose() +{ delete pImpl; + SfxModalDialog::dispose(); } bool SfxNewFileDialog::IsTemplate() const diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index d2b4d3c8aacd..faf46aa367bd 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -131,11 +131,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const std::shared_ptr<GDIMetaFile> xFile(new GDIMetaFile); - VirtualDevice aDevice; - aDevice.EnableOutput( false ); + ScopedVclPtrInstance< VirtualDevice > pDevice; + pDevice->EnableOutput( false ); MapMode aMode( this->GetMapUnit() ); - aDevice.SetMapMode( aMode ); + pDevice->SetMapMode( aMode ); xFile->SetPrefMapMode( aMode ); Size aTmpSize; @@ -155,7 +155,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(), "size of first page is 0, override GetFirstPageSize or set vis-area!" ); - xFile->Record( &aDevice ); + xFile->Record( pDevice ); LanguageType eLang; SvtCTLOptions aCTLOptions; @@ -166,9 +166,9 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const else eLang = (LanguageType) Application::GetSettings().GetLanguageTag().getLanguageType(); - aDevice.SetDigitLanguage( eLang ); + pDevice->SetDigitLanguage( eLang ); - const_cast<SfxObjectShell*>(this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); + const_cast<SfxObjectShell*>(this)->DoDraw( pDevice, Point(0,0), aTmpSize, JobSetup(), nAspect ); xFile->Stop(); @@ -286,13 +286,13 @@ void SfxObjectShell::UpdateTime_Impl( -SfxDocumentInfoDialog* SfxObjectShell::CreateDocumentInfoDialog +VclPtr<SfxDocumentInfoDialog> SfxObjectShell::CreateDocumentInfoDialog ( vcl::Window* pParent, const SfxItemSet& rSet ) { - return new SfxDocumentInfoDialog(pParent, rSet); + return VclPtr<SfxDocumentInfoDialog>::Create(pParent, rSet); } @@ -471,8 +471,8 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) { OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() ); sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName ); - sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage ); - if ( RET_YES == aBox.Execute() ) + ScopedVclPtrInstance< sfx2::QueryTemplateBox > aBox(GetDialogParent(), sMessage); + if ( RET_YES == aBox->Execute() ) bLoad = true; } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 8f10da507570..3711c68b7130 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -335,7 +335,7 @@ void SfxObjectShell::CheckOut( ) } catch ( const uno::RuntimeException& e ) { - boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog( &GetFrame()->GetWindow(), e.Message )); + ScopedVclPtrInstance< MessageDialog > pErrorBox( &GetFrame()->GetWindow(), e.Message ); pErrorBox->Execute( ); } } @@ -353,7 +353,7 @@ void SfxObjectShell::CancelCheckOut( ) } catch ( const uno::RuntimeException& e ) { - boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message)); + ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); } } @@ -364,11 +364,11 @@ void SfxObjectShell::CheckIn( ) { uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW ); // Pop up dialog to ask for comment and major - SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) ); - if ( checkinDlg.Execute( ) == RET_OK ) + ScopedVclPtrInstance< SfxCheckinDialog > checkinDlg(&GetFrame( )->GetWindow( )); + if ( checkinDlg->Execute( ) == RET_OK ) { - OUString sComment = checkinDlg.GetComment( ); - bool bMajor = checkinDlg.IsMajor( ); + OUString sComment = checkinDlg->GetComment( ); + bool bMajor = checkinDlg->IsMajor( ); xCmisDoc->checkIn( bMajor, sComment ); uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY ); if ( xModifiable.is( ) ) @@ -377,7 +377,7 @@ void SfxObjectShell::CheckIn( ) } catch ( const uno::RuntimeException& e ) { - boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message)); + ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); } } @@ -391,7 +391,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( ) } catch ( const uno::RuntimeException& e ) { - boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message)); + ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message); pErrorBox->Execute( ); } return uno::Sequence< document::CmisVersion > ( ); @@ -439,7 +439,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if ( !IsOwnStorageFormat_Impl( *GetMedium() ) ) return; - boost::scoped_ptr<SfxVersionDialog> pDlg(new SfxVersionDialog( pFrame, IsSaveVersionOnClose() )); + ScopedVclPtrInstance< SfxVersionDialog > pDlg( pFrame, IsSaveVersionOnClose() ); pDlg->Execute(); SetSaveVersionOnClose( pDlg->IsSaveVersionOnClose() ); rReq.Done(); @@ -499,7 +499,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) // creating dialog is done via virtual method; application will // add its own statistics page - boost::scoped_ptr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(0, aSet)); + ScopedVclPtr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(0, aSet)); if ( RET_OK == pDlg->Execute() ) { SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pDocInfoItem, SfxDocumentInfoItem, SID_DOCINFO, false); @@ -857,10 +857,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_DOCTEMPLATE: { // save as document templates - SfxTemplateManagerDlg aDlg; - aDlg.setDocumentModel(GetModel()); - aDlg.setSaveMode(); - aDlg.Execute(); + ScopedVclPtrInstance< SfxTemplateManagerDlg > aDlg; + aDlg->setDocumentModel(GetModel()); + aDlg->setSaveMode(); + aDlg->Execute(); break; } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index c609495d1462..d181c628cf5d 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3019,8 +3019,8 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl:: { sMessage += "\n"; sMessage += SfxResId(nResId).toString(); - WarningBox aWBox( pParent, WB_YES_NO | WB_DEF_NO, sMessage ); - nRet = aWBox.Execute(); + ScopedVclPtrInstance< WarningBox > aWBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage); + nRet = aWBox->Execute(); } } diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx index ca30f4563093..7c5d7157607a 100644 --- a/sfx2/source/doc/plugin.cxx +++ b/sfx2/source/doc/plugin.cxx @@ -152,7 +152,7 @@ throw( uno::RuntimeException, std::exception ) if ( SvtMiscOptions().IsPluginsEnabled() ) { vcl::Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - PluginWindow_Impl* pWin = new PluginWindow_Impl( pParent ); + VclPtr<PluginWindow_Impl> pWin = VclPtr<PluginWindow_Impl>::Create( pParent ); pWin->SetSizePixel( pParent->GetOutputSizePixel() ); pWin->SetBackground(); pWin->Show(); diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 1d056eb69900..452f41435a54 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -346,7 +346,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > if ( aPrinterName != pPrinter->GetName() ) { - pPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), aPrinterName ); + pPrinter = VclPtr<SfxPrinter>::Create( pPrinter->GetOptions().Clone(), aPrinterName ); nChangeFlags = SfxPrinterChangeFlags::PRINTER; } break; @@ -477,7 +477,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread { private: /// of course we must know the printer which execute the job - SfxPrinter* m_pPrinter; + VclPtr<SfxPrinter> m_pPrinter; /// this describes the target location for the printed temp file OUString m_sTargetURL; /// it holds the temp file alive, till the print job will finish and remove it from disk automatically if the object die @@ -504,7 +504,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread SolarMutexGuard aGuard; while( m_pPrinter->IsPrinting() ) Application::Yield(); - m_pPrinter = NULL; // don't delete it! It's borrowed only :-) + m_pPrinter.clear(); // don't delete it! It's borrowed only :-) } /* } SAFE */ diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index fee3db0670df..3997e4f5f0e9 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -296,7 +296,12 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent) mpLocalView->Show(); } -SfxTemplateManagerDlg::~SfxTemplateManagerDlg () +SfxTemplateManagerDlg::~SfxTemplateManagerDlg() +{ + disposeOnce(); +} + +void SfxTemplateManagerDlg::dispose() { writeSettings(); @@ -316,6 +321,17 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg () mpSearchView->setItemStateHdl(Link()); mpSearchView->setOpenTemplateHdl(Link()); + + mpTabControl.clear(); + mpSearchEdit.clear(); + mpViewBar.clear(); + mpActionBar.clear(); + mpTemplateBar.clear(); + mpSearchView.clear(); + mpCurView.clear(); + mpLocalView.clear(); + mpRemoteView.clear(); + ModalDialog::dispose(); } void SfxTemplateManagerDlg::setSaveMode() @@ -608,11 +624,11 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu) } else if (nMenuId == MNI_REPOSITORY_NEW) { - PlaceEditDialog dlg(this); + ScopedVclPtrInstance< PlaceEditDialog > dlg(this); - if (dlg.Execute()) + if (dlg->Execute()) { - std::shared_ptr<Place> xPlace = dlg.GetPlace(); + std::shared_ptr<Place> xPlace = dlg->GetPlace(); if (insertRepository(xPlace->GetName(), xPlace->GetUrl())) { @@ -623,7 +639,7 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu) { OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString()); aMsg = aMsg.replaceFirst("$1", xPlace->GetName()); - MessageDialog(this, aMsg).Execute(); + ScopedVclPtrInstance<MessageDialog>(this, aMsg)->Execute(); } } } @@ -1152,16 +1168,16 @@ void SfxTemplateManagerDlg::OnTemplateProperties () { const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin()); - SfxTemplateInfoDlg aDlg; - aDlg.loadDocument(pItem->getPath()); - aDlg.Execute(); + ScopedVclPtrInstance< SfxTemplateInfoDlg > aDlg; + aDlg->loadDocument(pItem->getPath()); + aDlg->Execute(); } void SfxTemplateManagerDlg::OnTemplateDelete () { - MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); + ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if ( aQueryDlg.Execute() != RET_YES ) + if ( aQueryDlg->Execute() != RET_YES ) return; OUString aTemplateList; @@ -1230,13 +1246,13 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault () void SfxTemplateManagerDlg::OnFolderNew() { - InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this); + ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this); - int ret = dlg.Execute(); + int ret = dlg->Execute(); if (ret) { - OUString aName = dlg.getEntryText(); + OUString aName = dlg->getEntryText(); mpCurView->createRegion(aName); } @@ -1244,9 +1260,9 @@ void SfxTemplateManagerDlg::OnFolderNew() void SfxTemplateManagerDlg::OnFolderDelete() { - MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); + ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if ( aQueryDlg.Execute() != RET_YES ) + if ( aQueryDlg->Execute() != RET_YES ) return; OUString aFolderList; @@ -1297,17 +1313,17 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() return; } - InputDialog aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this); + ScopedVclPtrInstance< InputDialog > aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this); - if (aDlg.Execute()) + if (aDlg->Execute()) { - OUString aName = aDlg.getEntryText(); + OUString aName = aDlg->getEntryText(); if (!aName.isEmpty()) { OUString aFolderList; OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString()); - MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); + ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if (mpLocalView->isNonRootRegionVisible()) { @@ -1316,9 +1332,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName)) { aQMsg = aQMsg.replaceFirst("$1",aName); - aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName())); + aQueryDlg->set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName())); - if (aQueryDlg.Execute() == RET_NO) + if (aQueryDlg->Execute() == RET_NO) return; } @@ -1335,9 +1351,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs() if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName)) { OUString aDQMsg = aQMsg.replaceFirst("$1",aName); - aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle)); + aQueryDlg->set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle)); - if (aQueryDlg.Execute() == RET_NO) + if (aQueryDlg->Execute() == RET_NO) continue; } @@ -1403,7 +1419,7 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal) { if (bDisplayLocal) { - mpCurView = mpLocalView; + mpCurView = mpLocalView.get(); mpViewBar->HideItem(VIEWBAR_DELETE); @@ -1416,7 +1432,7 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal) } else { - mpCurView = mpRemoteView; + mpCurView = mpRemoteView.get(); mpViewBar->ShowItem(VIEWBAR_DELETE); @@ -1435,13 +1451,13 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId) if (nMenuId == MNI_MOVE_NEW) { - InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this); + ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this); - int ret = dlg.Execute(); + int ret = dlg->Execute(); if (ret) { - OUString aName = dlg.getEntryText(); + OUString aName = dlg->getEntryText(); if (!aName.isEmpty()) nItemId = mpLocalView->createRegion(aName); @@ -1483,13 +1499,13 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId) if (nMenuId == MNI_MOVE_NEW) { - InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this); + ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this); - int ret = dlg.Execute(); + int ret = dlg->Execute(); if (ret) { - OUString aName = dlg.getEntryText(); + OUString aName = dlg->getEntryText(); if (!aName.isEmpty()) nItemId = mpLocalView->createRegion(aName); @@ -1537,13 +1553,13 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId) if (nMenuId == MNI_MOVE_NEW) { - InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this); + ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this); - int ret = dlg.Execute(); + int ret = dlg->Execute(); if (ret) { - OUString aName = dlg.getEntryText(); + OUString aName = dlg->getEntryText(); if (!aName.isEmpty()) nItemId = mpLocalView->createRegion(aName); |