diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-20 15:35:54 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-20 15:35:54 +0100 |
commit | 4fed8865be56ac431fb91e2432c6e93ce3f781c7 (patch) | |
tree | 67b0982f8910bc8bfbc92cb6245520a26f6366dc /vcl/workben | |
parent | f12488405cdfd8555078d15807aafc5ffd1b037b (diff) |
vcl: convert new to ::Create
Change-Id: Ifd52953086ea923fa1770892d13f32c2263aec54
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/icontest.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/mtfdemo.cxx | 2 | ||||
-rw-r--r-- | vcl/workben/svpclient.cxx | 8 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 10 |
4 files changed, 12 insertions, 12 deletions
diff --git a/vcl/workben/icontest.cxx b/vcl/workben/icontest.cxx index 8562feb214f6..cef8ac6755c8 100644 --- a/vcl/workben/icontest.cxx +++ b/vcl/workben/icontest.cxx @@ -186,12 +186,12 @@ void IconTestApp::DoItWithVcl( const OUString& sImageFile) { try { - MyWorkWindow *pWindow = new MyWorkWindow( NULL, WB_APP | WB_STDWORK | WB_SIZEABLE | WB_CLOSEABLE | WB_CLIPCHILDREN ); + VclPtrInstance<MyWorkWindow> pWindow( nullptr, WB_APP | WB_STDWORK | WB_SIZEABLE | WB_CLOSEABLE | WB_CLIPCHILDREN ); pWindow->SetText(OUString("VCL Image Test")); pWindow->LoadGraphic( sImageFile ); - pWindow->mpFixedBitmap = new FixedBitmap( pWindow ); + pWindow->mpFixedBitmap = VclPtr<FixedBitmap>::Create( pWindow ); pWindow->mpFixedBitmap->SetPosPixel( Point( 0, 0 ) ); pWindow->mpFixedBitmap->Show(); diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx index 54c64ffadf4a..05ab64430972 100644 --- a/vcl/workben/mtfdemo.cxx +++ b/vcl/workben/mtfdemo.cxx @@ -88,7 +88,7 @@ public: { try { - mpWin = new DemoMtfWin(maFileName); + mpWin = VclPtr<DemoMtfWin>::Create(maFileName); mpWin->SetText(OUString("Display metafile")); mpWin->Show(); diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index 428cfa7dbc6e..01ad3e9d5f08 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -130,10 +130,10 @@ void Main() MyWin::MyWin( vcl::Window* pParent, WinBits nWinStyle ) : WorkWindow( pParent, nWinStyle ), - m_aListButton(new PushButton(this, 0)), - m_aSvpBitmaps(new ListBox(this, WB_BORDER)), - m_aImage(new ImageControl(this, WB_BORDER)), - m_aQuitButton(new PushButton(this, 0)) + m_aListButton(VclPtr<PushButton>::Create(this, 0)), + m_aSvpBitmaps(VclPtr<ListBox>::Create(this, WB_BORDER)), + m_aImage(VclPtr<ImageControl>::Create(this, WB_BORDER)), + m_aQuitButton(VclPtr<PushButton>::Create(this, 0)) { m_aListButton->SetPosSizePixel( Point( 10, 10 ), Size( 120, 25 ) ); m_aListButton->SetText( OUString( "List Elements" ) ); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 33682e17df13..4f42f9353445 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -777,9 +777,9 @@ public: ScopedVclPtr<VirtualDevice> pNested; if ((int)eType < RENDER_AS_BITMAPEX) - pNested = new VirtualDevice(rDev); + pNested = VclPtr<VirtualDevice>::Create(rDev).get(); else - pNested = new VirtualDevice(rDev,0,0); + pNested = VclPtr<VirtualDevice>::Create(rDev,0,0).get(); pNested->SetOutputSizePixel(r.GetSize()); Rectangle aWhole(Point(0,0), r.GetSize()); @@ -1230,8 +1230,8 @@ bool DemoRenderer::MouseButtonDown(const MouseEvent& rMEvt) // otherwise bounce floating windows if (!mpButton) { - mpButtonWin = new FloatingWindow(this); - mpButton = new PushButton(mpButtonWin); + mpButtonWin = VclPtr<FloatingWindow>::Create(this); + mpButton = VclPtr<PushButton>::Create(mpButtonWin); mpButton->SetSymbol(SymbolType::HELP); mpButton->SetText("PushButton demo"); mpButton->SetPosSizePixel(Point(0,0), mpButton->GetOptimalSize()); @@ -1406,7 +1406,7 @@ public: } else { // spawn another window - DemoWin *pNewWin = new DemoWin(mrRenderer, testThreads); + VclPtrInstance<DemoWin> pNewWin(mrRenderer, testThreads); pNewWin->SetText("Another interactive VCL demo window"); pNewWin->Show(); } |