diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-31 23:04:14 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:40:25 +0100 |
commit | 8a65284fe31e6c0a927cb88b75df7845cd248572 (patch) | |
tree | 0427685579288f412d1890619e8bc224339bb228 /cui | |
parent | d46e0d9656670dcd7dcca2f32062606400ff6246 (diff) |
Automated conversion of VclPtr construction to use Instance template.
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
Diffstat (limited to 'cui')
32 files changed, 67 insertions, 68 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 44228cbd1961..8de41a4531d5 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -2443,7 +2443,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton ) OUString aNewName( stripHotKey( pMenuData->GetName() ) ); OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME ); - VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc )); + VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc ); pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU ); pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) ); @@ -2486,7 +2486,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) OUString aNewName; OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME ); - VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc )); + VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc ); pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU ); pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) ); @@ -2523,7 +2523,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton ) OUString aNewName( stripHotKey( pEntry->GetName() ) ); OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME ); - VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc )); + VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc ); pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM ); pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) ); @@ -2563,9 +2563,8 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton ) { (void)pButton; - VclPtr<SvxMainMenuOrganizerDialog> pDialog( - new SvxMainMenuOrganizerDialog( 0, - GetSaveInData()->GetEntries(), NULL, true )); + VclPtrInstance<SvxMainMenuOrganizerDialog> pDialog( nullptr, + GetSaveInData()->GetEntries(), NULL, true ); if ( pDialog->Execute() == RET_OK ) { @@ -3103,7 +3102,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton ) OUString aNewName( stripHotKey( pToolbar->GetName() ) ); OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME ); - VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc )); + VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc ); pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR ); pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) ); @@ -3189,7 +3188,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton ) OUString aNewName( stripHotKey( pEntry->GetName() ) ); OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME ); - VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc )); + VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc ); pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM ); pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) ); @@ -4356,7 +4355,7 @@ short SvxToolbarConfigPage::QueryReset() OUString label = replaceSaveInName( msg, saveInName ); - ScopedVclPtr<QueryBox> qbox(new QueryBox( this, WB_YES_NO, label )); + ScopedVclPtrInstance< QueryBox > qbox( this, WB_YES_NO, label ); return qbox->Execute(); } @@ -4447,7 +4446,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton ) OUString aNewURL = generateCustomURL( GetSaveInData()->GetEntries() ); - VclPtr<SvxNewToolbarDialog> pNameDialog(new SvxNewToolbarDialog( 0, aNewName )); + VclPtrInstance< SvxNewToolbarDialog > pNameDialog( nullptr, aNewName ); sal_uInt16 nInsertPos; for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i ) @@ -4593,7 +4592,7 @@ void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pDat // in all color modes, like high contrast. const AllSettings& rSettings = Application::GetSettings(); - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; Size aSize( 26, 20 ); pVDev->SetOutputSizePixel( aSize ); @@ -5298,7 +5297,7 @@ void SvxIconSelectorDialog::ImportGraphics( message += newLine; } - ScopedVclPtr<SvxIconChangeDialog> aDialog(new SvxIconChangeDialog(this, message)); + ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message); aDialog->Execute(); } } diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 0dc55dba81f2..a54a29b831be 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -658,7 +658,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* ) ) { - VclPtr<AssignComponentDialog> pAssignDlg(new AssignComponentDialog( pThis, sEventURL )); + VclPtrInstance< AssignComponentDialog > pAssignDlg( pThis, sEventURL ); short ret = pAssignDlg->Execute(); if( ret ) @@ -672,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton* else if( bAssEnabled ) { // assign pressed - VclPtr<SvxScriptSelectorDialog> pDlg(new SvxScriptSelectorDialog( pThis, false, pThis->GetFrame() )); + VclPtrInstance< SvxScriptSelectorDialog > pDlg( pThis, false, pThis->GetFrame() ); if( pDlg ) { short ret = pDlg->Execute(); diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 0cee25dad2db..45d1a9301dfd 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -2055,7 +2055,7 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink ) uno::Any exc( ::cppu::getCaughtException() ); OUString msg( ::comphelper::anyToString( exc ) ); const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg); aErrorBox->SetText(sTitle); aErrorBox->Execute(); } diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 40239ca9b15e..1250e098e6ad 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -143,7 +143,7 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton ) Any exc( ::cppu::getCaughtException() ); OUString msg( ::comphelper::anyToString( exc ) ); const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg); aErrorBox->SetText( GetText() ); aErrorBox->Execute(); } diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 593db194ce85..539c1e5f777b 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -1541,7 +1541,7 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException, std::exception) { - ScopedVclPtr<ColorPickerDialog> aDlg(new ColorPickerDialog( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode )); + ScopedVclPtrInstance< ColorPickerDialog > aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ); sal_Int16 ret = aDlg->Execute(); if( ret ) mnColor = aDlg->GetColor(); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 9811a85b6b07..efa51d3a5a90 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -611,7 +611,7 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl) aStr += pInfo->GetThemeName(); aStr += ")"; - ScopedVclPtr<InfoBox> aBox(new InfoBox( this, aStr )); + ScopedVclPtrInstance< InfoBox > aBox( this, aStr ); aBox->Execute(); m_pLbResName->GrabFocus(); bDifferentThemeExists = true; diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 6d1a69a8b076..9a923816921c 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -761,7 +761,7 @@ namespace svx IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption ) { - ScopedVclPtr<HangulHanjaOptionsDialog> aOptDlg( new HangulHanjaOptionsDialog(this) ); + ScopedVclPtrInstance< HangulHanjaOptionsDialog > aOptDlg(this); aOptDlg->Execute(); m_aOptionsChangedLink.Call( this ); return 0L; @@ -1041,7 +1041,7 @@ namespace svx IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl) { OUString aName; - ScopedVclPtr<HangulHanjaNewDictDialog> aNewDlg( new HangulHanjaNewDictDialog(this) ); + ScopedVclPtrInstance< HangulHanjaNewDictDialog > aNewDlg(this); aNewDlg->Execute(); if( aNewDlg->GetName( aName ) ) { @@ -1077,7 +1077,7 @@ namespace svx DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" ); if( pEntry ) { - ScopedVclPtr<HangulHanjaEditDictDialog> aEdDlg( new HangulHanjaEditDictDialog(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()) ); + ScopedVclPtrInstance< HangulHanjaEditDictDialog > aEdDlg(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()); aEdDlg->Execute(); } return 0L; diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 85e7f27fd7ce..6a623476f6e4 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -271,7 +271,7 @@ bool SvxHyperlinkNewDocTp::AskApply() bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject ); if ( !bRet ) { - ScopedVclPtr<WarningBox> aWarning(new WarningBox( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ) ); + ScopedVclPtrInstance< WarningBox > aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ); aWarning->Execute(); } return bRet; diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index d341bc6e142b..9260c684cfac 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -333,7 +333,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl) bool bIsInputEnabled = GetParent()->IsInputEnabled(); if ( bIsInputEnabled ) GetParent()->EnableInput( false ); - ScopedVclPtr<SfxMacroAssignDlg> aDlg(new SfxMacroAssignDlg( this, mxDocumentFrame, *pItemSet )); + ScopedVclPtrInstance< SfxMacroAssignDlg > aDlg( this, mxDocumentFrame, *pItemSet ); // add events SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() ); diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 5a83bbe4192f..123f04c41989 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -444,7 +444,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton ) if( !xLink.Is() ) return 0; - ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() )); + ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() ); if( RET_YES == aBox->Execute() ) { @@ -475,7 +475,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton ) } else { - ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() )); + ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() ); if( RET_YES == aBox->Execute() ) { diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx index eade758348a5..1b47dda9aa79 100644 --- a/cui/source/dialogs/passwdomdlg.cxx +++ b/cui/source/dialogs/passwdomdlg.cxx @@ -112,7 +112,7 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1); if (nMismatch > 0) { - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch); aErrorBox->Execute(); Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED; diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 0727f440c121..28c97b211848 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -922,7 +922,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) bValid = false; OUString aError( m_createErrStr ); aError += m_createDupStr; - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError); aErrorBox->SetText( m_createErrTitleStr ); aErrorBox->Execute(); xNewDlg->SetObjectName( aNewName ); @@ -1004,7 +1004,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) { //ISSUE L10N & message from exception? OUString aError( m_createErrStr ); - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError); aErrorBox->SetText( m_createErrTitleStr ); aErrorBox->Execute(); } @@ -1080,7 +1080,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) { //ISSUE L10N & message from exception? OUString aError( m_renameErrStr ); - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError); aErrorBox->SetText( m_renameErrTitleStr ); aErrorBox->Execute(); } @@ -1091,7 +1091,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry ) Reference< browse::XBrowseNode > node = getBrowseNode( pEntry ); // ISSUE L10N string & can we centre list? OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 ); - VclPtr<MessageDialog> aQueryBox(new MessageDialog(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + VclPtrInstance< MessageDialog > aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); aQueryBox->SetText( m_delQueryTitleStr ); if ( aQueryBox->Execute() == RET_NO ) { @@ -1126,7 +1126,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry ) else { //ISSUE L10N & message from exception? - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), m_delErrStr)); + ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr); aErrorBox->SetText( m_delErrTitleStr ); aErrorBox->Execute(); } diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx index 2d179a307794..cdf2ed91d22b 100644 --- a/cui/source/factory/init.cxx +++ b/cui/source/factory/init.cxx @@ -28,7 +28,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(vcl::Window* i_pParent, const vcl::Font& i_rFont, OUString& o_rResult) { bool bRet = false; - VclPtr<SvxCharacterMap> aDlg(new SvxCharacterMap( i_pParent )); + VclPtrInstance< SvxCharacterMap > aDlg( i_pParent ); aDlg->DisableFontSelection(); aDlg->SetCharFont(i_rFont); if ( aDlg->Execute() == RET_OK ) diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 2170afbac74b..aa90f37c9ae6 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -278,7 +278,7 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl) SvTreeListEntry* pEntry = pPathBox->FirstSelected(); if ( pEntry ) { - ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance< MessageDialog > aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( aQuery->Execute() == RET_YES ) pPathBox->GetModel()->Remove(pEntry); } @@ -414,7 +414,7 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry) { - ScopedVclPtr<ODocumentLinkDialog> aDlg(new ODocumentLinkDialog(this,_pEntry == NULL)); + ScopedVclPtrInstance< ODocumentLinkDialog > aDlg(this,_pEntry == nullptr); aDlg->setLink(_sOldName,_sOldLocation); aDlg->setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) ); diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx index 3a5aa6758bf1..52e03509b068 100644 --- a/cui/source/options/doclinkdialog.cxx +++ b/cui/source/options/doclinkdialog.cxx @@ -130,7 +130,7 @@ namespace svx { OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST); sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText()); - ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg)); + ScopedVclPtrInstance< MessageDialog > aError(this, sMsg); aError->Execute(); return 0L; } // if (!bFileExists) @@ -139,7 +139,7 @@ namespace svx { OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE); sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText()); - ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg)); + ScopedVclPtrInstance< MessageDialog > aError(this, sMsg); aError->Execute(); return 0L; } @@ -151,7 +151,7 @@ namespace svx { OUString sMsg = CUI_RES(STR_NAME_CONFLICT); sMsg = sMsg.replaceFirst("$file$", sCurrentText); - ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg, VCL_MESSAGE_INFO)); + ScopedVclPtrInstance< MessageDialog > aError(this, sMsg, VCL_MESSAGE_INFO); aError->Execute(); m_pName->SetSelection(Selection(0,sCurrentText.getLength())); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 852d0272ca6d..59ba76fd614a 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -553,8 +553,8 @@ void ColorConfigWindow_Impl::CreateEntries() long nCheckBoxLabelOffset = 0; { OUString sSampleText("X"); - ScopedVclPtr<CheckBox> aCheckBox(new CheckBox(this)); - ScopedVclPtr<FixedText> aFixedText(new FixedText(this)); + ScopedVclPtrInstance< CheckBox > aCheckBox(this); + ScopedVclPtrInstance< FixedText > aFixedText(this); aCheckBox->SetText(sSampleText); aFixedText->SetText(sSampleText); Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff)); @@ -628,7 +628,7 @@ void ColorConfigWindow_Impl::SetAppearance () OSL_ENSURE( vEntries.size() >= sizeof vEntryInfo / sizeof vEntryInfo[0], "wrong number of helpIDs for color listboxes" ); // creating a sample color listbox with the color entries - ScopedVclPtr<ColorListBox> aSampleColorList(new ColorListBox(this)); + ScopedVclPtrInstance< ColorListBox > aSampleColorList(this); { XColorListRef const xColorTable = XColorList::CreateStdColorList(); for (sal_Int32 i = 0; i != xColorTable->Count(); ++i) @@ -1205,7 +1205,7 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton ) else { DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme"); - ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance< MessageDialog > aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); aQuery->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE)); if(RET_YES == aQuery->Execute()) { diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 10620f302705..5c25b4de3615 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -477,7 +477,7 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) if ( nLang != nOldLang ) { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); OUString sTxt(aBox->get_primary_text()); sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() ); aBox->set_primary_text(sTxt); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 24bfe053914a..e33ee969dee3 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1356,7 +1356,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString)); Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges(); // display info - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO)); + ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO); aBox->Execute(); // tell quickstarter to stop being a veto listener diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index f7758fae2abe..ee3e99a04b43 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -706,7 +706,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl) } else { - ScopedVclPtr<QueryBox> aQuery(new QueryBox( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr )); + ScopedVclPtrInstance< QueryBox > aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr ); sal_uInt16 nRet = aQuery->Execute(); if( RET_YES == nRet ) @@ -803,7 +803,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl) if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) ) { - ScopedVclPtr<svx::WebConnectionInfoDialog> aDlg( new svx::WebConnectionInfoDialog(this) ); + ScopedVclPtrInstance< svx::WebConnectionInfoDialog > aDlg(this); aDlg->Execute(); } } @@ -822,7 +822,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, CertPathPBHdl) if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory()) { - ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO)); + ScopedVclPtrInstance< MessageDialog > aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO); aWarnBox->Execute(); } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index c088d48df621..3e050b12873d 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -336,7 +336,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl) (void)eErr; if ( bRunning ) { - ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO )); + ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ); aWarnBox->Execute(); } } @@ -381,7 +381,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl) (void)eErr; if ( bRunning ) { - ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO )); + ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ); aWarnBox->Execute(); } } @@ -437,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt ) IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl ) { - ScopedVclPtr<CuiAboutConfigTabPage> m_pExpertConfigDlg( new CuiAboutConfigTabPage(this) ); + ScopedVclPtrInstance< CuiAboutConfigTabPage > m_pExpertConfigDlg(this); m_pExpertConfigDlg->Reset();//initialize and reset function if( RET_OK == m_pExpertConfigDlg->Execute() ) @@ -630,12 +630,12 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder ) } else if ( JFW_E_NOT_RECOGNIZED == eErr ) { - ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) )); + ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) ); aErrBox->Execute(); } else if ( JFW_E_FAILED_VERSION == eErr ) { - ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) )); + ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) ); aErrBox->Execute(); } diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 4ad9c3879284..48a326be2a5e 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1596,7 +1596,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) pLinguData = new SvxLinguData_Impl; SvxLinguData_Impl aOldLinguData( *pLinguData ); - ScopedVclPtr<SvxEditModulesDlg> aDlg(new SvxEditModulesDlg( this, *pLinguData )); + ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData ); if (aDlg->Execute() != RET_OK) *pLinguData = aOldLinguData; @@ -1745,7 +1745,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) if(aData.HasNumericValue()) { sal_uInt16 nRID = aData.GetEntryId(); - ScopedVclPtr<OptionsBreakSet> aDlg( new OptionsBreakSet(this, nRID) ); + ScopedVclPtrInstance< OptionsBreakSet > aDlg(this, nRID); aDlg->GetNumericFld().SetValue( aData.GetNumericValue() ); if (RET_OK == aDlg->Execute() ) { diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index fd029b6ed287..9304c364e38f 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -312,7 +312,7 @@ IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit) void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag) { - ScopedVclPtr<ListEntryDialog> aDlg(new ListEntryDialog(pTabPage, rEntry, rTag)); + ScopedVclPtrInstance< ListEntryDialog > aDlg(pTabPage, rEntry, rTag); if (aDlg->Execute() == RET_OK) rEntry = aDlg->maEntry; diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 6b61f7890e8e..eeabbcdeb84e 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -476,7 +476,7 @@ void SvxPersonalizationTabPage::LoadExtensionThemes() IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ ) { - ScopedVclPtr<SelectPersonaDialog> aDialog( new SelectPersonaDialog(NULL) ); + ScopedVclPtrInstance< SelectPersonaDialog > aDialog(nullptr); if ( aDialog->Execute() == RET_OK ) { diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 5e592b7ae942..0d8b428c0261 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -731,7 +731,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl) if( nSelEntryPos == REPLACE_BULLETS || nSelEntryPos == APPLY_NUMBERING) { - ScopedVclPtr<SvxCharacterMap> pMapDlg(new SvxCharacterMap(this)); + ScopedVclPtrInstance< SvxCharacterMap > pMapDlg(this); ImpUserData* pUserData = (ImpUserData*)m_pCheckLB->FirstSelected()->GetUserData(); pMapDlg->SetCharFont(*pUserData->pFont); pMapDlg->SetChar( (*pUserData->pString)[0] ); @@ -748,7 +748,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl) else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos ) { // dialog for per cent settings - ScopedVclPtr<OfaAutoFmtPrcntSet> aDlg(new OfaAutoFmtPrcntSet(this)); + ScopedVclPtrInstance< OfaAutoFmtPrcntSet > aDlg(this); aDlg->GetPrcntFld().SetValue(nPercent); if(RET_OK == aDlg->Execute()) { @@ -2061,7 +2061,7 @@ IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn ) else if (pBtn == m_pDblEndQuotePB) nMode = DBL_END; // start character selection dialog - ScopedVclPtr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true )); + ScopedVclPtrInstance< SvxCharacterMap > pMap( this, true ); pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 )); pMap->SetText(nMode < SGL_END ? m_sStartQuoteDlg : m_sEndQuoteDlg ); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 16f0038986dc..fd8e5dd0904c 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3446,7 +3446,7 @@ void SvxCharTwoLinesPage::Initialize() void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox ) { bool bStart = pBox == m_pStartBracketLB; - VclPtr<SvxCharacterMap> aDlg(new SvxCharacterMap( this )); + VclPtrInstance< SvxCharacterMap > aDlg( this ); aDlg->DisableFontSelection(); if ( aDlg->Execute() == RET_OK ) diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 7fefce57d8a5..9d1a6626b0ac 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -699,7 +699,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) // display original size const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() ); - ScopedVclPtr<MetricField> aFld(new MetricField(this, WB_HIDE)); + ScopedVclPtrInstance< MetricField > aFld(this, WB_HIDE); SetFieldUnit( *aFld.get(), eMetric ); aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() ); aFld->SetMax( LONG_MAX - 1 ); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 267083656c52..5e7ee8706f84 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -2095,7 +2095,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl) IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl) { - VclPtr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true )); + VclPtrInstance< SvxCharacterMap > pMap( this, true ); sal_uInt16 nMask = 1; const vcl::Font* pFmtFont = 0; @@ -2379,7 +2379,7 @@ void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ ) const Color aBackColor = rStyleSettings.GetFieldColor(); const Color aTextColor = rStyleSettings.GetFieldTextColor(); - ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice(*this)); + ScopedVclPtrInstance< VirtualDevice > pVDev(*this); pVDev->EnableRTL( IsRTLEnabled() ); pVDev->SetMapMode(GetMapMode()); pVDev->SetOutputSize( aSize ); diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index fb789dcf02f9..315ad1bdfdf2 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -747,7 +747,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" )); + ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" ); if( aQueryBox->Execute() == RET_YES ) { diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index ff323782ec3d..ff8d23a850af 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -872,7 +872,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui")); + ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui"); if( aQueryBox->Execute() == RET_YES ) { diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index daec497a531b..36a33184c3cc 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -608,7 +608,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui")); + ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui"); if ( aQueryBox->Execute() == RET_YES ) { diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 800c18bd77ac..cf939b82b004 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -645,7 +645,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui")); + ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui"); if( aQueryBox->Execute() == RET_YES ) { diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 94a616c8eb17..79ec9d3ad198 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -360,7 +360,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton) if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList) { - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; pVDev->SetMapMode(MapMode(MAP_100TH_MM)); boost::scoped_ptr<SdrModel> pModel(new SdrModel); pModel->GetItemPool().FreezeIdRanges(); @@ -1155,7 +1155,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) } else if(nSymType >= 0) { - ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() ); + ScopedVclPtrInstance< VirtualDevice > pVDev; pVDev->SetMapMode(MapMode(MAP_100TH_MM)); boost::scoped_ptr<SdrModel> pModel(new SdrModel); |