diff options
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/btndlg.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/clipping.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/dockwin.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 32 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/openglwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/tabdlg.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/wrkwin.cxx | 2 |
17 files changed, 48 insertions, 46 deletions
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index 3acbad51932d..2e8532cecba7 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -81,13 +81,13 @@ PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags ) if ( nBtnFlags & BUTTONDIALOG_DEFBUTTON ) nStyle |= WB_DEFBUTTON; if ( nBtnFlags & BUTTONDIALOG_CANCELBUTTON ) - pBtn = new CancelButton( this, nStyle ); + pBtn = VclPtr<CancelButton>::Create( this, nStyle ); else if ( nBtnFlags & BUTTONDIALOG_OKBUTTON ) - pBtn = new OKButton( this, nStyle ); + pBtn = VclPtr<OKButton>::Create( this, nStyle ); else if ( nBtnFlags & BUTTONDIALOG_HELPBUTTON ) - pBtn = new HelpButton( this, nStyle ); + pBtn = VclPtr<HelpButton>::Create( this, nStyle ); else - pBtn = new PushButton( this, nStyle ); + pBtn = VclPtr<PushButton>::Create( this, nStyle ); if ( !(nBtnFlags & BUTTONDIALOG_HELPBUTTON) ) pBtn->SetClickHdl( LINK( this, ButtonDialog, ImplClickHdl ) ); diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 0e11542000c4..38efc376c7ef 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -842,7 +842,7 @@ void Window::ImplSaveOverlapBackground() if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE ) { Size aOutSize( mnOutWidth, mnOutHeight ); - mpWindowImpl->mpOverlapData->mpSaveBackDev = new VirtualDevice( *mpWindowImpl->mpFrameWindow ); + mpWindowImpl->mpOverlapData->mpSaveBackDev = VclPtr<VirtualDevice>::Create( *mpWindowImpl->mpFrameWindow ); if ( mpWindowImpl->mpOverlapData->mpSaveBackDev->SetOutputSizePixel( aOutSize ) ) { mpWindowImpl->mpFrameWindow->ImplUpdateAll(); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 54fb42dc508c..9e6d4bf12dae 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -403,7 +403,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle ) // create window with a small border ? if ( (nStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE)) == WB_BORDER ) { - ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, nStyle, BORDERWINDOW_STYLE_FRAME ); + VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle, BORDERWINDOW_STYLE_FRAME ); SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); @@ -421,7 +421,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle ) } else { - ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, nStyle, BORDERWINDOW_STYLE_OVERLAP | BORDERWINDOW_STYLE_BORDER ); + VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle, BORDERWINDOW_STYLE_OVERLAP | BORDERWINDOW_STYLE_BORDER ); SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index c5726af5bd40..aaf84270d803 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -860,7 +860,7 @@ bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) if ( mpFloatWin ) pWin = mpFloatWin; else - pWin = new ImplDockFloatWin2( mpParent, mnFloatBits, NULL ); + pWin = VclPtr<ImplDockFloatWin2>::Create( mpParent, mnFloatBits, nullptr ); pWin->GetBorder( mnDockLeft, mnDockTop, mnDockRight, mnDockBottom ); if ( !mpFloatWin ) pWin.disposeAndClear(); @@ -1116,7 +1116,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLon mpOldBorderWin = NULL; // no border window found // the new parent for popup mode - ImplPopupFloatWin* pWin = new ImplPopupFloatWin( mpParent, this, (nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) != 0 ); + VclPtrInstance<ImplPopupFloatWin> pWin( mpParent, this, (nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) != 0 ); pWin->SetPopupModeEndHdl( LINK( this, ImplDockingWindowWrapper, PopupModeEnd ) ); pWin->SetText( GetWindow()->GetText() ); @@ -1225,7 +1225,8 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) mpOldBorderWin = NULL; // no border window found ImplDockFloatWin2* pWin = - new ImplDockFloatWin2( + VclPtr<ImplDockFloatWin2>::Create( + mpParent, mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ? mnFloatBits | WB_SYSTEMWINDOW diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 6cc6301730b2..d6ed20d672da 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -268,7 +268,7 @@ bool DockingWindow::ImplStartDocking( const Point& rPos ) if ( mpFloatWin ) pWin = mpFloatWin; else - pWin = new ImplDockFloatWin( mpImplData->mpParent, mnFloatBits, NULL ); + pWin = VclPtr<ImplDockFloatWin>::Create( mpImplData->mpParent, mnFloatBits, nullptr ); pWin->GetBorder( mnDockLeft, mnDockTop, mnDockRight, mnDockBottom ); if ( !mpFloatWin ) pWin.disposeAndClear(); @@ -801,7 +801,8 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) mpOldBorderWin = mpWindowImpl->mpBorderWindow; ImplDockFloatWin* pWin = - new ImplDockFloatWin( + VclPtr<ImplDockFloatWin>::Create( + mpImplData->mpParent, mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ? mnFloatBits | WB_SYSTEMWINDOW : mnFloatBits, this ); diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 3b41ab0d4b53..65a5ef452458 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -107,7 +107,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle ) nBorderStyle |= BORDERWINDOW_STYLE_FRAME; nStyle |= WB_CLOSEABLE; // make undecorated floaters closeable } - pBorderWin = new ImplBorderWindow( pParent, nStyle, nBorderStyle ); + pBorderWin = VclPtr<ImplBorderWindow>::Create( pParent, nStyle, nBorderStyle ); SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 309a8b72d34c..cb983d5a7a1b 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1627,9 +1627,9 @@ IMPL_LINK( VclExpander, ClickHdl, DisclosureButton*, pBtn ) VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent, WinBits nStyle) : VclBin(pParent, nStyle) , m_bUserManagedScrolling(false) - , m_pVScroll(new ScrollBar(this, WB_HIDE | WB_VERT)) - , m_pHScroll(new ScrollBar(this, WB_HIDE | WB_HORZ)) - , m_aScrollBarBox(new ScrollBarBox(this, WB_HIDE)) + , m_pVScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_VERT)) + , m_pHScroll(VclPtr<ScrollBar>::Create(this, WB_HIDE | WB_HORZ)) + , m_aScrollBarBox(VclPtr<ScrollBarBox>::Create(this, WB_HIDE)) { SetType(WINDOW_SCROLLWINDOW); @@ -1975,10 +1975,10 @@ bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue) void MessageDialog::create_owned_areas() { set_border_width(12); - m_pOwnedContentArea.set(new VclVBox(this, false, 24)); + m_pOwnedContentArea.set(VclPtr<VclVBox>::Create(this, false, 24)); set_content_area(m_pOwnedContentArea); m_pOwnedContentArea->Show(); - m_pOwnedActionArea.set( new VclHButtonBox(m_pOwnedContentArea) ); + m_pOwnedActionArea.set( VclPtr<VclHButtonBox>::Create(m_pOwnedContentArea) ); set_action_area(m_pOwnedActionArea); m_pOwnedActionArea->Show(); } @@ -2134,12 +2134,12 @@ short MessageDialog::Execute() VclContainer *pContainer = get_content_area(); assert(pContainer); - m_pGrid.set( new VclGrid(pContainer) ); + m_pGrid.set( VclPtr<VclGrid>::Create(pContainer) ); m_pGrid->reorderWithinParent(0); m_pGrid->set_column_spacing(12); m_pGrid->set_row_spacing(GetTextHeight()); - m_pImage = new FixedImage(m_pGrid, WB_CENTER | WB_VCENTER | WB_3DLOOK); + m_pImage = VclPtr<FixedImage>::Create(m_pGrid, WB_CENTER | WB_VCENTER | WB_3DLOOK); switch (m_eMessageType) { case VCL_MESSAGE_INFO: @@ -2164,7 +2164,7 @@ short MessageDialog::Execute() bool bHasSecondaryText = !m_sSecondaryString.isEmpty(); - m_pPrimaryMessage = new VclMultiLineEdit(m_pGrid, nWinStyle); + m_pPrimaryMessage = VclPtr<VclMultiLineEdit>::Create(m_pGrid, nWinStyle); m_pPrimaryMessage->SetPaintTransparent(true); m_pPrimaryMessage->EnableCursor(false); @@ -2174,7 +2174,7 @@ short MessageDialog::Execute() m_pPrimaryMessage->SetText(m_sPrimaryString); m_pPrimaryMessage->Show(!m_sPrimaryString.isEmpty()); - m_pSecondaryMessage = new VclMultiLineEdit(m_pGrid, nWinStyle); + m_pSecondaryMessage = VclPtr<VclMultiLineEdit>::Create(m_pGrid, nWinStyle); m_pSecondaryMessage->SetPaintTransparent(true); m_pSecondaryMessage->EnableCursor(false); m_pSecondaryMessage->set_grid_left_attach(1); @@ -2194,33 +2194,33 @@ short MessageDialog::Execute() case VCL_BUTTONS_NONE: break; case VCL_BUTTONS_OK: - pBtn.set( new OKButton(pButtonBox) ); + pBtn.set( VclPtr<OKButton>::Create(pButtonBox) ); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_OK; break; case VCL_BUTTONS_CLOSE: - pBtn.set( new CloseButton(pButtonBox) ); + pBtn.set( VclPtr<CloseButton>::Create(pButtonBox) ); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_CLOSE; break; case VCL_BUTTONS_CANCEL: - pBtn.set( new CancelButton(pButtonBox) ); + pBtn.set( VclPtr<CancelButton>::Create(pButtonBox) ); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_CANCEL; break; case VCL_BUTTONS_YES_NO: - pBtn = new PushButton(pButtonBox); + pBtn = VclPtr<PushButton>::Create(pButtonBox); pBtn->SetText(Button::GetStandardText(StandardButtonType::Yes)); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_YES; - pBtn.set( new PushButton(pButtonBox) ); + pBtn.set( VclPtr<PushButton>::Create(pButtonBox) ); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); pBtn->SetText(Button::GetStandardText(StandardButtonType::No)); pBtn->Show(); @@ -2228,12 +2228,12 @@ short MessageDialog::Execute() m_aResponses[pBtn] = RET_NO; break; case VCL_BUTTONS_OK_CANCEL: - pBtn.set( new OKButton(pButtonBox) ); + pBtn.set( VclPtr<OKButton>::Create(pButtonBox) ); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); m_aResponses[pBtn] = RET_OK; - pBtn.set( new CancelButton(pButtonBox) ); + pBtn.set( VclPtr<CancelButton>::Create(pButtonBox) ); pBtn->SetStyle(pBtn->GetStyle() & WB_DEFBUTTON); pBtn->Show(); m_aOwnedButtons.push_back(pBtn); diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 7323c14460d3..40a254547698 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2505,7 +2505,7 @@ vcl::Window* MenuBar::ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, Men MenuBarWindow *pMenuBarWindow = dynamic_cast<MenuBarWindow*>(pWindow); if (!pMenuBarWindow) { - pWindow = pMenuBarWindow = new MenuBarWindow( pParent ); + pWindow = pMenuBarWindow = VclPtr<MenuBarWindow>::Create( pParent ); } pMenu->pStartedFrom = 0; @@ -2929,7 +2929,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_ CreateAutoMnemonics(); } - MenuFloatingWindow* pWin = new MenuFloatingWindow( this, pW, nStyle | WB_SYSTEMWINDOW ); + VclPtrInstance<MenuFloatingWindow> pWin( this, pW, nStyle | WB_SYSTEMWINDOW ); if( pSVData->maNWFData.mbFlatMenu ) pWin->SetBorderStyle( WindowBorderStyle::NOBORDER ); else diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 7c0bca777f06..47f61ad6829d 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -119,9 +119,9 @@ void DecoToolBox::SetImages( long nMaxHeight, bool bForce ) MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) : Window( pParent, 0 ), - aCloseBtn(new DecoToolBox(this)), - aFloatBtn(new PushButton( this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE )), - aHideBtn(new PushButton(this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE )) + aCloseBtn(VclPtr<DecoToolBox>::Create(this)), + aFloatBtn(VclPtr<PushButton>::Create( this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE )), + aHideBtn(VclPtr<PushButton>::Create(this, WB_NOPOINTERFOCUS | WB_SMALLSTYLE | WB_RECTSTYLE )) { SetType( WINDOW_MENUBARWINDOW ); pMenu = NULL; diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index a96011be5cd9..9f2fd75973c7 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -231,7 +231,7 @@ void MessBox::ImplPosControls() aImageSize.Width() += 4; aImageSize.Height() += 4; aTextPos.X() += aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE; - mpFixedImage = new FixedImage( this ); + mpFixedImage = VclPtr<FixedImage>::Create( this ); mpFixedImage->SetPosSizePixel( Point( IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_X, IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_Y ), aImageSize ); @@ -321,7 +321,7 @@ void MessBox::ImplPosControls() } } - mpCheckBox = new CheckBox( this ); + mpCheckBox = VclPtr<CheckBox>::Create( this ); mpCheckBox->Check( mbCheck ); mpCheckBox->SetText( aMnemonicString ); mpCheckBox->SetStyle( mpCheckBox->GetStyle() | WB_WORDBREAK ); @@ -343,7 +343,7 @@ void MessBox::ImplPosControls() mpCheckBox->Show(); } - mpVCLMultiLineEdit = new VclMultiLineEdit( this, nWinStyle ); + mpVCLMultiLineEdit = VclPtr<VclMultiLineEdit>::Create( this, nWinStyle ); mpVCLMultiLineEdit->SetText( aMessText ); mpVCLMultiLineEdit->SetPosSizePixel( aTextPos, aMEditSize ); mpVCLMultiLineEdit->Show(); diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx index bb7ef2723cdb..1ef46dabc828 100644 --- a/vcl/source/window/openglwin.cxx +++ b/vcl/source/window/openglwin.cxx @@ -25,7 +25,7 @@ private: OpenGLWindowImpl::OpenGLWindowImpl(vcl::Window* pWindow) { SystemWindowData aData = OpenGLContext::generateWinData(pWindow, false); - mxChildWindow.reset(new SystemChildWindow(pWindow, 0, &aData)); + mxChildWindow.reset(VclPtr<SystemChildWindow>::Create(pWindow, 0, &aData)); mxChildWindow->Show(); maContext.init(mxChildWindow.get()); pWindow->SetMouseTransparent(false); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index f173ad36915d..f24755d92904 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -64,11 +64,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeShowNupOrderWindow(vcl PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent ) : Window( i_pParent, 0 ) , maOrigSize( 10, 10 ) - , maPageVDev( new VirtualDevice(*this) ) + , maPageVDev( VclPtr<VirtualDevice>::Create(*this) ) , maToolTipString(VclResId( SV_PRINT_PRINTPREVIEW_TXT).toString()) , mbGreyscale( false ) - , maHorzDim(new FixedLine(this, WB_HORZ | WB_CENTER)) - , maVertDim(new FixedLine(this, WB_VERT | WB_VCENTER)) + , maHorzDim(VclPtr<FixedLine>::Create(this, WB_HORZ | WB_CENTER)) + , maVertDim(VclPtr<FixedLine>::Create(this, WB_VERT | WB_VCENTER)) { SetPaintTransparent( true ); SetBackground(); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 0cfbbaa5b4c8..7f43c18e2b1a 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -123,7 +123,7 @@ void StatusBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) // remember WinBits mpItemList = new ImplStatusItemList; - mpImplData->mpVirDev = new VirtualDevice( *this ); + mpImplData->mpVirDev = VclPtr<VirtualDevice>::Create( *this ); mnCurItemId = 0; mbFormat = true; mbVisibleItems = true; diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 3f317677ea06..e5c9061389e3 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -197,7 +197,7 @@ void TabDialog::ImplPosControls() { Size aDlgSize = GetOutputSizePixel(); if ( !mpFixedLine ) - mpFixedLine = new FixedLine( this ); + mpFixedLine = VclPtr<FixedLine>::Create( this ); mpFixedLine->SetPosSizePixel( Point( 0, nOffY ), Size( aDlgSize.Width(), 2 ) ); mpFixedLine->Show(); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1ec060b59372..b596026331fc 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -904,7 +904,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p nBorderTypeStyle |= BORDERWINDOW_STYLE_FRAME; nStyle |= WB_BORDER; } - ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle ); + VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, nStyle & (WB_BORDER | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_NEEDSFOCUS), nBorderTypeStyle ); ((vcl::Window*)pBorderWin)->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); mpWindowImpl->mpBorderWindow = pBorderWin; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index cf8fd3f930a0..bd64654f2e4b 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -457,7 +457,7 @@ void Window::StartAutoScroll( sal_uInt16 nFlags ) pSVData->maWinData.mpAutoScrollWin = this; pSVData->maWinData.mnAutoScrollFlags = nFlags; - pSVData->maAppData.mpWheelWindow = new ImplWheelWindow( this ); + pSVData->maAppData.mpWheelWindow = VclPtr<ImplWheelWindow>::Create( this ); } void Window::EndAutoScroll() diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index cdd4be98f6cf..136adc859d84 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -49,7 +49,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat if ( nStyle & WB_APP ) nFrameStyle |= BORDERWINDOW_STYLE_APP; - ImplBorderWindow* pBorderWin = new ImplBorderWindow( pParent, pSystemParentData, nStyle, nFrameStyle ); + VclPtrInstance<ImplBorderWindow> pBorderWin( pParent, pSystemParentData, nStyle, nFrameStyle ); Window::ImplInit( pBorderWin, nStyle & (WB_3DLOOK | WB_CLIPCHILDREN | WB_DIALOGCONTROL | WB_SYSTEMFLOATWIN), NULL ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); |