diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-17 17:53:05 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-17 17:53:05 +0200 |
commit | d8ebd9044177e1269c8c81c4c0e3ff53d875247a (patch) | |
tree | f919736414decd3e217af3463d2fa66953d3eb36 /sfx2 | |
parent | 3f5733216541c5b1e9d86861812a7a857703740c (diff) |
sfx2: convert new to ::Create.
Change-Id: I53f95a65702c144ba4c4b0caac1e172015fec0fa
Diffstat (limited to 'sfx2')
34 files changed, 93 insertions, 93 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 2c6d1613b7e1..1f25c87ba802 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1903,15 +1903,15 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : Window( pParent, WB_CLIPCHILDREN | WB_TABSTOP | WB_DIALOGCONTROL ), - aToolBox ( new ToolBox(this, 0) ), - aOnStartupCB ( new CheckBox(this, SfxResId( RID_HELP_ONSTARTUP_BOX )) ), + aToolBox ( VclPtr<ToolBox>::Create(this, 0) ), + aOnStartupCB ( VclPtr<CheckBox>::Create(this, SfxResId( RID_HELP_ONSTARTUP_BOX )) ), aIndexOnImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_ON ) ), aIndexOffImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_OFF ) ), aIndexOnText ( SfxResId( STR_HELP_BUTTON_INDEX_ON ).toString() ), aIndexOffText ( SfxResId( STR_HELP_BUTTON_INDEX_OFF ).toString() ), aOnStartupText ( SfxResId( RID_HELP_ONSTARTUP_TEXT ).toString() ), pHelpWin ( pParent ), - pTextWin ( new TextWin_Impl( this ) ), + pTextWin ( VclPtr<TextWin_Impl>::Create( this ) ), pSrchDlg ( NULL ), nMinPos ( 0 ), bIsDebug ( false ), @@ -2668,7 +2668,7 @@ void SfxHelpTextWindow_Impl::DoSearch() if ( !pSrchDlg ) { // create the search dialog - pSrchDlg = new sfx2::SearchDialog( pTextWin, "HelpSearchDialog" ); + pSrchDlg = VclPtr<sfx2::SearchDialog>::Create( pTextWin, "HelpSearchDialog" ); // set handler pSrchDlg->SetFindHdl( LINK( this, SfxHelpTextWindow_Impl, FindHdl ) ); pSrchDlg->SetCloseHdl( LINK( this, SfxHelpTextWindow_Impl, CloseHdl ) ); @@ -3055,12 +3055,12 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( SetStyle( GetStyle() | WB_DIALOGCONTROL ); pHelpInterceptor->InitWaiter( this ); - pIndexWin = new SfxHelpIndexWindow_Impl( this ); + pIndexWin = VclPtr<SfxHelpIndexWindow_Impl>::Create( this ); pIndexWin->SetDoubleClickHdl( LINK( this, SfxHelpWindow_Impl, OpenHdl ) ); pIndexWin->SetSelectFactoryHdl( LINK( this, SfxHelpWindow_Impl, SelectFactoryHdl ) ); pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MAP_APPFONT)); pIndexWin->Show(); - pTextWin = new SfxHelpTextWindow_Impl( this ); + pTextWin = VclPtr<SfxHelpTextWindow_Impl>::Create( this ); Reference < XFrames > xFrames = rFrame->getFrames(); xFrames->append( Reference<XFrame>(pTextWin->getFrame(), UNO_QUERY_THROW) ); pTextWin->SetSelectHdl( LINK( this, SfxHelpWindow_Impl, SelectHdl ) ); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 45ceb3007468..add82d178f9b 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -353,7 +353,7 @@ ContentTabPage_Impl* SfxHelpIndexWindow_Impl::GetContentPage() { if ( !pCPage ) { - pCPage = new ContentTabPage_Impl( m_pTabCtrl, this ); + pCPage = VclPtr<ContentTabPage_Impl>::Create( m_pTabCtrl, this ); pCPage->SetOpenHdl( aPageDoubleClickLink ); } return pCPage; @@ -362,7 +362,7 @@ IndexTabPage_Impl* SfxHelpIndexWindow_Impl::GetIndexPage() { if ( !pIPage ) { - pIPage = new IndexTabPage_Impl( m_pTabCtrl, this ); + pIPage = VclPtr<IndexTabPage_Impl>::Create( m_pTabCtrl, this ); pIPage->SetDoubleClickHdl( aPageDoubleClickLink ); pIPage->SetKeywordHdl( aIndexKeywordLink ); } @@ -373,7 +373,7 @@ SearchTabPage_Impl* SfxHelpIndexWindow_Impl::GetSearchPage() { if ( !pSPage ) { - pSPage = new SearchTabPage_Impl( m_pTabCtrl, this ); + pSPage = VclPtr<SearchTabPage_Impl>::Create( m_pTabCtrl, this ); pSPage->SetDoubleClickHdl( aPageDoubleClickLink ); } return pSPage; @@ -383,7 +383,7 @@ BookmarksTabPage_Impl* SfxHelpIndexWindow_Impl::GetBookmarksPage() { if ( !pBPage ) { - pBPage = new BookmarksTabPage_Impl( m_pTabCtrl, this ); + pBPage = VclPtr<BookmarksTabPage_Impl>::Create( m_pTabCtrl, this ); pBPage->SetDoubleClickHdl( aPageDoubleClickLink ); } return pBPage; diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 2298469fb5b5..d6ec61c5ff3c 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -569,7 +569,7 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( vcl::Window *pWin, SfxFrame *pFrm, S n == SFX_SPLITWINDOWS_RIGHT ? SfxChildAlignment::RIGHT : n == SFX_SPLITWINDOWS_TOP ? SfxChildAlignment::TOP : SfxChildAlignment::BOTTOM ); - SfxSplitWindow *pSplitWin = new SfxSplitWindow(pWorkWin, eAlign, this, pParent==0 ); + VclPtr<SfxSplitWindow> pSplitWin = VclPtr<SfxSplitWindow>::Create(pWorkWin, eAlign, this, pParent==0 ); pSplit[n] = pSplitWin; } diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 2452f7277db7..408fccb50059 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -128,8 +128,8 @@ bool ViewFilter_Keyword::operator ()(const ThumbnailViewItem *pItem) TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren) : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren), mnCurRegionId(0), - maAllButton(new PushButton(this, SfxResId(BTN_ALL_TEMPLATES))), - maFTName(new FixedText(this, SfxResId(FT_NAME))) + maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))), + maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME))) { maAllButton->Hide(); maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON); @@ -140,8 +140,8 @@ TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinSt TemplateAbstractView::TemplateAbstractView(vcl::Window *pParent) : ThumbnailView(pParent), mnCurRegionId(0), - maAllButton(new PushButton(this, SfxResId(BTN_ALL_TEMPLATES))), - maFTName(new FixedText(this, SfxResId(FT_NAME))) + maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))), + maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME))) { maAllButton->Hide(); maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index ad20376d39c4..8c6a30e60d0b 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -236,7 +236,7 @@ void ThumbnailView::ImplInitScrollBar() { if ( !mpScrBar ) { - mpScrBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG ); + mpScrBar = VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG ); mpScrBar->SetScrollHdl( LINK( this, ThumbnailView, ImplScrollHdl ) ); } else diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index ccaebb12107a..c6543906639c 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -112,7 +112,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId) , mpTitleED(NULL) , maTextEditMaxArea() { - mpTitleED = new ResizableMultiLineEdit(&rView, this); + mpTitleED = VclPtr<ResizableMultiLineEdit>::Create(&rView, this); } ThumbnailViewItem::~ThumbnailViewItem() diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index ff6b506d3de8..f11d9ffac79d 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -719,8 +719,8 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno // create the component window vcl::Window* pParent = VCLUnoHelper::GetWindow(xParentWindow); - vcl::Window* pWindow = new BackingWindow(pParent); - m_xWindow = VCLUnoHelper::GetInterface(pWindow); + VclPtr<vcl::Window> pWindow = VclPtr<BackingWindow>::Create(pParent); + m_xWindow = VCLUnoHelper::GetInterface(pWindow); if (!m_xWindow.is()) throw css::uno::RuntimeException( diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 0122bbd9f88b..a40f6522c054 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -642,7 +642,7 @@ void SfxDocumentDescPage::dispose() SfxTabPage *SfxDocumentDescPage::Create(vcl::Window *pParent, const SfxItemSet *rItemSet) { - return new SfxDocumentDescPage(pParent, *rItemSet); + return VclPtr<SfxDocumentDescPage>::Create(pParent, *rItemSet); } @@ -945,7 +945,7 @@ void SfxDocumentPage::ImplCheckPasswordState() SfxTabPage* SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet ) { - return new SfxDocumentPage( pParent, *rItemSet ); + return VclPtr<SfxDocumentPage>::Create( pParent, *rItemSet ); } void SfxDocumentPage::EnableUseUserData() @@ -1222,8 +1222,8 @@ void SfxDocumentInfoDialog::AddFontTabPage() CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent, const ResId& rResId ) : Control( pParent, rResId ), - m_aYesButton( new RadioButton(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ), - m_aNoButton ( new RadioButton(this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() )) ) + m_aYesButton( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ), + m_aNoButton ( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() )) ) { FreeResource(); Wallpaper aWall( Color( COL_TRANSPARENT ) ); @@ -1391,16 +1391,16 @@ void CustomPropertiesYesNoButton::Resize() // struct CustomPropertyLine --------------------------------------------- CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : - m_aNameBox ( new ComboBox(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ), - m_aTypeBox ( new CustomPropertiesTypeBox(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ), - m_aValueEdit ( new CustomPropertiesEdit(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ), - m_aDateField ( new CustomPropertiesDateField(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ), - m_aTimeField ( new CustomPropertiesTimeField(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ), + m_aNameBox ( VclPtr<ComboBox>::Create(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ), + m_aTypeBox ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ), + m_aValueEdit ( VclPtr<CustomPropertiesEdit>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ), + m_aDateField ( VclPtr<CustomPropertiesDateField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ), + m_aTimeField ( VclPtr<CustomPropertiesTimeField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ), m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT ).toString() ), - m_aDurationField( new CustomPropertiesDurationField(pParent, WB_BORDER|WB_TABSTOP|WB_READONLY, this ) ), - m_aEditButton ( new CustomPropertiesEditButton(pParent, WB_TABSTOP, this) ), - m_aYesNoButton ( new CustomPropertiesYesNoButton(pParent, SfxResId( SFX_WIN_PROPERTY_YESNO )) ), - m_aRemoveButton ( new CustomPropertiesRemoveButton(pParent, 0, this) ), + m_aDurationField( VclPtr<CustomPropertiesDurationField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_READONLY, this ) ), + m_aEditButton ( VclPtr<CustomPropertiesEditButton>::Create(pParent, WB_TABSTOP, this) ), + m_aYesNoButton ( VclPtr<CustomPropertiesYesNoButton>::Create(pParent, SfxResId( SFX_WIN_PROPERTY_YESNO )) ), + m_aRemoveButton ( VclPtr<CustomPropertiesRemoveButton>::Create(pParent, 0, this) ), m_bIsDate ( false ), m_bIsRemoved ( false ), m_bTypeLostFocus( false ) @@ -1438,15 +1438,15 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent, m_pHeaderAccName(pHeaderAccName), m_pHeaderAccType(pHeaderAccType), m_pHeaderAccValue(pHeaderAccValue), - m_aNameBox ( new ComboBox( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ), - m_aTypeBox ( new ListBox( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ), - m_aValueEdit ( new Edit( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ), - m_aDateField ( new DateField( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), - m_aTimeField ( new TimeField( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), - m_aDurationField( new Edit( this, WB_BORDER|WB_TABSTOP|WB_READONLY ) ), - m_aEditButton ( new PushButton( this, WB_TABSTOP ) ), - m_aYesNoButton ( new CustomPropertiesYesNoButton( this, SfxResId( SFX_WIN_PROPERTY_YESNO )) ), - m_aRemoveButton ( new ImageButton( this, 0 ) ), + m_aNameBox ( VclPtr<ComboBox>::Create( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ), + m_aTypeBox ( VclPtr<ListBox>::Create( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ), + m_aValueEdit ( VclPtr<Edit>::Create( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ), + m_aDateField ( VclPtr<DateField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), + m_aTimeField ( VclPtr<TimeField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ), + m_aDurationField( VclPtr<Edit>::Create( this, WB_BORDER|WB_TABSTOP|WB_READONLY ) ), + m_aEditButton ( VclPtr<PushButton>::Create( this, WB_TABSTOP ) ), + m_aYesNoButton ( VclPtr<CustomPropertiesYesNoButton>::Create( this, SfxResId( SFX_WIN_PROPERTY_YESNO )) ), + m_aRemoveButton ( VclPtr<ImageButton>::Create( this, 0 ) ), m_nScrollPos (0), m_pCurrentLine (NULL), m_aNumberFormatter( ::comphelper::getProcessComponentContext(), @@ -2050,17 +2050,17 @@ CustomPropertiesControl::CustomPropertiesControl(vcl::Window* pParent) void CustomPropertiesControl::Init(VclBuilderContainer& rBuilder) { - m_pVBox = new VclVBox(this); - m_pHeaderBar = new HeaderBar(m_pVBox, WB_BUTTONSTYLE | WB_BOTTOMBORDER); - m_pBody = new VclHBox(m_pVBox); + m_pVBox = VclPtr<VclVBox>::Create(this); + m_pHeaderBar = VclPtr<HeaderBar>::Create(m_pVBox, WB_BUTTONSTYLE | WB_BOTTOMBORDER); + m_pBody = VclPtr<VclHBox>::Create(m_pVBox); FixedText* pName = rBuilder.get<FixedText>("name"); FixedText* pType = rBuilder.get<FixedText>("type"); FixedText* pValue = rBuilder.get<FixedText>("value"); OUString sName = pName->GetText(); OUString sType = pType->GetText(); OUString sValue = pValue->GetText(); - m_pPropertiesWin = new CustomPropertiesWindow(m_pBody, pName, pType, pValue); - m_pVertScroll = new ScrollBar(m_pBody, WB_VERT); + m_pPropertiesWin = VclPtr<CustomPropertiesWindow>::Create(m_pBody, pName, pType, pValue); + m_pVertScroll = VclPtr<ScrollBar>::Create(m_pBody, WB_VERT); set_hexpand(true); set_vexpand(true); @@ -2276,7 +2276,7 @@ int SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) SfxTabPage* SfxCustomPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet ) { - return new SfxCustomPropertiesPage( pParent, *rItemSet ); + return VclPtr<SfxCustomPropertiesPage>::Create( pParent, *rItemSet ); } CmisValue::CmisValue( vcl::Window* pParent, const OUString& aStr ) @@ -2772,7 +2772,7 @@ int SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ ) SfxTabPage* SfxCmisPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet ) { - return new SfxCmisPropertiesPage( pParent, *rItemSet ); + return VclPtr<SfxCmisPropertiesPage>::Create( pParent, *rItemSet ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index a69ac5b73b91..0ad3e754ca40 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -130,7 +130,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd , uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); const OUString aDockWindowResourceURL( "private:resource/dockingwindow/" ); - SfxTitleDockingWindow* pTitleDockWindow = new SfxTitleDockingWindow( pBindings, this, pParentWnd, + VclPtr<SfxTitleDockingWindow> pTitleDockWindow = VclPtr<SfxTitleDockingWindow>::Create( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); pWindow = pTitleDockWindow; eChildAlignment = SfxChildAlignment::NOALIGNMENT; diff --git a/sfx2/source/dialog/documentfontsdialog.cxx b/sfx2/source/dialog/documentfontsdialog.cxx index c326e1122e13..dc434a3a2528 100644 --- a/sfx2/source/dialog/documentfontsdialog.cxx +++ b/sfx2/source/dialog/documentfontsdialog.cxx @@ -25,7 +25,7 @@ using namespace ::com::sun::star; SfxTabPage* SfxDocumentFontsPage::Create( vcl::Window* parent, const SfxItemSet* set ) { - return new SfxDocumentFontsPage( parent, *set ); + return VclPtr<SfxDocumentFontsPage>::Create( parent, *set ); } SfxDocumentFontsPage::SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSet& set ) diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index a9ce3eeb6a35..2bf43410a487 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -118,8 +118,8 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId, const OUString& sMessage) : Window(pParent, 0), m_sId(sId), - m_pMessage(new FixedText(this, 0)), - m_pCloseBtn(new SfxCloseButton(this)), + m_pMessage(VclPtr<FixedText>::Create(this, 0)), + m_pCloseBtn(VclPtr<SfxCloseButton>::Create(this)), m_aActionBtns() { sal_Int32 nScaleFactor = GetDPIScaleFactor(); @@ -327,7 +327,7 @@ SfxInfoBarContainerChild::SfxInfoBarContainerChild( vcl::Window* _pParent, sal_u SfxChildWindow(_pParent, nId), m_pBindings(pBindings) { - pWindow = new SfxInfoBarContainerWindow(this); + pWindow = VclPtr<SfxInfoBarContainerWindow>::Create(this); pWindow->SetPosSizePixel(Point(0, 0), Size(_pParent->GetSizePixel().getWidth(), 0)); pWindow->Show(); diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index fa98cff6c08c..6db9e8e55421 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -582,7 +582,7 @@ SfxTabPage* SfxManageStyleSheetPage::Create( vcl::Window* pParent, */ { - return new SfxManageStyleSheetPage( pParent, *rAttrSet ); + return VclPtr<SfxManageStyleSheetPage>::Create( pParent, *rAttrSet ); } diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index 48a30206b94c..98870a6981f1 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -34,7 +34,7 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( vcl::Window* pParentWnd , SfxChildWinInfo* pInfo ) : SfxChildWindow( pParentWnd , nId ) { - pWindow = new SfxNavigator( pBindings, this, pParentWnd, + pWindow = VclPtr<SfxNavigator>::Create( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); eChildAlignment = SfxChildAlignment::NOALIGNMENT; diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index e4aa3bcedce0..d3f26dc748cb 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -59,7 +59,7 @@ IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rInPool ) : ModalDialog(pParent, "CreateStyleDialog", "sfx/ui/newstyle.ui") - , aQueryOverwriteBox(new MessageDialog(this, SfxResId(STR_QUERY_OVERWRITE), + , aQueryOverwriteBox(VclPtr<MessageDialog>::Create(this, SfxResId(STR_QUERY_OVERWRITE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)) , rPool(rInPool) { diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx index 0292b83640f9..f16288d4a1c7 100644 --- a/sfx2/source/dialog/partwnd.cxx +++ b/sfx2/source/dialog/partwnd.cxx @@ -59,7 +59,7 @@ SfxPartChildWnd_Impl::SfxPartChildWnd_Impl : SfxChildWindow( pParentWnd, nId ) { // Create Window - pWindow = new SfxPartDockWnd_Impl( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK ); + pWindow = VclPtr<SfxPartDockWnd_Impl>::Create( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK ); eChildAlignment = SfxChildAlignment::TOP; assert(pInfo); diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index 0c00b345bb5b..da1a4770912d 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -117,7 +117,7 @@ void SfxCommonPrintOptionsTabPage::dispose() SfxTabPage* SfxCommonPrintOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet ) { - return( new SfxCommonPrintOptionsTabPage( pParent, *rAttrSet ) ); + return( VclPtr<SfxCommonPrintOptionsTabPage>::Create( pParent, *rAttrSet ) ); } vcl::Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const vcl::Window* pWindow ) const diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 7ba862eaeb93..742aa883900a 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -131,7 +131,7 @@ SfxRecordingFloatWrapper_Impl::SfxRecordingFloatWrapper_Impl( vcl::Window* pPare : SfxChildWindow( pParentWnd, nId ) , pBindings( pBind ) { - pWindow = new SfxRecordingFloat_Impl( pBindings, this, pParentWnd ); + pWindow = VclPtr<SfxRecordingFloat_Impl>::Create( pBindings, this, pParentWnd ); SetWantsFocus( false ); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( pInfo ); diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index e80212d4e345..897b201d47b7 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -422,7 +422,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl) SfxTabPage* SfxSecurityPage::Create( vcl::Window * pParent, const SfxItemSet * rItemSet ) { - return new SfxSecurityPage( pParent, *rItemSet ); + return VclPtr<SfxSecurityPage>::Create( pParent, *rItemSet ); } diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 7372a8c6465f..a8c75ba43f09 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -237,7 +237,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl, } SetAlign (eTbxAlign); - pEmptyWin = new SfxEmptySplitWin_Impl( this ); + pEmptyWin = VclPtr<SfxEmptySplitWin_Impl>::Create( this ); if ( bPinned ) { pEmptyWin->bFadeIn = true; diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index cba80496e162..9e1846d45727 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -450,31 +450,31 @@ void SfxTabDialog::Init_Impl(bool bFmtFlag) m_pOKBtn = m_pUIBuilder->get<PushButton>("ok"); m_bOwnsOKBtn = m_pOKBtn == nullptr; if (m_bOwnsOKBtn) - m_pOKBtn = new OKButton(m_pActionArea); + m_pOKBtn = VclPtr<OKButton>::Create(m_pActionArea); m_pApplyBtn = m_pUIBuilder->get<PushButton>("apply"); m_pUserBtn = m_pUIBuilder->get<PushButton>("user"); m_pCancelBtn = m_pUIBuilder->get<CancelButton>("cancel"); m_bOwnsCancelBtn = m_pCancelBtn == nullptr; if (m_bOwnsCancelBtn) - m_pCancelBtn = new CancelButton(m_pActionArea); + m_pCancelBtn = VclPtr<CancelButton>::Create(m_pActionArea); m_pHelpBtn = m_pUIBuilder->get<HelpButton>("help"); m_bOwnsHelpBtn = m_pHelpBtn == nullptr; if (m_bOwnsHelpBtn) - m_pHelpBtn = new HelpButton(m_pActionArea); + m_pHelpBtn = VclPtr<HelpButton>::Create(m_pActionArea); m_pResetBtn = m_pUIBuilder->get<PushButton>("reset"); m_bOwnsResetBtn = m_pResetBtn == nullptr; if (m_bOwnsResetBtn) - m_pResetBtn = new PushButton(m_pActionArea.get()); + m_pResetBtn = VclPtr<PushButton>::Create(m_pActionArea.get()); else pImpl->bHideResetBtn = !m_pResetBtn->IsVisible(); m_pBaseFmtBtn = m_pUIBuilder->get<PushButton>("standard"); m_bOwnsBaseFmtBtn = m_pBaseFmtBtn == nullptr; if (m_bOwnsBaseFmtBtn) - m_pBaseFmtBtn = new PushButton(m_pActionArea.get()); + m_pBaseFmtBtn = VclPtr<PushButton>::Create(m_pActionArea.get()); m_pOKBtn->SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) ); m_pCancelBtn->SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) ); diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 9750f6c3717b..e782af1cd985 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -202,7 +202,7 @@ namespace sfx2 TaskPaneDockingWindow::TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper, vcl::Window* i_pParent, WinBits i_nBits ) :TitledDockingWindow( i_pBindings, &i_rWrapper, i_pParent, i_nBits ) - ,m_aTaskPane( new ModuleTaskPane(GetContentWindow(), lcl_getFrame( i_pBindings )) ) + ,m_aTaskPane( VclPtr<ModuleTaskPane>::Create(GetContentWindow(), lcl_getFrame( i_pBindings )) ) ,m_aPaneController( *m_aTaskPane.get(), *this ) { m_aTaskPane->Show(); @@ -249,7 +249,7 @@ namespace sfx2 TaskPaneWrapper::TaskPaneWrapper( vcl::Window* i_pParent, sal_uInt16 i_nId, SfxBindings* i_pBindings, SfxChildWinInfo* i_pInfo ) :SfxChildWindow( i_pParent, i_nId ) { - pWindow = new TaskPaneDockingWindow( i_pBindings, *this, i_pParent, + pWindow = VclPtr<TaskPaneDockingWindow>::Create( i_pBindings, *this, i_pParent, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); eChildAlignment = SfxChildAlignment::RIGHT; diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx index 68c52d300074..df195c8efdb2 100644 --- a/sfx2/source/dialog/templateinfodlg.cxx +++ b/sfx2/source/dialog/templateinfodlg.cxx @@ -38,7 +38,7 @@ SfxTemplateInfoDlg::SfxTemplateInfoDlg (vcl::Window *pParent) get(mpBtnClose, "close"); get(mpBox, "box"); get(mpInfoView, "infoDrawingArea"); - mpPreviewView = new vcl::Window(mpBox.get()); + mpPreviewView = VclPtr<vcl::Window>::Create(mpBox.get()); Size aSize(LogicToPixel(Size(250, 160), MAP_APPFONT)); mpBox->set_width_request(aSize.Width()); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index b5cd56cdf67f..6f533f8d4bcf 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -546,8 +546,8 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl , xModuleManager(frame::ModuleManager::create(::comphelper::getProcessComponentContext())) , m_pDeletionWatcher(NULL) - , aFmtLb( new SfxActionListBox(this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH) ) - , aFilterLb( new ListBox(pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP) ) + , aFmtLb( VclPtr<SfxActionListBox>::Create(this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH) ) + , aFilterLb( VclPtr<ListBox>::Create(pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP) ) , nActFamily(0xffff) , nActFilter(0) @@ -1512,7 +1512,8 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable) const OUString aSelectEntry( GetSelectedEntry()); aFmtLb->Hide(); - pTreeBox = new StyleTreeListBox_Impl( + pTreeBox = VclPtr<StyleTreeListBox_Impl>::Create( + this, WB_HASBUTTONS | WB_HASLINES | WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_HIDESELECTION | WB_QUICK_SEARCH ); diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index a176cc18b16c..6b3c98945139 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -35,8 +35,8 @@ namespace sfx2 WinBits i_nStyle ) :SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_nStyle ) ,m_sTitle() - ,m_aToolbox( new ToolBox(this) ) - ,m_aContentWindow( new vcl::Window(this, WB_DIALOGCONTROL) ) + ,m_aToolbox( VclPtr<ToolBox>::Create(this) ) + ,m_aContentWindow( VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL) ) ,m_aBorder( 3, 1, 3, 3 ) ,m_bLayoutPending( false ) ,m_nTitleBarHeight(0) diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 11fb35f59a16..81b72cf19bcf 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -213,7 +213,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); - m_pVersionBox = new SfxVersionsTabListBox_Impl(*pContainer, WB_TABSTOP); + m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP); Link aClickLink = LINK( this, SfxVersionDialog, ButtonHdl_Impl ); m_pViewButton->SetClickHdl ( aClickLink ); @@ -548,7 +548,7 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame, bool bIsS pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); - m_pVersionBox = new SfxVersionsTabListBox_Impl(*pContainer, WB_TABSTOP); + m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP); m_pVersionBox->GrabFocus(); m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); 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/objcont.cxx b/sfx2/source/doc/objcont.cxx index e94470c1bdff..0b5d7f6ded61 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -282,13 +282,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); } 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 e5f6b15dd499..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; diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx index 2a78dfa89cfd..876b3730dc4e 100644 --- a/sfx2/source/sidebar/TitleBar.cxx +++ b/sfx2/source/sidebar/TitleBar.cxx @@ -41,7 +41,7 @@ TitleBar::TitleBar ( vcl::Window* pParentWindow, const sidebar::Paint& rInitialBackgroundPaint) : Window(pParentWindow), - maToolBox(new SidebarToolBox(this)), + maToolBox(VclPtr<SidebarToolBox>::Create(this)), msTitle(rsTitle), maIcon() { diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index f03d12ed07a9..390a9c52d241 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -304,7 +304,7 @@ SfxFrame::SfxFrame( vcl::Window& i_rContainerWindow, bool i_bHidden ) InsertTopFrame_Impl( this ); pImp->pExternalContainerWindow = &i_rContainerWindow; - pWindow = new SfxFrameWindow_Impl( this, i_rContainerWindow ); + pWindow = VclPtr<SfxFrameWindow_Impl>::Create( this, i_rContainerWindow ); // always show pWindow, which is the ComponentWindow of the XFrame we live in // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 47f300538a92..ee07c7850f21 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -60,7 +60,7 @@ struct SfxPrintOptDlg_Impl // class SfxPrinter ------------------------------------------------------ -SfxPrinter* SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions ) +VclPtr<SfxPrinter> SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions ) /* [Description] @@ -79,7 +79,7 @@ SfxPrinter* SfxPrinter::Create( SvStream& rStream, SfxItemSet* pOptions ) ReadJobSetup( rStream, aFileJobSetup ); // Get printers - SfxPrinter *pPrinter = new SfxPrinter( pOptions, aFileJobSetup ); + VclPtr<SfxPrinter> pPrinter = VclPtr<SfxPrinter>::Create( pOptions, aFileJobSetup ); return pPrinter; } @@ -166,12 +166,11 @@ SfxPrinter::SfxPrinter( const SfxPrinter& rPrinter ) : -SfxPrinter* SfxPrinter::Clone() const +VclPtr<SfxPrinter> SfxPrinter::Clone() const { if ( IsDefPrinter() ) { - SfxPrinter *pNewPrinter; - pNewPrinter = new SfxPrinter( GetOptions().Clone() ); + VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( GetOptions().Clone() ); pNewPrinter->SetJobSetup( GetJobSetup() ); pNewPrinter->SetPrinterProps( this ); pNewPrinter->SetMapMode( GetMapMode() ); @@ -182,7 +181,7 @@ SfxPrinter* SfxPrinter::Clone() const return pNewPrinter; } else - return new SfxPrinter( *this ); + return VclPtr<SfxPrinter>::Create( *this ); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ca5002a58ffc..e3110e7bd967 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1468,7 +1468,7 @@ SfxViewFrame::SfxViewFrame rFrame.SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE ); Construct_Impl( pObjShell ); - pImp->pWindow = new SfxFrameViewWindow_Impl( this, rFrame.GetWindow() ); + pImp->pWindow = VclPtr<SfxFrameViewWindow_Impl>::Create( this, rFrame.GetWindow() ); pImp->pWindow->SetSizePixel( rFrame.GetWindow().GetOutputSizePixel() ); rFrame.SetOwnsBindings_Impl( true ); rFrame.CreateWorkWindow_Impl(); diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index c44001446c49..2d6f99bf073e 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -384,7 +384,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() ); else { - SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() ); + VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() ); pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() ); mpViewShell->SetPrinter( pNewPrt, SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ); } @@ -591,7 +591,7 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr { OUString aPrinterName; pVal[i].Value >>= aPrinterName; - aPrt.reset( new Printer( aPrinterName ) ); + aPrt.reset( VclPtr<Printer>::Create( aPrinterName ) ); break; } } @@ -770,7 +770,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if ( pPrinterItem ) { // use PrinterName parameter to create a printer - pPrinter = new SfxPrinter( pDocPrinter->GetOptions().Clone(), ((const SfxStringItem*) pPrinterItem)->GetValue() ); + pPrinter = VclPtr<SfxPrinter>::Create( pDocPrinter->GetOptions().Clone(), ((const SfxStringItem*) pPrinterItem)->GetValue() ); // if printer is unknown, it can't be used - now printer from document will be used if ( !pPrinter->IsKnown() ) |