[Libreoffice-commits] core.git: Branch 'feature/vclptr' - chart2/source

Michael Meeks michael.meeks at collabora.com
Fri Apr 17 13:58:05 PDT 2015


 chart2/source/controller/dialogs/DataBrowser.cxx            |   14 ++++++------
 chart2/source/controller/dialogs/dlg_ChartType.cxx          |    3 +-
 chart2/source/controller/dialogs/dlg_CreationWizard.cxx     |    8 +++---
 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |    2 -
 chart2/source/controller/dialogs/dlg_DataEditor.cxx         |    2 -
 chart2/source/controller/dialogs/dlg_DataSource.cxx         |    6 ++---
 chart2/source/controller/dialogs/dlg_View3D.cxx             |    6 ++---
 chart2/source/controller/dialogs/tp_ChartType.cxx           |    4 +--
 chart2/source/controller/main/ChartController.cxx           |    2 -
 chart2/source/controller/main/ChartWindow.cxx               |    2 -
 chart2/source/controller/main/ElementSelector.cxx           |    2 -
 chart2/source/view/main/DrawModelWrapper.cxx                |    2 -
 12 files changed, 27 insertions(+), 26 deletions(-)

New commits:
commit 5ea025e63751c259956ae84b8edf8d4fe33663c2
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Fri Apr 17 22:01:46 2015 +0100

    chart2: convert new to ::Create.
    
    Change-Id: I14887bab5ced6e5915a8ecbc277017cec37a82ca

diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 937dd47..23fb47c 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -200,9 +200,9 @@ private:
 };
 
 SeriesHeader::SeriesHeader( vcl::Window * pParent, vcl::Window *pColorParent ) :
-        m_spSymbol( new FixedImage( pParent, WB_NOBORDER )),
-        m_spSeriesName( new SeriesHeaderEdit( pParent )),
-        m_spColorBar( new FixedText( pColorParent, WB_NOBORDER )),
+        m_spSymbol( VclPtr<FixedImage>::Create( pParent, WB_NOBORDER )),
+        m_spSeriesName( VclPtr<SeriesHeaderEdit>::Create( pParent )),
+        m_spColorBar( VclPtr<FixedText>::Create( pColorParent, WB_NOBORDER )),
         m_pDevice( pParent ),
         m_nStartCol( 0 ),
         m_nEndCol( 0 ),
@@ -453,8 +453,8 @@ DataBrowser::DataBrowser( vcl::Window* pParent, WinBits nStyle, bool bLiveUpdate
     m_bIsDirty( false ),
     m_bLiveUpdate( bLiveUpdate ),
     m_bDataValid( true ),
-    m_aNumberEditField( new FormattedField( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
-    m_aTextEditField( new Edit( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
+    m_aNumberEditField( VclPtr<FormattedField>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
+    m_aTextEditField( VclPtr<Edit>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
     m_rNumberEditController( new ::svt::FormattedFieldCellController( m_aNumberEditField.get() )),
     m_rTextEditController( new ::svt::EditCellController( m_aTextEditField.get() ))
 {
@@ -766,9 +766,9 @@ void DataBrowser::ShowWarningBox()
 
 bool DataBrowser::ShowQueryBox()
 {
-    QueryBox* pQueryBox = new QueryBox(this, WB_YES_NO, SCH_RESSTR(STR_DATA_EDITOR_INCORRECT_INPUT));
+    ScopedVclPtrInstance<QueryBox> pQueryBox(this, WB_YES_NO, SCH_RESSTR(STR_DATA_EDITOR_INCORRECT_INPUT));
 
-    return ( pQueryBox->Execute() == RET_YES );
+    return pQueryBox->Execute() == RET_YES;
 }
 
 bool DataBrowser::IsDataValid()
diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx
index 57a0580..073d194 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx
@@ -42,7 +42,8 @@ ChartTypeDialog::ChartTypeDialog( vcl::Window* pParent
     , m_xChartModel(xChartModel)
     , m_xCC( xContext )
 {
-    m_pChartTypeTabPage = new ChartTypeTabPage(
+    m_pChartTypeTabPage = VclPtr<ChartTypeTabPage>::Create(
+
         get_content_area(),
         uno::Reference<XChartDocument>::query(m_xChartModel),
         m_xCC,
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index 8259a16..4584112 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -117,7 +117,7 @@ svt::OWizardPage* CreationWizard::createPage(WizardState nState)
     case STATE_CHARTTYPE:
         {
         m_aTimerTriggeredControllerLock.startTimer();
-        ChartTypeTabPage* pChartTypeTabPage = new ChartTypeTabPage(this,m_xChartModel,m_xCC,bDoLiveUpdate);
+        VclPtrInstance<ChartTypeTabPage> pChartTypeTabPage(this,m_xChartModel,m_xCC,bDoLiveUpdate);
         pRet  = pChartTypeTabPage;
         m_pTemplateProvider = pChartTypeTabPage;
         if (m_pDialogModel)
@@ -127,18 +127,18 @@ svt::OWizardPage* CreationWizard::createPage(WizardState nState)
     case STATE_SIMPLE_RANGE:
         {
         m_aTimerTriggeredControllerLock.startTimer();
-        pRet = new RangeChooserTabPage(this, *m_pDialogModel, m_pTemplateProvider, this);
+        pRet = VclPtr<RangeChooserTabPage>::Create(this, *m_pDialogModel, m_pTemplateProvider, this);
         }
         break;
     case STATE_DATA_SERIES:
         {
         m_aTimerTriggeredControllerLock.startTimer();
-        pRet = new DataSourceTabPage(this, *m_pDialogModel, m_pTemplateProvider, this);
+        pRet = VclPtr<DataSourceTabPage>::Create(this, *m_pDialogModel, m_pTemplateProvider, this);
         }
         break;
     case STATE_OBJECTS:
         {
-        pRet  = new TitlesAndObjectsTabPage(this,m_xChartModel,m_xCC);
+        pRet  = VclPtr<TitlesAndObjectsTabPage>::Create(this,m_xChartModel,m_xCC);
         m_aTimerTriggeredControllerLock.startTimer();
         }
         break;
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 5c8bc2b..2685112 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -212,7 +212,7 @@ void CreationWizardUnoDlg::createDialogOnDemand()
         uno::Reference< XComponent > xComp( this );
         if( m_xChartModel.is() )
         {
-            m_pDialog = new CreationWizard( pParent, m_xChartModel, m_xCC );
+            m_pDialog = VclPtr<CreationWizard>::Create( pParent, m_xChartModel, m_xCC );
             m_pDialog->AddEventListener( LINK( this, CreationWizardUnoDlg, DialogEventHdl ) );
         }
     }
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
index e3cb545..4f4ce2f 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
@@ -48,7 +48,7 @@ DataEditor::DataEditor(vcl::Window* pParent,
     , m_xChartDoc(xChartDoc)
     , m_xContext(xContext)
 {
-    m_xBrwData.reset(new DataBrowser(get<vcl::Window>("datawindow"), WB_BORDER | WB_TABSTOP, true /* bLiveUpdate */));
+    m_xBrwData.reset(VclPtr<DataBrowser>::Create(get<vcl::Window>("datawindow"), WB_BORDER | WB_TABSTOP, true /* bLiveUpdate */));
     m_xBrwData->set_hexpand(true);
     m_xBrwData->set_vexpand(true);
     m_xBrwData->set_expand(true);
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index e285487..d0cb073 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -133,7 +133,7 @@ DataSourceDialog::DataSourceDialog(vcl::Window * pParent,
     , m_xContext(xContext)
     , m_apDocTemplateProvider(new DocumentChartTypeTemplateProvider(xChartDocument))
     , m_apDialogModel(new DialogModel(xChartDocument, xContext))
-    , m_pTabControl(new DataSourceTabControl(get_content_area()))
+    , m_pTabControl(VclPtr<DataSourceTabControl>::Create(get_content_area()))
     , m_pRangeChooserTabePage(0)
     , m_pDataSourceTabPage(0)
     , m_bRangeChooserTabIsValid(true)
@@ -143,9 +143,9 @@ DataSourceDialog::DataSourceDialog(vcl::Window * pParent,
 
     m_pTabControl->Show();
 
-    m_pRangeChooserTabePage = new RangeChooserTabPage( m_pTabControl, *(m_apDialogModel.get()),
+    m_pRangeChooserTabePage = VclPtr<RangeChooserTabPage>::Create( m_pTabControl, *(m_apDialogModel.get()),
                                      m_apDocTemplateProvider.get(), this, true /* bHideDescription */ );
-    m_pDataSourceTabPage = new DataSourceTabPage( m_pTabControl, *(m_apDialogModel.get()),
+    m_pDataSourceTabPage = VclPtr<DataSourceTabPage>::Create( m_pTabControl, *(m_apDialogModel.get()),
                                     m_apDocTemplateProvider.get(), this, true /* bHideDescription */ );
 
     m_pTabControl->InsertPage( TP_RANGECHOOSER, SCH_RESSTR(STR_PAGE_DATA_RANGE) );
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 13b5605..ec67eb8 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -49,9 +49,9 @@ View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XM
     get(m_pTabControl, "tabcontrol");
 
     uno::Reference< beans::XPropertySet > xSceneProperties( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
-    m_pGeometry   = new ThreeD_SceneGeometry_TabPage(m_pTabControl,xSceneProperties,m_aControllerLocker);
-    m_pAppearance = new ThreeD_SceneAppearance_TabPage(m_pTabControl,xChartModel,m_aControllerLocker);
-    m_pIllumination = new ThreeD_SceneIllumination_TabPage(m_pTabControl,xSceneProperties,xChartModel,pColorTable);
+    m_pGeometry   = VclPtr<ThreeD_SceneGeometry_TabPage>::Create(m_pTabControl,xSceneProperties,m_aControllerLocker);
+    m_pAppearance = VclPtr<ThreeD_SceneAppearance_TabPage>::Create(m_pTabControl,xChartModel,m_aControllerLocker);
+    m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::Create(m_pTabControl,xSceneProperties,xChartModel,pColorTable);
 
     m_pTabControl->InsertPage( TP_3D_SCENEGEOMETRY, SCH_RESSTR(STR_PAGE_PERSPECTIVE) );
     m_pTabControl->InsertPage( TP_3D_SCENEAPPEARANCE, SCH_RESSTR(STR_PAGE_APPEARANCE) );
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index d5eeb35..5a13c68 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -522,7 +522,7 @@ SplineResourceGroup::SplineResourceGroup(VclBuilderContainer* pWindow)
 SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog()
 {
     if( !m_pSplinePropertiesDialog.get() )
-        m_pSplinePropertiesDialog.reset( new SplinePropertiesDialog( m_pPB_DetailsDialog->GetParentDialog() ) );
+        m_pSplinePropertiesDialog.reset( VclPtr<SplinePropertiesDialog>::Create( m_pPB_DetailsDialog->GetParentDialog() ) );
     return *m_pSplinePropertiesDialog;
 }
 
@@ -530,7 +530,7 @@ SteppedPropertiesDialog& SplineResourceGroup::getSteppedPropertiesDialog()
 {
     if( !m_pSteppedPropertiesDialog.get() )
     {
-        m_pSteppedPropertiesDialog.reset( new SteppedPropertiesDialog( m_pPB_DetailsDialog->GetParentDialog() ) );
+        m_pSteppedPropertiesDialog.reset( VclPtr<SteppedPropertiesDialog>::Create( m_pPB_DetailsDialog->GetParentDialog() ) );
     }
     return *m_pSteppedPropertiesDialog;
 }
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index e185eca..9bf9826 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -388,7 +388,7 @@ void SAL_CALL ChartController::attachFrame(
     {
         // calls to VCL
         SolarMutexGuard aSolarGuard;
-        m_pChartWindow = new ChartWindow(this,pParent,pParent?pParent->GetStyle():0);
+        m_pChartWindow = VclPtr<ChartWindow>::Create(this,pParent,pParent?pParent->GetStyle():0);
         m_pChartWindow->SetBackground();//no Background
         m_xViewWindow = uno::Reference< awt::XWindow >( m_pChartWindow->GetComponentInterface(), uno::UNO_QUERY );
         m_pChartWindow->Show();
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 743745c..cd50dd3 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -49,7 +49,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
         : Window(pParent, nStyle)
         , m_pWindowController( pController )
         , m_bInPaint(false)
-        , m_pOpenGLWindow(new OpenGLWindow(this))
+        , m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this))
 {
     this->SetHelpId( HID_SCH_WIN_DOCUMENT );
     this->SetMapMode( MapMode(MAP_100TH_MM) );
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index b8f0c8e..732bf47 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -322,7 +322,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create
         vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
         if( pParent )
         {
-            m_apSelectorListBox.reset( new SelectorListBox( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
+            m_apSelectorListBox.reset( VclPtr<SelectorListBox>::Create( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
             ::Size aLogicalSize( 95, 160 );
             ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MAP_APPFONT );
             m_apSelectorListBox->SetSizePixel( aPixelSize );
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index c65af68..c9c1ba2 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -151,7 +151,7 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
     if( !pDefaultDevice )
         pDefaultDevice = Application::GetDefaultDevice();
     m_pRefDevice.disposeAndClear();
-    m_pRefDevice = new VirtualDevice(*pDefaultDevice);
+    m_pRefDevice = VclPtr<VirtualDevice>::Create(*pDefaultDevice);
     MapMode aMapMode = m_pRefDevice->GetMapMode();
     aMapMode.SetMapUnit(MAP_100TH_MM);
     m_pRefDevice->SetMapMode(aMapMode);


More information about the Libreoffice-commits mailing list