diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-30 21:49:04 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:14:06 +0100 |
commit | f59c489e642059fc060054222505b544893a3873 (patch) | |
tree | 209b80fed954b3ef2287ec20435cd590148dcc3f | |
parent | c7f3e599da3f4adf0c8cfe6e087948dc8f61bcce (diff) |
Convert more sites to VclPtrInstance.
Change-Id: I364c5eb176d5003deb1938810cccf4f2aaedbd59
-rw-r--r-- | vcl/qa/cppunit/lifecycle.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/dbggui.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/map.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 3 |
6 files changed, 17 insertions, 15 deletions
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx index 7c1b1c220f48..cbe0ef62b096 100644 --- a/vcl/qa/cppunit/lifecycle.cxx +++ b/vcl/qa/cppunit/lifecycle.cxx @@ -68,8 +68,8 @@ void LifecycleTest::testVirtualDevice() void LifecycleTest::testMultiDispose() { - VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL, - WB_APP|WB_STDWORK)); + VclPtrInstance<WorkWindow> xWin((vcl::Window *)NULL, + WB_APP|WB_STDWORK); CPPUNIT_ASSERT(xWin.get() != NULL); xWin->disposeOnce(); xWin->disposeOnce(); @@ -122,8 +122,8 @@ public: void LifecycleTest::testChildDispose() { - VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL, - WB_APP|WB_STDWORK)); + VclPtrInstance<WorkWindow> xWin((vcl::Window *)NULL, + WB_APP|WB_STDWORK); CPPUNIT_ASSERT(xWin.get() != NULL); VclPtr<DisposableChild> xChild(new DisposableChild(xWin.get())); xWin->Show(); diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index f3ebc74b2ea0..7d099d6598d9 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -354,9 +354,9 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton ) } if( (aData.nTestFlags & ~IMMEDIATE_FLAGS) != (pData->nTestFlags & ~IMMEDIATE_FLAGS) ) { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, OUString( + ScopedVclPtrInstance<MessageDialog> aBox(this, OUString( "Some of the changed settings will only be active after " - "restarting the process"), VCL_MESSAGE_INFO)); + "restarting the process"), VCL_MESSAGE_INFO); aBox->Execute(); } EndDialog( RET_OK ); diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 2ea36cc68183..f66c139754b5 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1155,10 +1155,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, Point aDstPtPix( aBoundRect.TopLeft() ); Size aDstSzPix; - ScopedVclPtr<VirtualDevice> aMapVDev( new VirtualDevice() ); // here, we record only mapmode information + ScopedVclPtrInstance<VirtualDevice> aMapVDev; // here, we record only mapmode information aMapVDev->EnableOutput(false); - ScopedVclPtr<VirtualDevice> aPaintVDev( new VirtualDevice() ); // into this one, we render. + ScopedVclPtrInstance<VirtualDevice> aPaintVDev; // into this one, we render. aPaintVDev->SetBackground( aBackgroundComponent.aBgColor ); rOutMtf.AddAction( new MetaPushAction( PushFlags::MAPMODE ) ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index b5e78453ea4c..d3f5211a2705 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -305,8 +305,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, { if (xController->isShowDialogs()) { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoPrinterDialog", - "vcl/ui/errornoprinterdialog.ui")); + ScopedVclPtrInstance<MessageDialog> aBox( + nullptr, "ErrorNoPrinterDialog", + "vcl/ui/errornoprinterdialog.ui"); aBox->Execute(); } xController->setValue( OUString( "IsDirect" ), @@ -454,8 +455,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, { if( xController->getFilteredPageCount() == 0 ) { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoContentDialog", - "vcl/ui/errornocontentdialog.ui")); + ScopedVclPtrInstance<MessageDialog> aBox( + nullptr, "ErrorNoContentDialog", + "vcl/ui/errornocontentdialog.ui"); aBox->Execute(); return; } diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 753e2977e72a..e7eed8872143 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -232,9 +232,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, vcl::Window::ImplInitAppFontData( pSVData->maWinData.mpFirstFrame ); else { - VclPtr<WorkWindow> pWin = new WorkWindow( NULL, 0 ); + ScopedVclPtrInstance<WorkWindow> pWin( nullptr, 0 ); vcl::Window::ImplInitAppFontData( pWin ); - pWin.disposeAndClear(); } } rMapRes.mnMapScNumX = pSVData->maGDIData.mnAppFontX; diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 7a4bd3d2b917..e6cb65a8559c 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1770,6 +1770,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c SAL_WARN_IF(!pWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function"); if (pWindow) { + VclPtr< Window > xWindow( pWindow, SAL_NO_ACQUIRE ); pWindow->SetHelpId(m_sHelpRoot + id); SAL_INFO("vcl.layout", "for " << name.getStr() << ", created " << pWindow << " child of " << @@ -1777,7 +1778,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c pWindow->mpWindowImpl->mpRealParent.get() << "/" << pWindow->mpWindowImpl->mpBorderWindow.get() << ") with helpid " << pWindow->GetHelpId().getStr()); - m_aChildren.push_back(WinAndId(id, pWindow, bVertical)); + m_aChildren.push_back(WinAndId(id, xWindow, bVertical)); } return pWindow; } |