sw: convert new to ::Create.

Change-Id: Iab0fc73540b3c7a60c64296dce86b70c1e02cf09
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 9a84905..c322075 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -141,7 +141,7 @@ namespace pcr
    {
        m_aFtTitle->SetZOrder(pRefWindow,nFlags);
        if ( m_pControlWindow )
            m_pControlWindow->SetZOrder( (vcl::Window*)&m_aFtTitle, WINDOW_ZORDER_BEHIND );
            m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );

        if ( m_pBrowseButton && m_pControlWindow )
            m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 5284bcc..c7dab43 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -153,7 +153,7 @@ public:
                            virtual ~SfxPopupWindow();
    virtual void            dispose() SAL_OVERRIDE;

    virtual SfxPopupWindow* Clone() const;
    virtual VclPtr<SfxPopupWindow> Clone() const;
    virtual void            MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;

    void                    StartCascading();
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
index 4b5ccec..b9daf62 100644
--- a/include/svx/linectrl.hxx
+++ b/include/svx/linectrl.hxx
@@ -124,7 +124,7 @@ public:

    virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,
                                  const SfxPoolItem* pState ) SAL_OVERRIDE;
    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};


diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index f229d8d..4fc75e1 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1335,7 +1335,7 @@ void SfxPopupWindow::StartCascading()



SfxPopupWindow* SfxPopupWindow::Clone() const
VclPtr<SfxPopupWindow> SfxPopupWindow::Clone() const

/*  [Description]

diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 1ad7f6e..d40f8a4 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1038,7 +1038,7 @@ namespace sdr { namespace contact {

        if ( m_aControl.is() )
        {
            if ( m_pOutputDeviceForWindow.get() == const_cast<OutputDevice *>( &_rDevice ) )
            if ( m_pOutputDeviceForWindow.get() == &_rDevice )
                return true;

            // Somebody requested a control for a new device, which means either of
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index eae25a8..5cdf8b7 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -74,7 +74,7 @@ public:
    virtual void        KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
    virtual void        StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;

    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
    void SetSelectedHdl( const Link& rLink ) { maSelectedLink = rLink; }
};

diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index bd82e70..7bb1cd2 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -86,7 +86,7 @@ public:
    virtual void            MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
    virtual void            Paint( const Rectangle& ) SAL_OVERRIDE;
    virtual void            PopupModeEnd() SAL_OVERRIDE;
    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;

private:
    void                    Update( long nNewCol, long nNewLine );
@@ -166,7 +166,7 @@ void TableWindow::dispose()
    SfxPopupWindow::dispose();
}

SfxPopupWindow* TableWindow::Clone() const
VclPtr<SfxPopupWindow> TableWindow::Clone() const
{
    return new TableWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
@@ -430,7 +430,7 @@ public:
    virtual void            MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
    virtual void            Paint( const Rectangle& ) SAL_OVERRIDE;
    virtual void            PopupModeEnd() SAL_OVERRIDE;
    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};


@@ -472,7 +472,7 @@ ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUStri



SfxPopupWindow* ColumnsWindow::Clone() const
VclPtr<SfxPopupWindow> ColumnsWindow::Clone() const
{
    return new ColumnsWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 99ca4bc..1269b46 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -66,7 +66,7 @@ public:
    virtual void dispose() SAL_OVERRIDE;

    // SfxPopupWindow
    virtual SfxPopupWindow *    Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
    virtual void                PopupModeEnd() SAL_OVERRIDE;
    virtual void                StateChanged( sal_uInt16 nSID, SfxItemState eState,
                                              const SfxPoolItem* pState ) SAL_OVERRIDE;
@@ -109,7 +109,7 @@ void SvxPopupWindowListBox::dispose()
    SfxPopupWindow::dispose();
}

SfxPopupWindow* SvxPopupWindowListBox::Clone() const
VclPtr<SfxPopupWindow> SvxPopupWindowListBox::Clone() const
{
    return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
}
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 8a360f5..c7e4e17 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -320,7 +320,7 @@ void SvxLineEndWindow::implInit()
    aLineEndSet->Show();
}

SfxPopupWindow* SvxLineEndWindow::Clone() const
VclPtr<SfxPopupWindow> SvxLineEndWindow::Clone() const
{
    return new SvxLineEndWindow( GetId(), mxFrame, GetText() );
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index f9d8ce8..770eaef 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -258,7 +258,7 @@ public:

    virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,
                                  const SfxPoolItem* pState ) SAL_OVERRIDE;
    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
    virtual void    DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
};

@@ -280,7 +280,7 @@ public:
    SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow );
    virtual ~SvxLineWindow_Impl() { disposeOnce(); }
    virtual void dispose() SAL_OVERRIDE { m_aLineStyleLb.disposeAndClear(); SfxPopupWindow::dispose(); }
    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};

class SvxStyleToolBoxControl;
@@ -1262,7 +1262,7 @@ void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt )
    mpColorSet->KeyInput(rKEvt);
}

SfxPopupWindow* SvxColorWindow_Impl::Clone() const
VclPtr<SfxPopupWindow> SvxColorWindow_Impl::Clone() const
{
    return new SvxColorWindow_Impl( maCommand, mrPaletteManager, mrBorderColorStatus, theSlotId, GetFrame(), GetText(), GetParent() );
}
@@ -1534,7 +1534,7 @@ void SvxFrameWindow_Impl::dispose()
    SfxPopupWindow::dispose();
}

SfxPopupWindow* SvxFrameWindow_Impl::Clone() const
VclPtr<SfxPopupWindow> SvxFrameWindow_Impl::Clone() const
{
    //! HACK: How do I get the Paragraph mode?
    return new SvxFrameWindow_Impl( GetId(), GetFrame(), GetParent() );
@@ -1805,7 +1805,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame 
    m_aLineStyleLb->Show();
}

SfxPopupWindow* SvxLineWindow_Impl::Clone() const
VclPtr<SfxPopupWindow> SvxLineWindow_Impl::Clone() const
{
    return new SvxLineWindow_Impl( GetId(), GetFrame(), GetParent() );
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 3a0f64b..b9397f4 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -136,7 +136,7 @@ using namespace ::sfx2;
SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
                                vcl::Window *pParent, const SfxItemSet &rSet)
{
    SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet);
    VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create(pParent, rSet);
    //only with statistics, when this document is being shown, not
    //from within the Doc-Manager
    SwDocShell* pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
@@ -501,7 +501,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                {
                    SvtPathOptions aPathOpt;
                    ScopedVclPtr<SfxNewFileDialog> pNewFileDlg(
                        new SfxNewFileDialog(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE));
                        VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE));
                    pNewFileDlg->SetTemplateFlags(nFlags);

                    nRet = pNewFileDlg->Execute();
@@ -648,7 +648,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                {
                    SfxPrinter* pTemp = GetDoc()->getIDocumentDeviceAccess().getPrinter( false );
                    if(pTemp)
                        pSavePrinter = new SfxPrinter(*pTemp);
                        pSavePrinter = VclPtr<SfxPrinter>::Create(*pTemp);
                    bSetModified = IsModified() || pSrcView->IsModified();
                    if(pSrcView->IsModified()||pSrcView->HasSourceSaved())
                    {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f5fd204..8ca4f65 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -950,9 +950,9 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
                if( ! pParent )
                    pParent = pSourceWindow;
                if( bMergeShell )
                    pProgressDlg = new CreateMonitor( pParent, pParent != pSourceWindow );
                    pProgressDlg = VclPtr<CreateMonitor>::Create( pParent, pParent != pSourceWindow );
                else {
                    pProgressDlg = new PrintMonitor( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT );
                    pProgressDlg = VclPtr<PrintMonitor>::Create( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT );
                    static_cast<PrintMonitor*>( pProgressDlg.get() )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22));
                }
                pProgressDlg->SetCancelHdl( LINK(this, SwDBManager, PrtCancelHdl) );
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 70ef937..6e511f0 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -186,7 +186,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwDBTreeList(vcl::Wind
    OString sBorder = VclBuilder::extractCustomProperty(rMap);
    if (!sBorder.isEmpty())
        nStyle |= WB_BORDER;
    return new SwDBTreeList(pParent, nStyle);
    return VclPtr<SwDBTreeList>::Create(pParent, nStyle);
}

Size SwDBTreeList::GetOptimalSize() const
diff --git a/sw/source/uibase/dbui/mailmergechildwindow.cxx b/sw/source/uibase/dbui/mailmergechildwindow.cxx
index f3feeaa..ad16a82 100644
--- a/sw/source/uibase/dbui/mailmergechildwindow.cxx
+++ b/sw/source/uibase/dbui/mailmergechildwindow.cxx
@@ -43,7 +43,7 @@ SwMailMergeChildWindow::SwMailMergeChildWindow( vcl::Window* _pParent,
                                SfxChildWinInfo* pInfo ) :
                                SfxChildWindow( _pParent, nId )
{
    pWindow = new SwMailMergeChildWin( pBindings, this, _pParent);
    pWindow = VclPtr<SwMailMergeChildWin>::Create( pBindings, this, _pParent);

    if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
    {
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index fb26720..ce7d53e 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -187,7 +187,7 @@ struct  SwAddressPreview_Impl

SwAddressPreview::SwAddressPreview(vcl::Window* pParent, WinBits nStyle)
    : Window( pParent, nStyle )
    , aVScrollBar(new ScrollBar(this, WB_VSCROLL))
    , aVScrollBar(VclPtr<ScrollBar>::Create(this, WB_VSCROLL))
    , pImpl(new SwAddressPreview_Impl())
{
    aVScrollBar->SetScrollHdl(LINK(this, SwAddressPreview, ScrollHdl));
@@ -621,7 +621,7 @@ OUString SwAuthenticator::getPassword(  ) throw (RuntimeException, std::exceptio
    if(!m_aUserName.isEmpty() && m_aPassword.isEmpty() && m_pParentWindow)
    {
       SfxPasswordDialog* pPasswdDlg =
                new SfxPasswordDialog( m_pParentWindow );
                VclPtr<SfxPasswordDialog>::Create( m_pParentWindow );
       pPasswdDlg->SetMinLen( 0 );
       if(RET_OK == pPasswdDlg->Execute())
            m_aPassword = pPasswdDlg->GetPassword();
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index e96a838..61dcbd2 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -143,7 +143,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
    SetMapMode( MapMode ( MAP_PIXEL ) );

    // Create the line control
    m_pLine = new SwDashedLine( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
    m_pLine = VclPtr<SwDashedLine>::Create( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
    m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );

    // Create and set the PopupMenu
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 703c8c1..d806eb3 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -105,7 +105,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm )
    SetMapMode( MapMode ( MAP_PIXEL ) );

    // Create the line control
    m_pLine = new SwBreakDashedLine( GetEditWin(), &SwViewOption::GetPageBreakColor, this );
    m_pLine = VclPtr<SwBreakDashedLine>::Create( GetEditWin(), &SwViewOption::GetPageBreakColor, this );

    // Create the popup menu
    m_pPopupMenu = new PopupMenu( SW_RES( MN_PAGEBREAK_BUTTON ) );
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index ebd0021..05a9cd2 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -356,13 +356,13 @@ void SwSidebarWin::InitControls()
    AddEventListener( LINK( this, SwSidebarWin, WindowEventListener ) );

    // actual window which holds the user text
    mpSidebarTxtControl = new SidebarTxtControl( *this,
    mpSidebarTxtControl = VclPtr<SidebarTxtControl>::Create( *this,
                                                 WB_NODIALOGCONTROL,
                                                 mrView, mrMgr );
    mpSidebarTxtControl->SetPointer(Pointer(POINTER_TEXT));

    // window controls for author and date
    mpMetadataAuthor = new Edit( this, 0 );
    mpMetadataAuthor = VclPtr<Edit>::Create( this, 0 );
    mpMetadataAuthor->SetAccessibleName( SW_RES( STR_ACCESS_ANNOTATION_AUTHOR_NAME ) );
    mpMetadataAuthor->EnableRTL(AllSettings::GetLayoutRTL());
    mpMetadataAuthor->SetReadOnly();
@@ -381,7 +381,7 @@ void SwSidebarWin::InitControls()
        mpMetadataAuthor->SetSettings(aSettings);
    }

    mpMetadataDate = new Edit( this, 0 );
    mpMetadataDate = VclPtr<Edit>::Create( this, 0 );
    mpMetadataDate->SetAccessibleName( SW_RES( STR_ACCESS_ANNOTATION_DATE_NAME ) );
    mpMetadataDate->EnableRTL(AllSettings::GetLayoutRTL());
    mpMetadataDate->SetReadOnly();
@@ -415,7 +415,7 @@ void SwSidebarWin::InitControls()
    mpOutlinerView->SetAttribs(DefaultItem());

    //create Scrollbars
    mpVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
    mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
    mpVScrollbar->EnableNativeWidget(false);
    mpVScrollbar->EnableRTL( false );
    mpVScrollbar->SetScrollHdl(LINK(this, SwSidebarWin, ScrollHdl));
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index 3068102..5d2dac6 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -487,18 +487,18 @@ void  TextViewOutWin::Paint( const Rectangle& rRect )
void SwSrcEditWindow::CreateTextEngine()
{
    const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
    pOutWin = new TextViewOutWin(this, 0);
    pOutWin = VclPtr<TextViewOutWin>::Create(this, 0);
    pOutWin->SetBackground(Wallpaper(rCol));
    pOutWin->SetPointer(Pointer(POINTER_TEXT));
    pOutWin->Show();

    // create Scrollbars
    pHScrollbar = new ScrollBar(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG);
    pHScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG);
        pHScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
    pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
    pHScrollbar->Show();

    pVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
    pVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
        pVScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
    pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
    pHScrollbar->EnableDrag();
diff --git a/sw/source/uibase/envelp/syncbtn.cxx b/sw/source/uibase/envelp/syncbtn.cxx
index 2032aba..e75751d 100644
--- a/sw/source/uibase/envelp/syncbtn.cxx
+++ b/sw/source/uibase/envelp/syncbtn.cxx
@@ -37,7 +37,7 @@ SwSyncChildWin::SwSyncChildWin( vcl::Window* _pParent,
                                SfxChildWinInfo* pInfo ) :
                                SfxChildWindow( _pParent, nId )
{
    pWindow = new SwSyncBtnDlg( pBindings, this, _pParent);
    pWindow = VclPtr<SwSyncBtnDlg>::Create( pBindings, this, _pParent);

    if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
    {
diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx
index 201510c..6586553 100644
--- a/sw/source/uibase/inc/workctrl.hxx
+++ b/sw/source/uibase/inc/workctrl.hxx
@@ -152,7 +152,7 @@ public:

    static OUString         GetQuickHelpText(bool bNext);

    virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
    virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
    void                GrabFocus() { m_pToolBox->GrabFocus(); }
};

diff --git a/sw/source/uibase/misc/glshell.cxx b/sw/source/uibase/misc/glshell.cxx
index fbbfd85..d3f1e69 100644
--- a/sw/source/uibase/misc/glshell.cxx
+++ b/sw/source/uibase/misc/glshell.cxx
@@ -248,7 +248,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString
                        SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                        SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                        0 );
            SfxPrinter* pPrinter = new SfxPrinter( pSet );
            VclPtr<SfxPrinter> pPrinter = VclPtr<SfxPrinter>::Create( pSet );

            // and append it to the document.
            xDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pPrinter, true, true );
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 6d69bfa..e70a498 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -67,7 +67,7 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( vcl::Window* _pParent,
                                            SfxChildWinInfo* pInfo ) :
    SwChildWinWrapper( _pParent, nId )
{
    pWindow = new SwModelessRedlineAcceptDlg( pBindings, this, _pParent);
    pWindow = VclPtr<SwModelessRedlineAcceptDlg>::Create( pBindings, this, _pParent);

    static_cast<SwModelessRedlineAcceptDlg *>(pWindow.get())->Initialize(pInfo);
}
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index 1d95bd2..db2adb7 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -41,7 +41,7 @@ SwCommentRuler::SwCommentRuler( SwViewShell* pViewSh, vcl::Window* pParent, SwEd
, mpSwWin(pWin)
, mbIsHighlighted(false)
, mnFadeRate(0)
, maVirDev( new VirtualDevice(*this) )
, maVirDev( VclPtr<VirtualDevice>::Create(*this) )
{
    // Set fading timeout: 5 x 40ms = 200ms
    maFadeTimer.SetTimeout(40);
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index b2dc3c1..c20543c 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -58,8 +58,8 @@ SFX_IMPL_POS_CHILDWINDOW_WITHID( SwInputChild, FN_EDIT_FORMULA, SFX_OBJECTBAR_OB

SwInputWindow::SwInputWindow( vcl::Window* pParent, SfxBindings* pBind )
    : ToolBox(  pParent ,   SW_RES( RID_TBX_FORMULA )),
    aPos(       new Edit(this,       SW_RES(ED_POS))),
    aEdit(      new InputEdit(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION)),
    aPos(       VclPtr<Edit>::Create(this,       SW_RES(ED_POS))),
    aEdit(      VclPtr<InputEdit>::Create(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION)),
    aPopMenu(   SW_RES(MN_CALC_POPUP)),
    pMgr(0),
    pWrtShell(0),
@@ -625,7 +625,7 @@ SwInputChild::SwInputChild(vcl::Window* _pParent,
                                SfxChildWindow( _pParent, nId )
{
    pDispatch = pBindings->GetDispatcher();
    pWindow = new SwInputWindow( _pParent, pBindings );
    pWindow = VclPtr<SwInputWindow>::Create( _pParent, pBindings );
    static_cast<SwInputWindow*>(pWindow.get())->ShowWin();
    eChildAlignment = SfxChildAlignment::LOWESTTOP;
}
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 3b5bc23..869ac2a 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -398,7 +398,7 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& 
        "modules/swriter/ui/floatingnavigation.ui", rFrame),
    aIList(SW_RES(IL_VALUES))
{
    m_pToolBox = new SwScrollNaviToolBox(get<vcl::Window>("box"), this, 0);
    m_pToolBox = VclPtr<SwScrollNaviToolBox>::Create(get<vcl::Window>("box"), this, 0);
    get(m_pInfoField, "label");

    sal_uInt16 i;
@@ -477,9 +477,9 @@ void SwScrollNaviPopup::ApplyImageList()
    }
}

SfxPopupWindow* SwScrollNaviPopup::Clone() const
VclPtr<SfxPopupWindow> SwScrollNaviPopup::Clone() const
{
    return new SwScrollNaviPopup( GetId(), GetFrame(), GetParent() );
    return VclPtr<SwScrollNaviPopup>::Create( GetId(), GetFrame(), GetParent() );
}

IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)