Convert more sites to VclPtrInstance.

Change-Id: I364c5eb176d5003deb1938810cccf4f2aaedbd59
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 7c1b1c2..cbe0ef6 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 f3ebc74..7d099d6 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 2ea36cc..f66c139 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 b5e7845..d3f5211 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 753e297..e7eed88 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 7a4bd3d..e6cb65a 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;
}