Kaydet (Commit) f59c489e authored tarafından Michael Meeks's avatar Michael Meeks

Convert more sites to VclPtrInstance.

Change-Id: I364c5eb176d5003deb1938810cccf4f2aaedbd59
üst c7f3e599
...@@ -68,8 +68,8 @@ void LifecycleTest::testVirtualDevice() ...@@ -68,8 +68,8 @@ void LifecycleTest::testVirtualDevice()
void LifecycleTest::testMultiDispose() void LifecycleTest::testMultiDispose()
{ {
VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL, VclPtrInstance<WorkWindow> xWin((vcl::Window *)NULL,
WB_APP|WB_STDWORK)); WB_APP|WB_STDWORK);
CPPUNIT_ASSERT(xWin.get() != NULL); CPPUNIT_ASSERT(xWin.get() != NULL);
xWin->disposeOnce(); xWin->disposeOnce();
xWin->disposeOnce(); xWin->disposeOnce();
...@@ -122,8 +122,8 @@ public: ...@@ -122,8 +122,8 @@ public:
void LifecycleTest::testChildDispose() void LifecycleTest::testChildDispose()
{ {
VclPtr<WorkWindow> xWin(new WorkWindow((vcl::Window *)NULL, VclPtrInstance<WorkWindow> xWin((vcl::Window *)NULL,
WB_APP|WB_STDWORK)); WB_APP|WB_STDWORK);
CPPUNIT_ASSERT(xWin.get() != NULL); CPPUNIT_ASSERT(xWin.get() != NULL);
VclPtr<DisposableChild> xChild(new DisposableChild(xWin.get())); VclPtr<DisposableChild> xChild(new DisposableChild(xWin.get()));
xWin->Show(); xWin->Show();
......
...@@ -354,9 +354,9 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton ) ...@@ -354,9 +354,9 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
} }
if( (aData.nTestFlags & ~IMMEDIATE_FLAGS) != (pData->nTestFlags & ~IMMEDIATE_FLAGS) ) 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 " "Some of the changed settings will only be active after "
"restarting the process"), VCL_MESSAGE_INFO)); "restarting the process"), VCL_MESSAGE_INFO);
aBox->Execute(); aBox->Execute();
} }
EndDialog( RET_OK ); EndDialog( RET_OK );
......
...@@ -1155,10 +1155,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, ...@@ -1155,10 +1155,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
Point aDstPtPix( aBoundRect.TopLeft() ); Point aDstPtPix( aBoundRect.TopLeft() );
Size aDstSzPix; 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); 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 ); aPaintVDev->SetBackground( aBackgroundComponent.aBgColor );
rOutMtf.AddAction( new MetaPushAction( PushFlags::MAPMODE ) ); rOutMtf.AddAction( new MetaPushAction( PushFlags::MAPMODE ) );
......
...@@ -305,8 +305,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, ...@@ -305,8 +305,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
{ {
if (xController->isShowDialogs()) if (xController->isShowDialogs())
{ {
ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoPrinterDialog", ScopedVclPtrInstance<MessageDialog> aBox(
"vcl/ui/errornoprinterdialog.ui")); nullptr, "ErrorNoPrinterDialog",
"vcl/ui/errornoprinterdialog.ui");
aBox->Execute(); aBox->Execute();
} }
xController->setValue( OUString( "IsDirect" ), xController->setValue( OUString( "IsDirect" ),
...@@ -454,8 +455,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, ...@@ -454,8 +455,9 @@ void Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController,
{ {
if( xController->getFilteredPageCount() == 0 ) if( xController->getFilteredPageCount() == 0 )
{ {
ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, "ErrorNoContentDialog", ScopedVclPtrInstance<MessageDialog> aBox(
"vcl/ui/errornocontentdialog.ui")); nullptr, "ErrorNoContentDialog",
"vcl/ui/errornocontentdialog.ui");
aBox->Execute(); aBox->Execute();
return; return;
} }
......
...@@ -232,9 +232,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, ...@@ -232,9 +232,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
vcl::Window::ImplInitAppFontData( pSVData->maWinData.mpFirstFrame ); vcl::Window::ImplInitAppFontData( pSVData->maWinData.mpFirstFrame );
else else
{ {
VclPtr<WorkWindow> pWin = new WorkWindow( NULL, 0 ); ScopedVclPtrInstance<WorkWindow> pWin( nullptr, 0 );
vcl::Window::ImplInitAppFontData( pWin ); vcl::Window::ImplInitAppFontData( pWin );
pWin.disposeAndClear();
} }
} }
rMapRes.mnMapScNumX = pSVData->maGDIData.mnAppFontX; rMapRes.mnMapScNumX = pSVData->maGDIData.mnAppFontX;
......
...@@ -1770,6 +1770,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c ...@@ -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"); SAL_WARN_IF(!pWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function");
if (pWindow) if (pWindow)
{ {
VclPtr< Window > xWindow( pWindow, SAL_NO_ACQUIRE );
pWindow->SetHelpId(m_sHelpRoot + id); pWindow->SetHelpId(m_sHelpRoot + id);
SAL_INFO("vcl.layout", "for " << name.getStr() << SAL_INFO("vcl.layout", "for " << name.getStr() <<
", created " << pWindow << " child of " << ", created " << pWindow << " child of " <<
...@@ -1777,7 +1778,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c ...@@ -1777,7 +1778,7 @@ vcl::Window *VclBuilder::makeObject(vcl::Window *pParent, const OString &name, c
pWindow->mpWindowImpl->mpRealParent.get() << "/" << pWindow->mpWindowImpl->mpRealParent.get() << "/" <<
pWindow->mpWindowImpl->mpBorderWindow.get() << ") with helpid " << pWindow->mpWindowImpl->mpBorderWindow.get() << ") with helpid " <<
pWindow->GetHelpId().getStr()); pWindow->GetHelpId().getStr());
m_aChildren.push_back(WinAndId(id, pWindow, bVertical)); m_aChildren.push_back(WinAndId(id, xWindow, bVertical));
} }
return pWindow; return pWindow;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment