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()
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();
......
......@@ -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 );
......
......@@ -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 ) );
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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;
}
......
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