diff options
Diffstat (limited to 'chart2')
5 files changed, 49 insertions, 50 deletions
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index c0f2da11fccd..5bbe9f62bc8e 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -205,12 +205,12 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton ) aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey )); aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat )); - NumberFormatDialog aDlg(m_pWindow, aNumberSet); + VclPtr<NumberFormatDialog> aDlg(new NumberFormatDialog(m_pWindow, aNumberSet)); if( bPercent ) - aDlg.SetText( m_pFT_NumberFormatForPercent->GetText()); - if( RET_OK == aDlg.Execute() ) + aDlg->SetText( m_pFT_NumberFormatForPercent->GetText()); + if( RET_OK == aDlg->Execute() ) { - const SfxItemSet* pResult = aDlg.GetOutputItemSet(); + const SfxItemSet* pResult = aDlg->GetOutputItemSet(); if( pResult ) { bool bOldSource = rUseSourceFormat; diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 242fdf282915..6e6f3d177017 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1271,8 +1271,8 @@ void ChartController::executeDispatch_ChartType() SolarMutexGuard aSolarGuard; //prepare and open dialog - ChartTypeDialog aDlg( m_pChartWindow, getModel(), m_xCC ); - if( aDlg.Execute() == RET_OK ) + VclPtr<ChartTypeDialog> aDlg(new ChartTypeDialog( m_pChartWindow, getModel(), m_xCC )); + if( aDlg->Execute() == RET_OK ) { impl_adaptDataSeriesAutoResize(); aUndoGuard.commit(); @@ -1292,8 +1292,8 @@ void ChartController::executeDispatch_SourceData() if( xChartDoc.is()) { SolarMutexGuard aSolarGuard; - ::chart::DataSourceDialog aDlg( m_pChartWindow, xChartDoc, m_xCC ); - if( aDlg.Execute() == RET_OK ) + VclPtr<::chart::DataSourceDialog> aDlg(new ::chart::DataSourceDialog( m_pChartWindow, xChartDoc, m_xCC )); + if( aDlg->Execute() == RET_OK ) { impl_adaptDataSeriesAutoResize(); aUndoGuard.commit(); diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx index 9cba950495b9..3f8079a6165e 100644 --- a/chart2/source/controller/main/ChartController_EditData.cxx +++ b/chart2/source/controller/main/ChartController_EditData.cxx @@ -54,10 +54,9 @@ void ChartController::executeDispatch_EditData() UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData( SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ), m_xUndoManager ); - vcl::Window* pParent( NULL ); - DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC ); - if (aDataEditorDialog.Execute() == RET_OK) - aDataEditorDialog.ApplyChangesToModel(); + VclPtr<DataEditor> aDataEditorDialog(new DataEditor( nullptr, xChartDoc, m_xCC )); + if (aDataEditorDialog->Execute() == RET_OK) + aDataEditorDialog->ApplyChangesToModel(); aUndoGuard.commit(); } } diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 7c83ecc569fc..57a5d9df19b0 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -109,14 +109,14 @@ void ChartController::executeDispatch_InsertAxes() AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, true ); SolarMutexGuard aGuard; - SchAxisDlg aDlg( m_pChartWindow, aDialogInput ); - if( aDlg.Execute() == RET_OK ) + VclPtr<SchAxisDlg> aDlg(new SchAxisDlg( m_pChartWindow, aDialogInput )); + if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); InsertAxisOrGridDialogData aDialogOutput; - aDlg.getResult( aDialogOutput ); + aDlg->getResult( aDialogOutput ); boost::scoped_ptr< ReferenceSizeProvider > mpRefSizeProvider( impl_createReferenceSizeProvider()); bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram @@ -147,13 +147,13 @@ void ChartController::executeDispatch_InsertGrid() AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, false ); SolarMutexGuard aGuard; - SchGridDlg aDlg( m_pChartWindow, aDialogInput );//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY ); - if( aDlg.Execute() == RET_OK ) + VclPtr<SchGridDlg> aDlg(new SchGridDlg( m_pChartWindow, aDialogInput ));//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY ); + if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); InsertAxisOrGridDialogData aDialogOutput; - aDlg.getResult( aDialogOutput ); + aDlg->getResult( aDialogOutput ); bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC ); if( bChanged ) @@ -179,13 +179,13 @@ void ChartController::executeDispatch_InsertTitles() aDialogInput.readFromModel( getModel() ); SolarMutexGuard aGuard; - SchTitleDlg aDlg( m_pChartWindow, aDialogInput ); - if( aDlg.Execute() == RET_OK ) + VclPtr<SchTitleDlg> aDlg(new SchTitleDlg( m_pChartWindow, aDialogInput )); + if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); TitleDialogData aDialogOutput(impl_createReferenceSizeProvider()); - aDlg.getResult( aDialogOutput ); + aDlg->getResult( aDialogOutput ); bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput ); if( bChanged ) aUndoGuard.commit(); @@ -232,13 +232,13 @@ void ChartController::executeDispatch_OpenLegendDialog() { //prepare and open dialog SolarMutexGuard aGuard; - SchLegendDlg aDlg( m_pChartWindow, m_xCC ); - aDlg.init( getModel() ); - if( aDlg.Execute() == RET_OK ) + VclPtr<SchLegendDlg> aDlg(new SchLegendDlg( m_pChartWindow, m_xCC )); + aDlg->init( getModel() ); + if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); - bool bChanged = aDlg.writeToModel( getModel() ); + bool bChanged = aDlg->writeToModel( getModel() ); if( bChanged ) aUndoGuard.commit(); } @@ -292,12 +292,12 @@ void ChartController::executeDispatch_InsertMenu_DataLabels() NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier ); SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter(); - DataLabelsDialog aDlg( m_pChartWindow, aItemSet, pNumberFormatter); + VclPtr<DataLabelsDialog> aDlg(new DataLabelsDialog( m_pChartWindow, aItemSet, pNumberFormatter)); - if( aDlg.Execute() == RET_OK ) + if( aDlg->Execute() == RET_OK ) { SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); - aDlg.FillItemSet( aOutItemSet ); + aDlg->FillItemSet( aOutItemSet ); // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now @@ -397,14 +397,14 @@ void ChartController::executeDispatch_InsertTrendline() aDialogParameter.init( getModel() ); ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get()); SolarMutexGuard aGuard; - SchAttribTabDlg aDialog( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, - uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY )); + VclPtr<SchAttribTabDlg> aDialog(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, + uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ))); // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" - if( aDialog.Execute() == RET_OK || aDialog.DialogWasClosedWithOK()) + if( aDialog->Execute() == RET_OK || aDialog->DialogWasClosedWithOK()) { - const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet(); + const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet(); if( pOutItemSet ) { ControllerLockGuardUNO aCLGuard( getModel() ); @@ -452,17 +452,17 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) aDialogParameter.init( getModel() ); ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get()); SolarMutexGuard aGuard; - SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, - uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY )); - aDlg.SetAxisMinorStepWidthForErrorBarDecimals( + VclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, + uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ))); + aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, m_aSelection.getSelectedCID())); // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" - if( aDlg.Execute() == RET_OK || aDlg.DialogWasClosedWithOK()) + if( aDlg->Execute() == RET_OK || aDlg->DialogWasClosedWithOK()) { - const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet(); + const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet(); if( pOutItemSet ) { ControllerLockGuardUNO aCLGuard( getModel() ); @@ -489,18 +489,18 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) //prepare and open dialog SolarMutexGuard aGuard; - InsertErrorBarsDialog aDlg( + VclPtr<InsertErrorBarsDialog> aDlg(new InsertErrorBarsDialog( m_pChartWindow, aItemSet, uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ), - bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X); + bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X)); - aDlg.SetAxisMinorStepWidthForErrorBarDecimals( + aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) ); - if( aDlg.Execute() == RET_OK ) + if( aDlg->Execute() == RET_OK ) { SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); - aDlg.FillItemSet( aOutItemSet ); + aDlg->FillItemSet( aOutItemSet ); // lock controllers till end of block ControllerLockGuardUNO aCLGuard( getModel() ); diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index ca3dfa1c1d3b..d0676cd182d1 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -761,8 +761,8 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() ); SolarMutexGuard aGuard; - SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider - , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) ); + VclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider + , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) )); if(aDialogParameter.HasSymbolProperties()) { @@ -782,18 +782,18 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( sal_Int32 nStandardSymbol=0;//@todo get from somewhere Graphic* pAutoSymbolGraphic = new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties ) ); // note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic - aDlg.setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic ); + aDlg->setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic ); } if( aDialogParameter.HasStatisticProperties() ) { - aDlg.SetAxisMinorStepWidthForErrorBarDecimals( + aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, rObjectCID ) ); } //open the dialog - if (aDlg.Execute() == RET_OK || (bSuccessOnUnchanged && aDlg.DialogWasClosedWithOK())) + if (aDlg->Execute() == RET_OK || (bSuccessOnUnchanged && aDlg->DialogWasClosedWithOK())) { - const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet(); + const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet(); if(pOutItemSet) { ControllerLockGuardUNO aCLGuard( getModel()); @@ -822,8 +822,8 @@ void ChartController::executeDispatch_View3D() //open dialog SolarMutexGuard aSolarGuard; - View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() ); - if( aDlg.Execute() == RET_OK ) + VclPtr<View3DDialog> aDlg(new View3DDialog( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() )); + if( aDlg->Execute() == RET_OK ) aUndoGuard.commit(); } catch(const uno::RuntimeException& e) |