summaryrefslogtreecommitdiff
path: root/svx/workben/pixelctl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/workben/pixelctl.cxx')
-rw-r--r--svx/workben/pixelctl.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/svx/workben/pixelctl.cxx b/svx/workben/pixelctl.cxx
index 09cb0201c6b1..591e0011f9a9 100644
--- a/svx/workben/pixelctl.cxx
+++ b/svx/workben/pixelctl.cxx
@@ -79,11 +79,12 @@ SAL_IMPLEMENT_MAIN()
class MyWin : public WorkWindow
{
- SvxPixelCtl maPixelCtl;
+ VclPtr<SvxPixelCtl> maPixelCtl;
public:
MyWin( vcl::Window* pParent, WinBits nWinStyle );
-
+ virtual ~MyWin() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -97,20 +98,26 @@ public:
void Main()
{
- MyWin aMainWin( NULL, WB_STDWORK );
- aMainWin.SetText( OUString( "SvxPixelCtl" ) );
- aMainWin.Show();
+ ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_STDWORK );
+ aMainWin->SetText( OUString( "SvxPixelCtl" ) );
+ aMainWin->Show();
Application::Execute();
}
MyWin::MyWin( vcl::Window* pParent, WinBits nWinStyle ) :
WorkWindow( pParent, nWinStyle ),
- maPixelCtl( this )
+ maPixelCtl( VclPtr<SvxPixelCtl>::Create(this) )
{
- maPixelCtl.SetPosSizePixel( Point( 10, 10 ), Size( 200, 200 ) );
- maPixelCtl.Show();
+ maPixelCtl->SetPosSizePixel( Point( 10, 10 ), Size( 200, 200 ) );
+ maPixelCtl->Show();
+
+}
+void MyWin::dispose()
+{
+ maPixelCtl.disposeAndClear();
+ WorkWindow::dispose();
}
bool MyWin::Close()