diff options
59 files changed, 207 insertions, 203 deletions
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 74e6691c3164..fe2268be3e0c 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -549,7 +549,7 @@ SbaXGridPeer* SbaXGridPeer::getImplementation(const Reference< XInterface >& _rx return NULL; } -FmGridControl* SbaXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle) +VclPtr<FmGridControl> SbaXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle) { return new SbaGridControl( m_xContext, pParent, this, nStyle); } @@ -727,7 +727,7 @@ void SbaGridControl::dispose() FmGridControl::dispose(); } -BrowserHeader* SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent) +VclPtr<BrowserHeader> SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent) { return new SbaGridHeader(pParent); } diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 7691291daec6..940f1b108408 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -127,7 +127,7 @@ namespace dbaui virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; protected: - virtual FmGridControl* imp_CreateControl(vcl::Window* pParent, WinBits nStyle) SAL_OVERRIDE; + virtual VclPtr<FmGridControl> imp_CreateControl(vcl::Window* pParent, WinBits nStyle) SAL_OVERRIDE; #ifdef _MSC_VER typedef ::com::sun::star::frame::XStatusListener xstlist_type; typedef ::com::sun::star::uno::Reference< xstlist_type > xlistener_type; @@ -274,7 +274,7 @@ namespace dbaui virtual void MouseButtonDown( const BrowserMouseEvent& rMEvt) SAL_OVERRIDE; // EditBrowseBox overridables - virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; + virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) SAL_OVERRIDE; // DbGridControl overridables diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 275afd30c9e3..8c3be11c1615 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -281,7 +281,7 @@ namespace } } -BrowserHeader* OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/) +VclPtr<BrowserHeader> OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/) { return new OSelectionBrwBoxHeader(this); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 8e9033d6398a..8c30610be159 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -206,7 +206,7 @@ namespace dbaui virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) SAL_OVERRIDE; // if you want to have an own header ... - virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; + virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; void stopTimer(); void startTimer(); diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 4031d410b8c5..af9ad5a35dba 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -508,7 +508,7 @@ namespace svt virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; // if you want to have an own header ... - virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent); + virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent); virtual void ColumnMoved(sal_uInt16 nId) SAL_OVERRIDE; virtual void ColumnResized(sal_uInt16 nColId) SAL_OVERRIDE; diff --git a/include/svx/fmgridcl.hxx b/include/svx/fmgridcl.hxx index 5517a27d3ec2..5b46d58259b8 100644 --- a/include/svx/fmgridcl.hxx +++ b/include/svx/fmgridcl.hxx @@ -154,7 +154,7 @@ public: protected: virtual void Command(const CommandEvent& rEvt) SAL_OVERRIDE; - virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; + virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE; virtual long QueryMinimumRowHeight() SAL_OVERRIDE; virtual void RowHeightChanged() SAL_OVERRIDE; virtual void ColumnResized(sal_uInt16 nId) SAL_OVERRIDE; diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx index 2d31c97f3e8c..b79ee0f983f3 100644 --- a/include/svx/fmgridif.hxx +++ b/include/svx/fmgridif.hxx @@ -515,7 +515,7 @@ public: virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; protected: - virtual FmGridControl* imp_CreateControl(vcl::Window* pParent, WinBits nStyle); + virtual VclPtr<FmGridControl> imp_CreateControl(vcl::Window* pParent, WinBits nStyle); static ::com::sun::star::uno::Sequence< ::com::sun::star::util::URL>& getSupportedURLs(); static ::com::sun::star::uno::Sequence<sal_uInt16>& getSupportedGridSlots(); diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx index 53a7625507cd..ac98a7543da5 100644 --- a/include/svx/hdft.hxx +++ b/include/svx/hdft.hxx @@ -113,12 +113,10 @@ private: class SVX_DLLPUBLIC SvxHeaderPage : public SvxHFPage { public: + SvxHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet ); static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet ); // returns the Which values to the range static const sal_uInt16* GetRanges() { return pRanges; } - -private: - SvxHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet ); }; // class SvxFooterPage --------------------------------------------------- @@ -126,11 +124,9 @@ private: class SVX_DLLPUBLIC SvxFooterPage : public SvxHFPage { public: + SVX_DLLPRIVATE SvxFooterPage( vcl::Window* pParent, const SfxItemSet& rSet ); static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pRanges; } - -private: - SVX_DLLPRIVATE SvxFooterPage( vcl::Window* pParent, const SfxItemSet& rSet ); }; class SVX_DLLPUBLIC DeleteHeaderDialog : public MessageDialog diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 9e53109f487e..2aa8d6ea87f9 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -219,7 +219,7 @@ namespace svt } - BrowserHeader* EditBrowseBox::imp_CreateHeaderBar(BrowseBox* pParent) + VclPtr<BrowserHeader> EditBrowseBox::imp_CreateHeaderBar(BrowseBox* pParent) { return new EditBrowserHeader(pParent); } diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index fce58061722b..52b9cd191d1f 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -363,7 +363,7 @@ SvxBmpMaskChildWindow::SvxBmpMaskChildWindow(vcl::Window* pParent_, sal_uInt16 n SfxChildWinInfo* pInfo) : SfxChildWindow(pParent_, nId) { - SvxBmpMask* pDlg = new SvxBmpMask(pBindings, this, pParent_); + VclPtr<SvxBmpMask> pDlg = VclPtr<SvxBmpMask>::Create(pBindings, this, pParent_); pWindow = pDlg; @@ -383,35 +383,35 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* m_pTbxPipette->SetItemBits(m_pTbxPipette->GetItemId(0), ToolBoxItemBits::AUTOCHECK); get(m_pBtnExec, "replace"); - m_pCtlPipette = new ColorWindow(get<Window>("toolgrid")); + m_pCtlPipette = VclPtr<ColorWindow>::Create(get<Window>("toolgrid")); m_pCtlPipette->Show(); m_pCtlPipette->set_grid_left_attach(1); m_pCtlPipette->set_grid_top_attach(0); m_pCtlPipette->set_hexpand(true); get(m_pCbx1, "cbx1"); Window *pGrid = get<Window>("colorgrid"); - m_pQSet1 = new MaskSet(this, pGrid); + m_pQSet1 = VclPtr<MaskSet>::Create(this, pGrid); m_pQSet1->set_grid_left_attach(1); m_pQSet1->set_grid_top_attach(1); m_pQSet1->Show(); get(m_pSp1, "tol1"); get(m_pLbColor1, "color1"); get(m_pCbx2, "cbx2"); - m_pQSet2 = new MaskSet(this, pGrid); + m_pQSet2 = VclPtr<MaskSet>::Create(this, pGrid); m_pQSet2->set_grid_left_attach(1); m_pQSet2->set_grid_top_attach(2); m_pQSet2->Show(); get(m_pSp2, "tol2"); get(m_pLbColor2, "color2"); get(m_pCbx3, "cbx3"); - m_pQSet3 = new MaskSet(this, pGrid); + m_pQSet3 = VclPtr<MaskSet>::Create(this, pGrid); m_pQSet3->set_grid_left_attach(1); m_pQSet3->set_grid_top_attach(3); m_pQSet3->Show(); get(m_pSp3, "tol3"); get(m_pLbColor3, "color3"); get(m_pCbx4, "cbx4"); - m_pQSet4 = new MaskSet(this, pGrid); + m_pQSet4 = VclPtr<MaskSet>::Create(this, pGrid); m_pQSet4->set_grid_left_attach(1); m_pQSet4->set_grid_top_attach(4); m_pQSet4->Show(); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index ce3e70bb1aae..bc295383b0fc 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -67,7 +67,7 @@ SvxContourDlgChildWindow::SvxContourDlgChildWindow( vcl::Window* _pParent, sal_u SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { - SvxSuperContourDlg* pDlg = new SvxSuperContourDlg(pBindings, this, _pParent); + VclPtr<SvxSuperContourDlg> pDlg = VclPtr<SvxSuperContourDlg>::Create(pBindings, this, _pParent); pWindow = pDlg; if ( pInfo->nFlags & SfxChildWindowFlags::ZOOMIN ) @@ -223,7 +223,7 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow * { get(m_pTbx1, "toolbar"); get(m_pMtfTolerance, "spinbutton"); - m_pContourWnd = new ContourWindow(get<vcl::Window>("container"), WB_BORDER); + m_pContourWnd = VclPtr<ContourWindow>::Create(get<vcl::Window>("container"), WB_BORDER); m_pContourWnd->set_hexpand(true); m_pContourWnd->set_vexpand(true); m_pContourWnd->Show(); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index e3c60fe43226..60cfe9d7ce16 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -56,7 +56,7 @@ sal_uInt32& SvxShowCharSet::getSelectedChar() SvxShowCharSet::SvxShowCharSet(vcl::Window* pParent) : Control(pParent, WB_TABSTOP | WB_BORDER) , m_pAccessible(NULL) - , aVscrollSB( new ScrollBar(this, WB_VERT) ) + , aVscrollSB( VclPtr<ScrollBar>::Create(this, WB_VERT) ) { init(); InitSettings( true, true ); diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 2b553223463a..3b35c5a29a45 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -173,7 +173,7 @@ void CompressGraphicsDialog::Update() const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() ); sal_Unicode cSeparator = rLocaleWrapper.getNumDecimalSep()[0]; - VirtualDevice* pDummyVDev = new VirtualDevice(); + VclPtr<VirtualDevice> pDummyVDev = VclPtr<VirtualDevice>::Create(); pDummyVDev->EnableOutput( false ); pDummyVDev->SetMapMode( m_aGraphic.GetPrefMapMode() ); diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index ddb685271b89..14a00184fab7 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -385,7 +385,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel) aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); pTable->set_width_request(aControlSize.Width()); pTable->set_height_request(aControlSize.Height()); - m_pViewData = new SvxRedlinTable(*pTable, 0); + m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0); Link aLink=LINK( this, SvxTPView, PbClickHdl); @@ -1096,8 +1096,8 @@ SvxAcceptChgCtr::SvxAcceptChgCtr(vcl::Window* pParent, VclBuilderContainer* pTop { m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "svx/ui/redlinecontrol.ui", "RedlineControl"); - pTPFilter = new SvxTPFilter(this); - pTPView = new SvxTPView(this, pTopLevel); + pTPFilter = VclPtr<SvxTPFilter>::Create(this); + pTPView = VclPtr<SvxTPView>::Create(this, pTopLevel); m_nViewPageId = GetPageId("view"); m_nFilterPageId = GetPageId("filter"); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 514dd1568b8e..0735098c3cae 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -220,9 +220,9 @@ void DialControlBmp::DrawBackground() DialControl::DialControl_Impl::DialControl_Impl ( vcl::Window& rParent ) : - mxBmpEnabled(new DialControlBmp(rParent)), - mxBmpDisabled(new DialControlBmp(rParent)), - mxBmpBuffered(new DialControlBmp(rParent)), + mxBmpEnabled(VclPtr<DialControlBmp>::Create(rParent)), + mxBmpDisabled(VclPtr<DialControlBmp>::Create(rParent)), + mxBmpBuffered(VclPtr<DialControlBmp>::Create(rParent)), mpLinkField( 0 ), mnLinkedFieldValueMultiplyer( 0 ), mnAngle( 0 ), diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 519dfc058802..fb4923ebd747 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -948,10 +948,10 @@ basegfx::B3DVector Svx3DLightControl::GetLightDirection(sal_uInt32 nNum) const SvxLightCtl3D::SvxLightCtl3D( vcl::Window* pParent) : Control(pParent, WB_BORDER | WB_TABSTOP), - maLightControl(new Svx3DLightControl(this, 0)), - maHorScroller(new ScrollBar(this, WB_HORZ | WB_DRAG)), - maVerScroller(new ScrollBar(this, WB_VERT | WB_DRAG)), - maSwitcher(new PushButton(this, 0)) + maLightControl(VclPtr<Svx3DLightControl>::Create(this, 0)), + maHorScroller(VclPtr<ScrollBar>::Create(this, WB_HORZ | WB_DRAG)), + maVerScroller(VclPtr<ScrollBar>::Create(this, WB_VERT | WB_DRAG)), + maSwitcher(VclPtr<PushButton>::Create(this, 0)) { // init members Init(); diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 88baa47cb942..92d1cdbcd732 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1824,7 +1824,7 @@ void SvxPreviewBase::InitSettings(bool bForeground, bool bBackground) SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent) : Control(pParent, WB_BORDER) , mpModel(new SdrModel()) - , mpBufferDevice(new VirtualDevice(*this)) + , mpBufferDevice(VclPtr<VirtualDevice>::Create(*this)) { // Draw the control's border as a flat thin black line. SetBorderStyle(WindowBorderStyle::MONO); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 5f9d022f620f..b7b32b35f6cf 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -553,7 +553,7 @@ void PluginProgressWindow::dispose() PluginProgress::PluginProgress( vcl::Window* pParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) { - m_pPlugProgressWindow = new PluginProgressWindow(pParent, static_cast< css::lang::XComponent* >(this)); + m_pPlugProgressWindow = VclPtr<PluginProgressWindow>::Create(pParent, static_cast< css::lang::XComponent* >(this)); css::uno::Reference< css::awt::XWindow > xProgressWindow = VCLUnoHelper::GetInterface(m_pPlugProgressWindow); m_xProgressFactory = css::task::StatusIndicatorFactory::createWithWindow(xContext, xProgressWindow, sal_False/*DisableReschedule*/, sal_True/*AllowParentShow*/); m_xProgress = m_xProgressFactory->createStatusIndicator(); @@ -884,7 +884,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, RECOV_FILELISTHEIGHT), MAP_APPFONT)); pFileListLBContainer->set_width_request(aSize.Width()); pFileListLBContainer->set_height_request(aSize.Height()); - m_pFileListLB = new RecovDocList(*pFileListLBContainer, DIALOG_MGR()); + m_pFileListLB = VclPtr<RecovDocList>::Create(*pFileListLBContainer, DIALOG_MGR()); static long nTabs[] = { 2, 0, 40*RECOV_CONTROLWIDTH/100 }; m_pFileListLB->SetTabs( &nTabs[0] ); diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 3a8969de7d08..8e937fca5906 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -209,7 +209,7 @@ FrameBorderType FrameBorder::GetKeyboardNeighbor( sal_uInt16 nKeyCode ) const FrameSelectorImpl::FrameSelectorImpl( FrameSelector& rFrameSel ) : Resource( SVX_RES( RID_SVXSTR_BORDER_CONTROL ) ), mrFrameSel( rFrameSel ), - mpVirDev( new VirtualDevice() ), + mpVirDev( VclPtr<VirtualDevice>::Create() ), maILArrows( 16 ), maLeft( FRAMEBORDER_LEFT ), maRight( FRAMEBORDER_RIGHT ), diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 704c0dcc2ba2..f30b4497d80c 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -117,14 +117,14 @@ namespace svx { SfxTabPage* SvxHeaderPage::Create( vcl::Window* pParent, const SfxItemSet* rSet ) { - return new SvxHeaderPage( pParent, *rSet ); + return VclPtr<SvxHeaderPage>::Create( pParent, *rSet ); } SfxTabPage* SvxFooterPage::Create( vcl::Window* pParent, const SfxItemSet* rSet ) { - return new SvxFooterPage( pParent, *rSet ); + return VclPtr<SvxFooterPage>::Create( pParent, *rSet ); } diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index d99bb6818c8d..eed946a4d865 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -95,7 +95,7 @@ SvxIMapDlgChildWindow::SvxIMapDlgChildWindow( vcl::Window* _pParent, sal_uInt16 SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { - pWindow = new SvxIMapDlg( pBindings, this, _pParent ); + pWindow = VclPtr<SvxIMapDlg>::Create( pBindings, this, _pParent ); SvxIMapDlg* pDlg = static_cast<SvxIMapDlg*>(pWindow.get()); if ( pInfo->nFlags & SfxChildWindowFlags::ZOOMIN ) @@ -168,7 +168,7 @@ SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, vcl::Window get(m_pStbStatus, "statusbar"); VclVBox* _pContainer = get<VclVBox>("container"); - pIMapWnd = new IMapWindow( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() ); + pIMapWnd = VclPtr<IMapWindow>::Create( _pContainer, WB_BORDER, _pBindings->GetActiveFrame() ); pIMapWnd->set_hexpand(true); pIMapWnd->set_vexpand(true); pIMapWnd->Show(); diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 48317dd5b455..df773299a0a8 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -202,7 +202,7 @@ void SvxGridTabPage::dispose() SfxTabPage* SvxGridTabPage::Create( vcl::Window* pParent, const SfxItemSet& rAttrSet ) { - return new SvxGridTabPage( pParent, rAttrSet ); + return VclPtr<SvxGridTabPage>::Create( pParent, rAttrSet ); } diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 43e0c8b9ffbf..301959fb8e4e 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -64,7 +64,7 @@ SvxRubyChildWindow::SvxRubyChildWindow( vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo) : SfxChildWindow(_pParent, nId) { - SvxRubyDialog* pDlg = new SvxRubyDialog(pBindings, this, _pParent); + VclPtr<SvxRubyDialog> pDlg = VclPtr<SvxRubyDialog>::Create(pBindings, this, _pParent); pWindow = pDlg; if ( pInfo->nFlags & SfxChildWindowFlags::ZOOMIN ) diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index 32fbdd0a81d6..65d12c962e88 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -179,7 +179,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) { // The lines are only one time in the virtual device, only the outline // page is currently done - pVDev = new VirtualDevice(*pDev); + pVDev = VclPtr<VirtualDevice>::Create(*pDev); pVDev->SetMapMode(pDev->GetMapMode()); pVDev->EnableRTL( IsRTLEnabled() ); pVDev->SetOutputSize( aRectSize ); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 106568454f18..0b84e42d68f6 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -2916,7 +2916,7 @@ Svx3DChildWindow::Svx3DChildWindow( vcl::Window* _pParent, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) { - Svx3DWin* pWin = new Svx3DWin( pBindings, this, _pParent ); + VclPtr<Svx3DWin> pWin = VclPtr<Svx3DWin>::Create( pBindings, this, _pParent ); pWindow = pWin; eChildAlignment = SfxChildAlignment::NOALIGNMENT; diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index 2b6577afe14c..bd8baf20b71c 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1418,10 +1418,10 @@ void FmGridControl::inserted(const ::com::sun::star::lang::EventObject& /*rEvent } -BrowserHeader* FmGridControl::imp_CreateHeaderBar(BrowseBox* pParent) +VclPtr<BrowserHeader> FmGridControl::imp_CreateHeaderBar(BrowseBox* pParent) { DBG_ASSERT( pParent == this, "FmGridControl::imp_CreateHeaderBar: parent?" ); - return new FmGridHeader( pParent ); + return VclPtr<FmGridHeader>::Create( pParent ); } void FmGridControl::markColumn(sal_uInt16 nId) diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 7150ef2bf85b..938292bdf8c3 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1079,9 +1079,9 @@ FmXGridPeer::FmXGridPeer(const Reference< XComponentContext >& _rxContext) } -FmGridControl* FmXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle) +VclPtr<FmGridControl> FmXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle) { - return new FmGridControl(m_xContext, pParent, this, nStyle); + return VclPtr<FmGridControl>::Create(m_xContext, pParent, this, nStyle); } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 403fa39db273..f2fbe0abf589 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1124,18 +1124,18 @@ void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCurso m_bIsSimpleEdit = !bIsMultiLine; if ( bIsMultiLine ) { - m_pWindow = new MultiLineTextCell( &rParent, nStyle ); + m_pWindow = VclPtr<MultiLineTextCell>::Create( &rParent, nStyle ); m_pEdit = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pWindow.get() ) ); - m_pPainter = new MultiLineTextCell( &rParent, nStyle ); + m_pPainter = VclPtr<MultiLineTextCell>::Create( &rParent, nStyle ); m_pPainterImplementation = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pPainter.get() ) ); } else { - m_pWindow = new Edit( &rParent, nStyle ); + m_pWindow = VclPtr<Edit>::Create( &rParent, nStyle ); m_pEdit = new EditImplementation( *static_cast< Edit* >( m_pWindow.get() ) ); - m_pPainter = new Edit( &rParent, nStyle ); + m_pPainter = VclPtr<Edit>::Create( &rParent, nStyle ); m_pPainterImplementation = new EditImplementation( *static_cast< Edit* >( m_pPainter.get() ) ); } @@ -1257,17 +1257,17 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x switch (nAlignment) { case ::com::sun::star::awt::TextAlign::RIGHT: - m_pWindow = new FormattedField( &rParent, WB_RIGHT ); - m_pPainter = new FormattedField( &rParent, WB_RIGHT ); + m_pWindow = VclPtr<FormattedField>::Create( &rParent, WB_RIGHT ); + m_pPainter = VclPtr<FormattedField>::Create( &rParent, WB_RIGHT ); break; case ::com::sun::star::awt::TextAlign::CENTER: - m_pWindow = new FormattedField( &rParent, WB_CENTER ); - m_pPainter = new FormattedField( &rParent, WB_CENTER ); + m_pWindow = VclPtr<FormattedField>::Create( &rParent, WB_CENTER ); + m_pPainter = VclPtr<FormattedField>::Create( &rParent, WB_CENTER ); break; default: - m_pWindow = new FormattedField( &rParent, WB_LEFT ); - m_pPainter = new FormattedField( &rParent, WB_LEFT ); + m_pWindow = VclPtr<FormattedField>::Create( &rParent, WB_LEFT ); + m_pPainter = VclPtr<FormattedField>::Create( &rParent, WB_LEFT ); // Alles nur damit die Selektion bei Focuserhalt von rechts nach links geht AllSettings aSettings = m_pWindow->GetSettings(); @@ -1637,8 +1637,8 @@ void DbCheckBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor { setTransparent( true ); - m_pWindow = new CheckBoxControl( &rParent ); - m_pPainter = new CheckBoxControl( &rParent ); + m_pWindow = VclPtr<CheckBoxControl>::Create( &rParent ); + m_pPainter = VclPtr<CheckBoxControl>::Create( &rParent ); m_pWindow->SetPaintTransparent( true ); m_pPainter->SetPaintTransparent( true ); @@ -1771,8 +1771,8 @@ void DbPatternField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCu { m_rColumn.SetAlignmentFromModel(-1); - m_pWindow = new PatternField( &rParent, 0 ); - m_pPainter= new PatternField( &rParent, 0 ); + m_pWindow = VclPtr<PatternField>::Create( &rParent, 0 ); + m_pPainter= VclPtr<PatternField>::Create( &rParent, 0 ); Reference< XPropertySet > xModel( m_rColumn.getModel() ); implAdjustGenericFieldSetting( xModel ); @@ -1946,9 +1946,9 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe } -SpinField* DbNumericField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbNumericField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) { - return new DoubleNumericField( _pParent, _nFieldStyle ); + return VclPtr<DoubleNumericField>::Create( _pParent, _nFieldStyle ); } namespace @@ -2074,9 +2074,9 @@ void DbCurrencyField::implAdjustGenericFieldSetting( const Reference< XPropertyS } -SpinField* DbCurrencyField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbCurrencyField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) { - return new LongCurrencyField( _pParent, _nFieldStyle ); + return VclPtr<LongCurrencyField>::Create( _pParent, _nFieldStyle ); } @@ -2180,7 +2180,7 @@ DbDateField::DbDateField( DbGridColumn& _rColumn ) } -SpinField* DbDateField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& _rxModel ) +VclPtr<SpinField> DbDateField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& _rxModel ) { // check if there is a DropDown property set to TRUE bool bDropDown = !hasProperty( FM_PROP_DROPDOWN, _rxModel ) @@ -2188,7 +2188,7 @@ SpinField* DbDateField::createField( vcl::Window* _pParent, WinBits _nFieldStyle if ( bDropDown ) _nFieldStyle |= WB_DROPDOWN; - CalendarField* pField = new CalendarField( _pParent, _nFieldStyle ); + VclPtr<CalendarField> pField = VclPtr<CalendarField>::Create( _pParent, _nFieldStyle ); pField->EnableToday(); pField->EnableNone(); @@ -2308,9 +2308,9 @@ DbTimeField::DbTimeField( DbGridColumn& _rColumn ) } -SpinField* DbTimeField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) +VclPtr<SpinField> DbTimeField::createField( vcl::Window* _pParent, WinBits _nFieldStyle, const Reference< XPropertySet >& /*_rxModel*/ ) { - return new TimeField( _pParent, _nFieldStyle ); + return VclPtr<TimeField>::Create( _pParent, _nFieldStyle ); } @@ -2464,7 +2464,7 @@ void DbComboBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor { m_rColumn.SetAlignmentFromModel(::com::sun::star::awt::TextAlign::LEFT); - m_pWindow = new ComboBoxControl( &rParent ); + m_pWindow = VclPtr<ComboBoxControl>::Create( &rParent ); // selection von rechts nach links AllSettings aSettings = m_pWindow->GetSettings(); @@ -2579,7 +2579,7 @@ void DbListBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor) { m_rColumn.SetAlignment(::com::sun::star::awt::TextAlign::LEFT); - m_pWindow = new ListBoxControl( &rParent ); + m_pWindow = VclPtr<ListBoxControl>::Create( &rParent ); // some initial properties Reference< XPropertySet > xModel( m_rColumn.getModel() ); @@ -2748,17 +2748,17 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com:: switch (m_nControlClass) { case ::com::sun::star::form::FormComponentType::CHECKBOX: - m_pWindow = new CheckBoxControl(pParent); + m_pWindow = VclPtr<CheckBoxControl>::Create(pParent); m_pWindow->SetPaintTransparent( true ); static_cast<CheckBoxControl*>(m_pWindow.get())->SetClickHdl( LINK( this, DbFilterField, OnClick ) ); - m_pPainter = new CheckBoxControl(pParent); + m_pPainter = VclPtr<CheckBoxControl>::Create(pParent); m_pPainter->SetPaintTransparent( true ); m_pPainter->SetBackground(); break; case ::com::sun::star::form::FormComponentType::LISTBOX: { - m_pWindow = new ListBoxControl(pParent); + m_pWindow = VclPtr<ListBoxControl>::Create(pParent); sal_Int16 nLines = ::comphelper::getINT16(xModel->getPropertyValue(FM_PROP_LINECOUNT)); Any aItems = xModel->getPropertyValue(FM_PROP_STRINGITEMLIST); SetList(aItems, m_nControlClass == ::com::sun::star::form::FormComponentType::COMBOBOX); @@ -2766,7 +2766,7 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com:: } break; case ::com::sun::star::form::FormComponentType::COMBOBOX: { - m_pWindow = new ComboBoxControl(pParent); + m_pWindow = VclPtr<ComboBoxControl>::Create(pParent); AllSettings aSettings = m_pWindow->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); @@ -2788,7 +2788,7 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com:: } break; default: { - m_pWindow = new Edit(pParent, WB_LEFT); + m_pWindow = VclPtr<Edit>::Create(pParent, WB_LEFT); AllSettings aSettings = m_pWindow->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); aStyleSettings.SetSelectionOptions( diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 58313a4645cc..8245f1ab1125 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -333,15 +333,15 @@ void DbGridControl::NavigationBar::PositionDataSource(sal_Int32 nRecord) DbGridControl::NavigationBar::NavigationBar(vcl::Window* pParent, WinBits nStyle) :Control(pParent, nStyle) - ,m_aRecordText(new FixedText(this, WB_VCENTER)) - ,m_aAbsolute(new DbGridControl::NavigationBar::AbsolutePos(this, WB_CENTER | WB_VCENTER)) - ,m_aRecordOf(new FixedText(this, WB_VCENTER)) - ,m_aRecordCount(new FixedText(this, WB_VCENTER)) - ,m_aFirstBtn(new ImageButton(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) - ,m_aPrevBtn(new ImageButton(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS)) - ,m_aNextBtn(new ImageButton(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS)) - ,m_aLastBtn(new ImageButton(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) - ,m_aNewBtn(new ImageButton(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) + ,m_aRecordText(VclPtr<FixedText>::Create(this, WB_VCENTER)) + ,m_aAbsolute(VclPtr<DbGridControl::NavigationBar::AbsolutePos>::Create(this, WB_CENTER | WB_VCENTER)) + ,m_aRecordOf(VclPtr<FixedText>::Create(this, WB_VCENTER)) + ,m_aRecordCount(VclPtr<FixedText>::Create(this, WB_VCENTER)) + ,m_aFirstBtn(VclPtr<ImageButton>::Create(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) + ,m_aPrevBtn(VclPtr<ImageButton>::Create(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS)) + ,m_aNextBtn(VclPtr<ImageButton>::Create(this, WB_REPEAT|WB_RECTSTYLE|WB_NOPOINTERFOCUS)) + ,m_aLastBtn(VclPtr<ImageButton>::Create(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) + ,m_aNewBtn(VclPtr<ImageButton>::Create(this, WB_RECTSTYLE|WB_NOPOINTERFOCUS)) ,m_nDefaultWidth(0) ,m_nCurrentPos(-1) ,m_bPositioning(false) @@ -888,7 +888,7 @@ DbGridControl::DbGridControl( WinBits nBits) :DbGridControl_Base(pParent, EBBF_NONE, nBits, DEFAULT_BROWSE_MODE ) ,m_xContext(_rxContext) - ,m_aBar(new DbGridControl::NavigationBar(this)) + ,m_aBar(VclPtr<DbGridControl::NavigationBar>::Create(this)) ,m_nAsynAdjustEvent(0) ,m_pDataSourcePropMultiplexer(NULL) ,m_pDataSourcePropListener(NULL) diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index ac5c3cd4aa47..7aec4e8ff624 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -1831,19 +1831,19 @@ namespace svxform if (sName == "submissions") { if ( !m_pSubmissionPage ) - m_pSubmissionPage = new XFormsPage(m_pTabCtrl, this, DGTSubmission); + m_pSubmissionPage = VclPtr<XFormsPage>::Create(m_pTabCtrl, this, DGTSubmission); pPage = m_pSubmissionPage; } else if (sName == "bindings") { if ( !m_pBindingPage ) - m_pBindingPage = new XFormsPage(m_pTabCtrl, this, DGTBinding); + m_pBindingPage = VclPtr<XFormsPage>::Create(m_pTabCtrl, this, DGTBinding); pPage = m_pBindingPage; } else if (sName == "instance") { if ( !m_pInstPage ) - m_pInstPage = new XFormsPage(m_pTabCtrl, this, DGTInstance); + m_pInstPage = VclPtr<XFormsPage>::Create(m_pTabCtrl, this, DGTInstance); pPage = m_pInstPage; } else @@ -1855,7 +1855,7 @@ namespace svxform pPage = m_aPageList[nPos]; else { - pPage = new XFormsPage(m_pTabCtrl, this, DGTInstance); + pPage = VclPtr<XFormsPage>::Create(m_pTabCtrl, this, DGTInstance); m_aPageList.push_back( pPage ); } } @@ -2160,7 +2160,7 @@ namespace svxform WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_ROLLABLE|WB_3DLOOK|WB_DOCKABLE) ), SfxControllerItem( SID_FM_DATANAVIGATOR_CONTROL, *_pBindings ), - m_aDataWin( new DataNavigatorWindow(this, _pBindings) ) + m_aDataWin( VclPtr<DataNavigatorWindow>::Create(this, _pBindings) ) { @@ -2256,7 +2256,7 @@ namespace svxform SfxChildWindow( _pParent, _nId ) { - pWindow = new DataNavigator( _pBindings, this, _pParent ); + pWindow = VclPtr<DataNavigator>::Create( _pBindings, this, _pParent ); eChildAlignment = SfxChildAlignment::RIGHT; pWindow->SetSizePixel( Size( 250, 400 ) ); static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo ); @@ -2922,7 +2922,7 @@ namespace svxform aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); pNamespacesListContainer->set_width_request(aControlSize.Width()); pNamespacesListContainer->set_height_request(aControlSize.Height()); - m_pNamespacesList = new SvSimpleTable(*pNamespacesListContainer, 0); + m_pNamespacesList = VclPtr<SvSimpleTable>::Create(*pNamespacesListContainer, 0); static long aStaticTabs[]= { 3, 0, 35, 200 }; m_pNamespacesList->SvSimpleTable::SetTabs( aStaticTabs ); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index a3d7e3a2b632..d0812222e270 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1858,7 +1858,7 @@ FmFilterNavigatorWin::FmFilterNavigatorWin( SfxBindings* _pBindings, SfxChildWin { SetHelpId( HID_FILTER_NAVIGATOR_WIN ); - m_pNavigator = new FmFilterNavigator( this ); + m_pNavigator = VclPtr<FmFilterNavigator>::Create( this ); m_pNavigator->Show(); SetText( SVX_RES(RID_STR_FILTER_NAVIGATOR) ); SfxDockingWindow::SetFloatingSize( Size(200,200) ); @@ -1994,7 +1994,7 @@ FmFilterNavigatorWinMgr::FmFilterNavigatorWinMgr( vcl::Window *_pParent, sal_uIn SfxBindings *_pBindings, SfxChildWinInfo* _pInfo ) :SfxChildWindow( _pParent, _nId ) { - pWindow = new FmFilterNavigatorWin( _pBindings, this, _pParent ); + pWindow = VclPtr<FmFilterNavigatorWin>::Create( _pBindings, this, _pParent ); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo ); } diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index b61dde5086aa..4b291c573975 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -83,7 +83,7 @@ FmPropBrwMgr::FmPropBrwMgr( vcl::Window* _pParent, sal_uInt16 _nId, SfxBindings* _pBindings, SfxChildWinInfo* _pInfo) :SfxChildWindow(_pParent, _nId) { - pWindow = new FmPropBrw( ::comphelper::getProcessComponentContext(), _pBindings, this, _pParent, _pInfo ); + pWindow = VclPtr<FmPropBrw>::Create( ::comphelper::getProcessComponentContext(), _pBindings, this, _pParent, _pInfo ); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( _pInfo ); } @@ -206,7 +206,7 @@ FmPropBrw::FmPropBrw( const Reference< XComponentContext >& _xORB, SfxBindings* // responsibility for this window (as soon as we initialize a frame with a window, the frame // is responsible for its life time, but |this| is controlled by the belonging SfxChildWindow) // #i34249# - vcl::Window* pContainerWindow = new vcl::Window( this ); + VclPtr<vcl::Window> pContainerWindow = VclPtr<vcl::Window>::Create( this ); pContainerWindow->Show(); m_xFrameContainerWindow = VCLUnoHelper::GetInterface ( pContainerWindow ); diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 5084c607f161..44c636aeef96 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -505,7 +505,7 @@ namespace svxform { SetHelpId( HID_FORM_NAVIGATOR_WIN ); - m_pNavigatorTree = new NavigatorTree( this ); + m_pNavigatorTree = VclPtr<NavigatorTree>::Create( this ); m_pNavigatorTree->Show(); SetText( SVX_RES(RID_STR_FMEXPLORER) ); SfxDockingWindow::SetFloatingSize( Size(200,200) ); @@ -613,7 +613,7 @@ namespace svxform SfxBindings* _pBindings, SfxChildWinInfo* _pInfo ) :SfxChildWindow( _pParent, _nId ) { - pWindow = new NavigatorFrame( _pBindings, this, _pParent ); + pWindow = VclPtr<NavigatorFrame>::Create( _pBindings, this, _pParent ); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo ); } diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 4c8248e98371..44493395bb0f 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -655,9 +655,11 @@ namespace svx fillFeatureDispatchers( m_xActiveControl, pDialogSlots, aAdditionalFestures ); transferFeatureStatesToItemSet( aAdditionalFestures, *xCurrentItems, true ); - VclPtr<SfxTabDialog> xDialog ( _eSet == eCharAttribs - ? static_cast< SfxTabDialog* >( new TextControlCharAttribDialog( NULL, *xCurrentItems, *pFontList ) ) - : static_cast< SfxTabDialog* >( new TextControlParaAttribDialog( NULL, *xCurrentItems ) ) ); + VclPtr<SfxTabDialog> xDialog; + if ( _eSet == eCharAttribs) + xDialog = VclPtr<TextControlCharAttribDialog>::Create( nullptr, *xCurrentItems, *pFontList ); + else + xDialog = VclPtr<TextControlParaAttribDialog>::Create( nullptr, *xCurrentItems ); if ( RET_OK == xDialog->Execute() ) { const SfxItemSet& rModifiedItems = *xDialog->GetOutputItemSet(); diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index e795a49fa9c6..b77ada083613 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -189,7 +189,7 @@ FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Wind SetHelpId( HID_FIELD_SEL_WIN ); SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); - pListBox = new FmFieldWinListBox( this ); + pListBox = VclPtr<FmFieldWinListBox>::Create( this ); pListBox->Show(); UpdateContent(NULL); SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); @@ -424,7 +424,7 @@ FmFieldWinMgr::FmFieldWinMgr(vcl::Window* _pParent, sal_uInt16 _nId, SfxBindings* _pBindings, SfxChildWinInfo* _pInfo) :SfxChildWindow(_pParent, _nId) { - pWindow = new FmFieldWin(_pBindings, this, _pParent); + pWindow = VclPtr<FmFieldWin>::Create(_pBindings, this, _pParent); SetHideNotDelete(true); eChildAlignment = SfxChildAlignment::NOALIGNMENT; static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( _pInfo ); diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index 6aad3312fd81..87e95aeb35f4 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -40,16 +40,18 @@ GalleryControl::GalleryControl ( vcl::Window* pParentWindow) : Window(pParentWindow, WB_SIZEABLE|WB_MOVEABLE|WB_CLOSEABLE|WB_HIDE), mpGallery (Gallery::GetGalleryInstance()), - mpSplitter(new GallerySplitter( + mpSplitter(VclPtr<GallerySplitter>::Create( + this, WB_HSCROLL, ::boost::bind(&GalleryControl::InitSettings, this))), - mpBrowser1(new GalleryBrowser1( + mpBrowser1(VclPtr<GalleryBrowser1>::Create( + this, mpGallery, ::boost::bind(&GalleryControl::GalleryKeyInput,this,_1,_2), ::boost::bind(&GalleryControl::ThemeSelectionHasChanged, this))), - mpBrowser2(new GalleryBrowser2(this, mpGallery)), + mpBrowser2(VclPtr<GalleryBrowser2>::Create(this, mpGallery)), maLastSize(GetOutputSizePixel()), mbIsInitialResize(true) { diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 6d18452dfd39..78e12a5c5cbe 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -111,8 +111,8 @@ GalleryBrowser1::GalleryBrowser1( const ::boost::function<void(void)>& rThemeSlectionHandler) : Control ( pParent, WB_TABSTOP ), - maNewTheme ( new GalleryButton(this, WB_3DLOOK) ), - mpThemes ( new GalleryThemeListBox( this, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_HSCROLL | WB_VSCROLL | WB_AUTOHSCROLL | WB_SORT ) ), + maNewTheme ( VclPtr<GalleryButton>::Create(this, WB_3DLOOK) ), + mpThemes ( VclPtr<GalleryThemeListBox>::Create( this, WB_TABSTOP | WB_3DLOOK | WB_BORDER | WB_HSCROLL | WB_VSCROLL | WB_AUTOHSCROLL | WB_SORT ) ), mpGallery ( pGallery ), mpExchangeData ( new ExchangeData ), mpThemePropsDlgItemSet( NULL ), diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 6e3a3309208c..5c8cbc6d3b27 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -414,12 +414,12 @@ GalleryBrowser2::GalleryBrowser2( vcl::Window* pParent, Gallery* pGallery ) : Control ( pParent, WB_TABSTOP ), mpGallery ( pGallery ), mpCurTheme ( NULL ), - mpIconView ( new GalleryIconView( this, NULL ) ), - mpListView ( new GalleryListView( this, NULL ) ), - mpPreview ( new GalleryPreview(this) ), - maViewBox ( new GalleryToolBox(this) ), - maSeparator ( new FixedLine(this, WB_VERT) ), - maInfoBar ( new FixedText(this, WB_LEFT | WB_VCENTER) ), + mpIconView ( VclPtr<GalleryIconView>::Create( this, nullptr ) ), + mpListView ( VclPtr<GalleryListView>::Create( this, nullptr ) ), + mpPreview ( VclPtr<GalleryPreview>::Create(this) ), + maViewBox ( VclPtr<GalleryToolBox>::Create(this) ), + maSeparator ( VclPtr<FixedLine>::Create(this, WB_VERT) ), + maInfoBar ( VclPtr<FixedText>::Create(this, WB_LEFT | WB_VCENTER) ), mnCurActionPos ( 0xffffffff ), meMode ( GALLERYBROWSERMODE_NONE ), meLastMode ( GALLERYBROWSERMODE_NONE ) @@ -749,9 +749,9 @@ void GalleryBrowser2::SelectTheme( const OUString& rThemeName ) mpCurTheme = mpGallery->AcquireTheme( rThemeName, *this ); - mpIconView = new GalleryIconView( this, mpCurTheme ); - mpListView = new GalleryListView( this, mpCurTheme ); - mpPreview = new GalleryPreview( this, WB_TABSTOP | WB_BORDER, mpCurTheme ); + mpIconView = VclPtr<GalleryIconView>::Create( this, mpCurTheme ); + mpListView = VclPtr<GalleryListView>::Create( this, mpCurTheme ); + mpPreview = VclPtr<GalleryPreview>::Create( this, WB_TABSTOP | WB_BORDER, mpCurTheme ); mpIconView->SetAccessibleName(SVX_RESSTR(RID_SVXSTR_GALLERY_THEMEITEMS)); mpListView->SetAccessibleName(SVX_RESSTR(RID_SVXSTR_GALLERY_THEMEITEMS)); diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx index 0df523fffa2d..1f0cd9554b49 100644 --- a/svx/source/inc/gridcell.hxx +++ b/svx/source/inc/gridcell.hxx @@ -562,7 +562,7 @@ public: virtual ::svt::CellControllerRef CreateController() const SAL_OVERRIDE; protected: - virtual SpinField* createField( + virtual VclPtr<SpinField> createField( vcl::Window* _pParent, WinBits _nFieldStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel @@ -584,7 +584,7 @@ protected: virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE; // DbSpinField - virtual SpinField* createField( + virtual VclPtr<SpinField> createField( vcl::Window* _pParent, WinBits _nFieldStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel @@ -609,7 +609,7 @@ protected: virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE; // DbSpinField - virtual SpinField* createField( + virtual VclPtr<SpinField> createField( vcl::Window* _pParent, WinBits _nFieldStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel @@ -638,7 +638,7 @@ protected: virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE; // DbSpinField - virtual SpinField* createField( + virtual VclPtr<SpinField> createField( vcl::Window* _pParent, WinBits _nFieldStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel @@ -663,7 +663,7 @@ protected: virtual void updateFromModel( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _rxModel ) SAL_OVERRIDE; // DbSpinField - virtual SpinField* createField( + virtual VclPtr<SpinField> createField( vcl::Window* _pParent, WinBits _nFieldStyle, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxModel diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index 4fa86884969b..58814b1efe48 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -381,8 +381,8 @@ namespace sdr const SdrModel* pModel, bool bRefreshWithPreRendering) : OverlayManager(rOutputDevice, pModel), - mpBufferDevice(new VirtualDevice()), - mpOutputBufferDevice(new VirtualDevice()), + mpBufferDevice(VclPtr<VirtualDevice>::Create()), + mpOutputBufferDevice(VclPtr<VirtualDevice>::Create()), mbRefreshWithPreRendering(bRefreshWithPreRendering) { // Init timer diff --git a/svx/source/sidebar/EmptyPanel.cxx b/svx/source/sidebar/EmptyPanel.cxx index 16c8169391b8..caca1f3f5810 100644 --- a/svx/source/sidebar/EmptyPanel.cxx +++ b/svx/source/sidebar/EmptyPanel.cxx @@ -28,7 +28,7 @@ namespace svx { namespace sidebar { EmptyPanel::EmptyPanel (vcl::Window* pParent) : Control(pParent, SVX_RES(RID_SIDEBAR_EMPTY_PANEL)), - maMessageControl(new FixedText(this, SVX_RES(FT_MESSAGE))) + maMessageControl(VclPtr<FixedText>::Create(this, SVX_RES(FT_MESSAGE))) { maMessageControl->setPosSizePixel(5,5, 250,15); maMessageControl->SetStyle(WB_WORDBREAK);// | WB_NOMNEMONICS); diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx index 2232e5f2b809..78d948e9a5e5 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx @@ -540,7 +540,8 @@ VclPtr<vcl::Window> AreaPropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to AreaPropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new AreaPropertyPanel( + VclPtr<AreaPropertyPanel>::Create( + pParent, rxFrame, pBindings), diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx index 76c5baf5ef04..f4c93218dbfc 100644 --- a/svx/source/sidebar/area/AreaPropertyPanel.hxx +++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx @@ -84,6 +84,12 @@ public: void SetGradient (const XGradient& rGradient); sal_Int32 GetSelectedTransparencyTypeIndex (void) const; + // constructor/destuctor + AreaPropertyPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings); + private: sal_uInt16 meLastXFS; @@ -150,12 +156,6 @@ private: VclPtr<PopupControl> CreateTransparencyGradientControl (PopupContainer* pParent); DECL_LINK( ClickTrGrHdl_Impl, ToolBox* ); - // constructor/destuctor - AreaPropertyPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings); - void SetupIcons(void); void Initialize(); void Update(); diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx index 880bb21a3c71..528ccfbedd26 100644 --- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx +++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx @@ -56,20 +56,20 @@ AreaTransparencyGradientControl::AreaTransparencyGradientControl ( vcl::Window* pParent, AreaPropertyPanel& rPanel) : PopupControl( pParent,SVX_RES(RID_POPUPPANEL_AREAPAGE_TRGR)), - maFtTrgrCenterX(new FixedText(this, SVX_RES(FT_TRGR_CENTER_X))), - maMtrTrgrCenterX(new MetricField(this, SVX_RES(MTR_TRGR_CENTER_X))), - maFtTrgrCenterY(new FixedText(this, SVX_RES(FT_TRGR_CENTER_Y))), - maMtrTrgrCenterY(new MetricField(this, SVX_RES(MTR_TRGR_CENTER_Y))), - maFtTrgrAngle(new FixedText(this, SVX_RES(FT_TRGR_ANGLE))), - maMtrTrgrAngle(new MetricField(this, SVX_RES(MTR_TRGR_ANGLE))), - maBtnLeft45(new ToolBox(this, SVX_RES(BTN_LEFT_SECOND))), - maBtnRight45(new ToolBox(this, SVX_RES(BTN_RIGHT_FIRST))), - maFtTrgrStartValue(new FixedText(this, SVX_RES(FT_TRGR_START_VALUE))), - maMtrTrgrStartValue(new MetricField(this, SVX_RES(MTR_TRGR_START_VALUE))), - maFtTrgrEndValue(new FixedText(this, SVX_RES(FT_TRGR_END_VALUE))), - maMtrTrgrEndValue(new MetricField(this, SVX_RES(MTR_TRGR_END_VALUE))), - maFtTrgrBorder(new FixedText(this, SVX_RES(FT_TRGR_BORDER))), - maMtrTrgrBorder(new MetricField(this, SVX_RES(MTR_TRGR_BORDER))), + maFtTrgrCenterX(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_X))), + maMtrTrgrCenterX(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_X))), + maFtTrgrCenterY(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_Y))), + maMtrTrgrCenterY(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_Y))), + maFtTrgrAngle(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_ANGLE))), + maMtrTrgrAngle(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_ANGLE))), + maBtnLeft45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_LEFT_SECOND))), + maBtnRight45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_RIGHT_FIRST))), + maFtTrgrStartValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_START_VALUE))), + maMtrTrgrStartValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_START_VALUE))), + maFtTrgrEndValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_END_VALUE))), + maMtrTrgrEndValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_END_VALUE))), + maFtTrgrBorder(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_BORDER))), + maMtrTrgrBorder(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_BORDER))), maRotLeft( SVX_RES(IMG_ROT_LEFT)), maRotRight( SVX_RES(IMG_ROT_RIGHT)), mrAreaPropertyPanel(rPanel), diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx index d0484166e285..81b0cac29732 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx @@ -255,7 +255,8 @@ VclPtr<vcl::Window> GraphicPropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to GraphicPropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new GraphicPropertyPanel( + VclPtr<GraphicPropertyPanel>::Create( + pParent, rxFrame, pBindings), diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx index 85b1d39c287d..c60f77793616 100644 --- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx +++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx @@ -58,6 +58,12 @@ public: SfxBindings* GetBindings() { return mpBindings;} + // constructor/destuctor + GraphicPropertyPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings); + private: //ui controls VclPtr<MetricField> mpMtrBrightness; @@ -96,12 +102,6 @@ private: DECL_LINK( BlueHdl, void*); DECL_LINK( GammaHdl, void*); - // constructor/destuctor - GraphicPropertyPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings); - void SetupIcons(void); void Initialize(); }; diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index f05c92affc51..b90165d701d0 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.cxx +++ b/svx/source/sidebar/line/LinePropertyPanel.cxx @@ -311,7 +311,7 @@ VclPtr<vcl::Window> LinePropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to LinePropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new LinePropertyPanel(pParent, rxFrame, pBindings), + VclPtr<LinePropertyPanel>::Create(pParent, rxFrame, pBindings), SAL_NO_ACQUIRE); } diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx index 626e2ac02b83..24fa30d4c7b2 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.hxx +++ b/svx/source/sidebar/line/LinePropertyPanel.hxx @@ -85,6 +85,12 @@ public: void EndLineWidthPopupMode (void); + // constructor/destuctor + LinePropertyPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings); + private: //ui controls VclPtr<FixedText> mpFTWidth; @@ -155,12 +161,6 @@ private: DECL_LINK(ChangeEdgeStyleHdl, void *); DECL_LINK(ChangeCapStyleHdl, void *); - // constructor/destuctor - LinePropertyPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings); - VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent); }; diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx index 00c9271bee4e..07663bd89e44 100644 --- a/svx/source/sidebar/line/LineWidthControl.cxx +++ b/svx/source/sidebar/line/LineWidthControl.cxx @@ -41,10 +41,10 @@ LineWidthControl::LineWidthControl ( : svx::sidebar::PopupControl(pParent,SVX_RES(RID_POPUPPANEL_LINEPAGE_WIDTH)), mrLinePropertyPanel(rPanel), mpBindings(NULL), - maVSWidth(new LineWidthValueSet(this, SVX_RES(VS_WIDTH))), - maFTCus( new FixedText(this, SVX_RES(FT_CUSTOME))), - maFTWidth( new FixedText(this, SVX_RES(FT_LINE_WIDTH))), - maMFWidth( new MetricField(this, SVX_RES(MF_WIDTH))), + maVSWidth(VclPtr<LineWidthValueSet>::Create(this, SVX_RES(VS_WIDTH))), + maFTCus( VclPtr<FixedText>::Create(this, SVX_RES(FT_CUSTOME))), + maFTWidth( VclPtr<FixedText>::Create(this, SVX_RES(FT_LINE_WIDTH))), + maMFWidth( VclPtr<MetricField>::Create(this, SVX_RES(MF_WIDTH))), meMapUnit(SFX_MAPUNIT_TWIP), rStr(NULL), mstrPT(SVX_RESSTR(STR_PT)), diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx index ffd2639d01c8..4041ef6a887a 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx @@ -44,7 +44,7 @@ SfxPopupWindowType ParaLineSpacingPopup::GetPopupWindowType() const VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow() { - ParaLineSpacingControl* pControl = new ParaLineSpacingControl(GetSlotId()); + VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId()); pControl->StartPopupMode(&GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 7dfb3f6c26f0..080558a55485 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -69,7 +69,8 @@ VclPtr<vcl::Window> ParaPropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to ParaPropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new ParaPropertyPanel( + VclPtr<ParaPropertyPanel>::Create( + pParent, rxFrame, pBindings, diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 9eddf1f4484b..fd866a1d23ee 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -66,6 +66,12 @@ public: FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ); + ParaPropertyPanel ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, + const css::uno::Reference<css::ui::XSidebar>& rxSidebar); + private: // UI controls //Alignment @@ -111,12 +117,6 @@ private: SfxBindings* mpBindings; css::uno::Reference<css::ui::XSidebar> mxSidebar; - ParaPropertyPanel ( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings, - const css::uno::Reference<css::ui::XSidebar>& rxSidebar); - DECL_LINK(ModifyIndentHdl_Impl, void*); DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*); DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*); diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index c9684c62c4b9..f675c30d08ce 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -261,7 +261,8 @@ VclPtr<vcl::Window> PosSizePropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to PosSizePropertyPanel::Create", NULL, 2); return VclPtr<vcl::Window>( - new PosSizePropertyPanel( + VclPtr<PosSizePropertyPanel>::Create( + pParent, rxFrame, pBindings, diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index a5148b660783..8ff88813a521 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -73,6 +73,13 @@ public: SfxBindings* GetBindings() { return mpBindings;} + // constructor/destuctor + PosSizePropertyPanel( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, + const css::uno::Reference<css::ui::XSidebar>& rxSidebar); + private: //Position VclPtr<FixedText> mpFtPosX; @@ -157,13 +164,6 @@ private: void executePosY(); void executeSize(); - // constructor/destuctor - PosSizePropertyPanel( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings, - const css::uno::Reference<css::ui::XSidebar>& rxSidebar); - void MetricState( SfxItemState eState, const SfxPoolItem* pState ); FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ); void DisableControls(); diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx index 8ec03f6726d8..bd1489431c3c 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx @@ -36,13 +36,13 @@ TextCharacterSpacingControl::TextCharacterSpacingControl ( : PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING)) , mrTextPropertyPanel(rPanel) , mpBindings(pBindings) -, maVSSpacing (new ValueSetWithTextControl(ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))) -, maLastCus (new FixedText(this, SVX_RES(FT_LASTCUSTOM))) +, maVSSpacing (VclPtr<ValueSetWithTextControl>::Create(ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))) +, maLastCus (VclPtr<FixedText>::Create(this, SVX_RES(FT_LASTCUSTOM))) //, maBorder (this, SVX_RES(CT_BORDER)) -, maFTSpacing (new FixedText(this, SVX_RES(FT_SPACING))) -, maLBKerning (new ListBox(this, SVX_RES(LB_KERNING))) -, maFTBy (new FixedText(this, SVX_RES(FT_BY))) -, maEditKerning (new MetricField(this, SVX_RES(ED_KERNING))) +, maFTSpacing (VclPtr<FixedText>::Create(this, SVX_RES(FT_SPACING))) +, maLBKerning (VclPtr<ListBox>::Create(this, SVX_RES(LB_KERNING))) +, maFTBy (VclPtr<FixedText>::Create(this, SVX_RES(FT_BY))) +, maEditKerning (VclPtr<MetricField>::Create(this, SVX_RES(ED_KERNING))) , mpImg (NULL) , mpImgSel (NULL) diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index af7c2b64ccdf..295e3e2409ad 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -76,7 +76,8 @@ VclPtr<vcl::Window> TextPropertyPanel::Create ( throw lang::IllegalArgumentException("no SfxBindings given to TextPropertyPanel::Create", NULL, 2); return VclPtr< vcl::Window >( - new TextPropertyPanel( + VclPtr<TextPropertyPanel>::Create( + pParent, rxFrame, pBindings, diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx index ee0abaa80005..a5abc475bbb5 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.hxx +++ b/svx/source/sidebar/text/TextPropertyPanel.hxx @@ -74,6 +74,12 @@ public: const SfxPoolItem* pState, const bool bIsEnabled) SAL_OVERRIDE; + TextPropertyPanel ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame, + SfxBindings* pBindings, + const ::sfx2::sidebar::EnumContext& rContext); + private: //ui controls VclPtr<ToolBox> mpToolBoxFont; @@ -100,13 +106,6 @@ private: ::sfx2::sidebar::EnumContext maContext; SfxBindings* mpBindings; - TextPropertyPanel ( - vcl::Window* pParent, - const css::uno::Reference<css::frame::XFrame>& rxFrame, - SfxBindings* pBindings, - const ::sfx2::sidebar::EnumContext& rContext); - - VclPtr<PopupControl> CreateCharacterSpacingControl (PopupContainer* pParent); VclPtr<PopupControl> CreateUnderlinePopupControl (PopupContainer* pParent); DECL_LINK(SpacingClickHdl, ToolBox*); diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx index f3cb5630b424..a0eae0efb4b2 100644 --- a/svx/source/sidebar/text/TextUnderlineControl.cxx +++ b/svx/source/sidebar/text/TextUnderlineControl.cxx @@ -35,8 +35,8 @@ TextUnderlineControl::TextUnderlineControl ( : svx::sidebar::PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_UNDERLINE)) , mrTextPropertyPanel(rPanel) , mpBindings(pBindings) -, maVSUnderline(new ValueSet(this, SVX_RES(VS_UNDERLINE))) -, maPBOptions (new PushButton(this, SVX_RES(PB_OPTIONS))) +, maVSUnderline(VclPtr<ValueSet>::Create(this, SVX_RES(VS_UNDERLINE))) +, maPBOptions (VclPtr<PushButton>::Create(this, SVX_RES(PB_OPTIONS))) , maIMGSingle (SVX_RES(IMG_SINGLE)) , maIMGDouble (SVX_RES(IMG_DOUBLE)) diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx index 91301c8cfca5..9cf7ebeb8cfe 100644 --- a/svx/source/sidebar/tools/Popup.cxx +++ b/svx/source/sidebar/tools/Popup.cxx @@ -103,7 +103,7 @@ void Popup::ProvideContainerAndControl (void) void Popup::CreateContainerAndControl (void) { - mxContainer.reset(new PopupContainer(mpParent)); + mxContainer.reset(VclPtr<PopupContainer>::Create(mpParent)); mxContainer->SetAccessibleName(msAccessibleName); mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler)); mxContainer->SetBorderStyle(mxContainer->GetBorderStyle() | WindowBorderStyle::MENU); |