From 40313fc3a21c9c2f6c62070ddc8d1512cc58b3c2 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 17 Apr 2015 21:49:00 +0100 Subject: reportdesign: convert new to ::Create. Change-Id: Iee14abd27f9f51ef5e054015a2b033f48cadc54b --- reportdesign/source/ui/dlg/AddField.cxx | 10 +++++----- reportdesign/source/ui/dlg/CondFormat.cxx | 4 ++-- reportdesign/source/ui/dlg/Condition.cxx | 4 ++-- reportdesign/source/ui/dlg/Formula.cxx | 2 +- reportdesign/source/ui/dlg/GroupsSorting.cxx | 4 ++-- reportdesign/source/ui/dlg/Navigator.cxx | 2 +- reportdesign/source/ui/report/DesignView.cxx | 12 ++++++------ reportdesign/source/ui/report/ReportController.cxx | 4 ++-- reportdesign/source/ui/report/ReportWindow.cxx | 4 ++-- reportdesign/source/ui/report/ScrollHelper.cxx | 8 ++++---- reportdesign/source/ui/report/SectionWindow.cxx | 8 ++++---- reportdesign/source/ui/report/StartMarker.cxx | 6 +++--- reportdesign/source/ui/report/ViewsWindow.cxx | 2 +- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index eda091e73a0f..5735e952e00d 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -158,11 +158,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent ,::comphelper::OPropertyChangeListener(m_aMutex) ,::comphelper::OContainerListener(m_aMutex) ,m_xRowSet(_xRowSet) - ,m_aActions(new ToolBox(this,ModuleRes(RID_TB_SORTING))) - ,m_pListBox(new OAddFieldWindowListBox( this )) - ,m_aFixedLine(new FixedLine(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) )) - ,m_aHelpText(new FixedText(this, ModuleRes(ADDFIELD_HELP_FIELD) )) - ,m_aInsertButton(new PushButton(this, WB_TABSTOP|WB_CENTER)) + ,m_aActions(VclPtr::Create(this,ModuleRes(RID_TB_SORTING))) + ,m_pListBox(VclPtr::Create( this )) + ,m_aFixedLine(VclPtr::Create(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) )) + ,m_aHelpText(VclPtr::Create(this, ModuleRes(ADDFIELD_HELP_FIELD) )) + ,m_aInsertButton(VclPtr::Create(this, WB_TABSTOP|WB_CENTER)) ,m_nCommandType(0) ,m_bEscapeProcessing(false) ,m_pChangeListener(NULL) diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index 7c59a31b864b..24e2bce7782f 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -192,7 +192,7 @@ namespace rptui ::comphelper::copyProperties(m_xCopy.get(),xCond.get()); m_xCopy->insertByIndex( _nNewCondIndex, makeAny( xCond ) ); - Condition *pCon( new Condition( m_pConditionPlayground, *this, m_rController ) ); + VclPtrInstance pCon( m_pConditionPlayground, *this, m_rController ); pCon->setCondition( xCond ); pCon->reorderWithinParent(_nNewCondIndex); m_aConditions.insert( m_aConditions.begin() + _nNewCondIndex, pCon ); @@ -351,7 +351,7 @@ namespace rptui sal_Int32 nCount = m_xCopy->getCount(); for ( sal_Int32 i = 0; i < nCount ; ++i ) { - Condition *pCon( new Condition( m_pConditionPlayground, *this, m_rController ) ); + VclPtrInstance pCon( m_pConditionPlayground, *this, m_rController ); Reference< XFormatCondition > xCond( m_xCopy->getByIndex(i), UNO_QUERY ); pCon->reorderWithinParent(i); pCon->setCondition( xCond ); diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index dacc9ce42c12..1ef8d1e7bf90 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -116,7 +116,7 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition) :FloatingWindow(_pParent, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL )) ,m_pCondition(_pCondition) ,m_nSlotId(0) -,m_aColorSet( new ValueSet(this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT)) ) +,m_aColorSet( VclPtr::Create(this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT)) ) { m_aColorSet->SetHelpId( HID_RPT_POPUP_COLOR_CTRL ); SetHelpId( HID_RPT_POPUP_COLOR ); @@ -338,7 +338,7 @@ IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ ) { sal_uInt16 nId( m_pActions->GetCurItemId() ); if ( !m_pColorFloat ) - m_pColorFloat = new OColorPopup(m_pActions,this); + m_pColorFloat = VclPtr::Create(m_pActions,this); sal_uInt16 nTextId = 0; if (nId == m_nFontColorId) diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index be924e61a42f..0854653fb21c 100644 --- a/reportdesign/source/ui/dlg/Formula.cxx +++ b/reportdesign/source/ui/dlg/Formula.cxx @@ -204,7 +204,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton) if ( !m_pAddField ) { - m_pAddField = new OAddFieldWindow(this,m_xRowSet); + m_pAddField = VclPtr::Create(this,m_xRowSet); m_pAddField->SetCreateHdl(LINK( this, FormulaDialog, OnClickHdl ) ); SvtViewOptions aDlgOpt( E_WINDOW, OUString( HID_RPT_FIELD_SEL_WIN ) ); if ( aDlgOpt.Exists() ) diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index b80b81dbae09..ae20ca0959b0 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -391,7 +391,7 @@ void OFieldExpressionControl::lateInit() InsertHandleColumn(static_cast(GetTextWidth(OUString('0')) * 4)/*, sal_True */); InsertDataColumn( FIELD_EXPRESSION, OUString(ModuleRes(STR_RPT_EXPRESSION)), 100); - m_pComboCell = new ComboBoxControl( &GetDataWindow() ); + m_pComboCell = VclPtr::Create( &GetDataWindow() ); m_pComboCell->SetSelectHdl(LINK(this,OFieldExpressionControl,CBChangeHdl)); m_pComboCell->SetHelpId(HID_RPT_FIELDEXPRESSION); @@ -975,7 +975,7 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl get(m_pHelpWindow, "helptext"); m_pHelpWindow->set_height_request(GetTextHeight() * 4); get(m_pProperties, "properties"); - m_pFieldExpression = new OFieldExpressionControl(this, get("box")); + m_pFieldExpression = VclPtr::Create(this, get("box")); m_pFieldExpression->set_hexpand(true); m_pFieldExpression->set_vexpand(true); diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index f3c745ea05be..9070372c189b 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -888,7 +888,7 @@ public: ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent) :m_xReport(_rController.getReportDefinition()) ,m_rController(_rController) - ,m_pNavigatorTree(new NavigatorTree(_pParent->get("box"),_rController)) + ,m_pNavigatorTree(VclPtr::Create(_pParent->get("box"),_rController)) { reportdesign::OReportVisitor aVisitor(m_pNavigatorTree.get()); aVisitor.start(m_xReport); diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 1cc4d1bccfac..698b065796f6 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -86,9 +86,9 @@ ODesignView::ODesignView( vcl::Window* pParent, const Reference< XComponentContext >& _rxOrb, OReportController& _rController) : ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL ) - ,m_aSplitWin(new SplitWindow(this)) + ,m_aSplitWin(VclPtr::Create(this)) ,m_rReportController( _rController ) - ,m_aScrollWindow(new rptui::OScrollWindowHelper(this)) + ,m_aScrollWindow(VclPtr::Create(this)) ,m_pPropWin(NULL) ,m_pAddField(NULL) ,m_pCurrentView(NULL) @@ -109,7 +109,7 @@ ODesignView::ODesignView( vcl::Window* pParent, SetMapMode( MapMode( MAP_100TH_MM ) ); // now create the task pane on the right side :-) - m_pTaskPane = new OTaskWindow(this); + m_pTaskPane = VclPtr::Create(this); m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET ); m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); @@ -440,7 +440,7 @@ void ODesignView::togglePropertyBrowser(bool _bToogleOn) { if ( !m_pPropWin && _bToogleOn ) { - m_pPropWin = new PropBrw(getController().getORB(), m_pTaskPane,this); + m_pPropWin = VclPtr::Create(getController().getORB(), m_pTaskPane,this); m_pPropWin->Invalidate(); static_cast(m_pTaskPane.get())->setPropertyBrowser(m_pPropWin); notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::AddWindow)); @@ -487,7 +487,7 @@ void ODesignView::toggleReportExplorer() if ( !m_pReportExplorer ) { OReportController& rReportController = getController(); - m_pReportExplorer = new ONavigator(this,rReportController); + m_pReportExplorer = VclPtr::Create(this,rReportController); SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) m_pReportExplorer->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); @@ -523,7 +523,7 @@ void ODesignView::toggleAddField() xReport = xSection->getReportDefinition(); } uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY); - m_pAddField = new OAddFieldWindow(this,xSet); + m_pAddField = VclPtr::Create(this,xSet); m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) ); SvtViewOptions aDlgOpt( E_WINDOW, OUString( UID_RPT_RPT_APP_VIEW ) ); if ( aDlgOpt.Exists() ) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 10a51a06c22f..b6fbbb2489d6 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -1782,7 +1782,7 @@ void OReportController::doOpenHelpAgent() bool OReportController::Construct(vcl::Window* pParent) { - ODesignView* pMyOwnView = new ODesignView( pParent, m_xContext, *this ); + VclPtrInstance pMyOwnView( pParent, m_xContext, *this ); StartListening( *pMyOwnView ); setView( *pMyOwnView ); @@ -2578,7 +2578,7 @@ void OReportController::openSortingAndGroupingDialog() return; if ( !m_pGroupsFloater ) { - m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this); + m_pGroupsFloater = VclPtr::Create(getView(),!isEditable(),this); SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pGroupsFloater->GetHelpId(), RTL_TEXTENCODING_UTF8)); if ( aDlgOpt.Exists() ) m_pGroupsFloater->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 7d06b7795ba0..d43d5584fe8e 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -58,10 +58,10 @@ using namespace ::comphelper; OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView) : Window(_pParent,WB_DIALOGCONTROL) , ::comphelper::OPropertyChangeListener(m_aMutex) -,m_aHRuler(new Ruler(this)) +,m_aHRuler(VclPtr::Create(this)) ,m_pView(_pView) ,m_pParent(_pParent) -,m_aViewsWindow(new rptui::OViewsWindow(this)) +,m_aViewsWindow(VclPtr::Create(this)) ,m_pObjFac( new DlgEdFactory() ) { SetHelpId(UID_RPT_REPORTWINDOW); diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index b05541eca9fe..ba789bc9f774 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -46,11 +46,11 @@ void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView) : OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL) ,OPropertyChangeListener(m_aMutex) - ,m_aHScroll( new ScrollBar(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) ) - ,m_aVScroll( new ScrollBar(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) ) - ,m_aCornerWin( new ScrollBarBox(this) ) + ,m_aHScroll( VclPtr::Create(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) ) + ,m_aVScroll( VclPtr::Create(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) ) + ,m_aCornerWin( VclPtr::Create(this) ) ,m_pParent(_pDesignView) - ,m_aReportWindow(new rptui::OReportWindow(this,m_pParent)) + ,m_aReportWindow(VclPtr::Create(this,m_pParent)) ,m_pReportDefintionMultiPlexer(NULL) { SetMapMode( MapMode( MAP_100TH_MM ) ); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 37a22873d296..bb37ceb4cdd4 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -48,10 +48,10 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep : Window( _pParent,WB_DIALOGCONTROL) ,OPropertyChangeListener(m_aMutex) ,m_pParent(_pParent) -,m_aStartMarker( new rptui::OStartMarker(this,_sColorEntry)) -,m_aReportSection( new rptui::OReportSection(this,_xSection)) -,m_aSplitter(new Splitter(this)) -,m_aEndMarker( new rptui::OEndMarker(this,_sColorEntry)) +,m_aStartMarker( VclPtr::Create(this,_sColorEntry)) +,m_aReportSection( VclPtr::Create(this,_xSection)) +,m_aSplitter(VclPtr::Create(this)) +,m_aEndMarker( VclPtr::Create(this,_sColorEntry)) { SetUniqueId(UID_RPT_SECTIONSWINDOW); const MapMode& rMapMode = _pParent->GetMapMode(); diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 06ae171a2baf..a435b02a38ed 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -48,9 +48,9 @@ oslInterlockedCount OStartMarker::s_nImageRefCount = 0; OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry) : OColorListener(_pParent,_sColorEntry) -,m_aVRuler(new Ruler(this,WB_VERT)) -,m_aText(new FixedText(this,WB_HYPHENATION)) -,m_aImage(new FixedImage(this,WB_LEFT|WB_TOP|WB_SCALE)) +,m_aVRuler(VclPtr::Create(this,WB_VERT)) +,m_aText(VclPtr::Create(this,WB_HYPHENATION)) +,m_aImage(VclPtr::Create(this,WB_LEFT|WB_TOP|WB_SCALE)) ,m_pParent(_pParent) ,m_bShowRuler(true) { diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 543a61254bcc..c1510eefd8e8 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -299,7 +299,7 @@ void OViewsWindow::DataChanged( const DataChangedEvent& rDCEvt ) void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition) { - OSectionWindow* pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) ); + VclPtrInstance pSectionWindow(this,_xSection,_sColorEntry); m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow)); m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size() == 1); Resize(); -- cgit