update dev300-m58
[ooovba.git] / chart2 / source / controller / main / ChartController_Insert.cxx
blob6130d428bde17530fe92e6417776fedbc3c1b6ac
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ChartController_Insert.cxx,v $
10 * $Revision: 1.16.44.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "ChartController.hxx"
35 #include "dlg_InsertAxis_Grid.hxx"
36 #include "dlg_InsertDataLabel.hxx"
37 #include "dlg_InsertLegend.hxx"
38 #include "dlg_InsertTrendline.hxx"
39 #include "dlg_InsertErrorBars.hxx"
40 #include "dlg_InsertTitle.hxx"
41 #include "dlg_ObjectProperties.hxx"
43 #include "ChartWindow.hxx"
44 #include "ChartModelHelper.hxx"
45 #include "AxisHelper.hxx"
46 #include "TitleHelper.hxx"
47 #include "DiagramHelper.hxx"
48 #include "macros.hxx"
49 #include "chartview/DrawModelWrapper.hxx"
50 #include "chartview/NumberFormatterWrapper.hxx"
51 #include "ViewElementListProvider.hxx"
52 #include "MultipleChartConverters.hxx"
53 #include "ControllerLockGuard.hxx"
54 #include "UndoGuard.hxx"
55 #include "ResId.hxx"
56 #include "Strings.hrc"
57 #include "ReferenceSizeProvider.hxx"
58 #include "ObjectIdentifier.hxx"
59 #include "RegressionCurveHelper.hxx"
60 #include "RegressionCurveItemConverter.hxx"
61 #include "StatisticsHelper.hxx"
62 #include "ErrorBarItemConverter.hxx"
63 #include "MultipleItemConverter.hxx"
65 #include <com/sun/star/chart2/XRegressionCurve.hpp>
66 #include <com/sun/star/chart/ErrorBarStyle.hpp>
67 #include <svx/ActionDescriptionProvider.hxx>
69 //--------------------------------------
71 // header for define RET_OK
72 #include <vcl/msgbox.hxx>
73 // header for class OUStringBuffer
74 #include <rtl/ustrbuf.hxx>
75 // header for class Application
76 #include <vcl/svapp.hxx>
77 // header for class ::vos::OGuard
78 #include <vos/mutex.hxx>
81 using namespace ::com::sun::star;
82 using namespace ::com::sun::star::chart2;
84 //.............................................................................
86 namespace
88 struct lcl_InsertMeanValueLine
90 public:
91 lcl_InsertMeanValueLine( const uno::Reference< uno::XComponentContext > & xContext ) :
92 m_xContext( xContext )
95 void operator()( const uno::Reference< chart2::XDataSeries > & xSeries )
97 uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
98 xSeries, uno::UNO_QUERY );
99 if( xRegCurveCnt.is())
101 ::chart::RegressionCurveHelper::addMeanValueLine(
102 xRegCurveCnt, m_xContext, uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ));
106 private:
107 uno::Reference< uno::XComponentContext > m_xContext;
110 } // anonymous namespace
112 //.............................................................................
113 namespace chart
115 //.............................................................................
117 void SAL_CALL ChartController::executeDispatch_InsertAxis()
119 UndoGuard aUndoGuard(
120 ActionDescriptionProvider::createDescription(
121 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AXES )))),
122 m_xUndoManager, m_aModel->getModel() );
126 InsertAxisOrGridDialogData aDialogInput;
127 uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram(m_aModel->getModel());
128 AxisHelper::getAxisOrGridExcistence( aDialogInput.aExistenceList, xDiagram, sal_True );
129 AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, sal_True );
131 ::vos::OGuard aGuard( Application::GetSolarMutex());
132 SchAxisDlg aDlg( m_pChartWindow, aDialogInput );
133 if( aDlg.Execute() == RET_OK )
135 // lock controllers till end of block
136 ControllerLockGuard aCLGuard( m_aModel->getModel());
138 InsertAxisOrGridDialogData aDialogOutput;
139 aDlg.getResult( aDialogOutput );
140 ::std::auto_ptr< ReferenceSizeProvider > mpRefSizeProvider(
141 impl_createReferenceSizeProvider());
142 bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram
143 , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC
144 , mpRefSizeProvider.get() );
145 if( bChanged )
146 aUndoGuard.commitAction();
149 catch( uno::RuntimeException& e)
151 ASSERT_EXCEPTION( e );
155 void SAL_CALL ChartController::executeDispatch_InsertGrid()
157 UndoGuard aUndoGuard(
158 ActionDescriptionProvider::createDescription(
159 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_GRIDS )))),
160 m_xUndoManager, m_aModel->getModel() );
164 InsertAxisOrGridDialogData aDialogInput;
165 uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram(m_aModel->getModel());
166 AxisHelper::getAxisOrGridExcistence( aDialogInput.aExistenceList, xDiagram, sal_False );
167 AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, sal_False );
169 ::vos::OGuard aGuard( Application::GetSolarMutex());
170 SchGridDlg aDlg( m_pChartWindow, aDialogInput );//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
171 if( aDlg.Execute() == RET_OK )
173 // lock controllers till end of block
174 ControllerLockGuard aCLGuard( m_aModel->getModel());
175 InsertAxisOrGridDialogData aDialogOutput;
176 aDlg.getResult( aDialogOutput );
177 bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
178 , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC );
179 if( bChanged )
180 aUndoGuard.commitAction();
183 catch( uno::RuntimeException& e)
185 ASSERT_EXCEPTION( e );
189 //-----------------------------------------------------------------------------
190 //-----------------------------------------------------------------------------
192 void SAL_CALL ChartController::executeDispatch_InsertTitle()
194 UndoGuard aUndoGuard(
195 ActionDescriptionProvider::createDescription(
196 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_TITLES )))),
197 m_xUndoManager, m_aModel->getModel() );
201 TitleDialogData aDialogInput;
202 aDialogInput.readFromModel( m_aModel->getModel() );
204 ::vos::OGuard aGuard( Application::GetSolarMutex());
205 SchTitleDlg aDlg( m_pChartWindow, aDialogInput );
206 if( aDlg.Execute() == RET_OK )
208 // lock controllers till end of block
209 ControllerLockGuard aCLGuard( m_aModel->getModel());
210 TitleDialogData aDialogOutput( impl_createReferenceSizeProvider());
211 aDlg.getResult( aDialogOutput );
212 bool bChanged = aDialogOutput.writeDifferenceToModel( m_aModel->getModel(), m_xCC, &aDialogInput );
213 if( bChanged )
214 aUndoGuard.commitAction();
217 catch( uno::RuntimeException& e)
219 ASSERT_EXCEPTION( e );
223 void SAL_CALL ChartController::executeDispatch_InsertLegend()
225 UndoGuard aUndoGuard(
226 ActionDescriptionProvider::createDescription(
227 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_LEGEND )))),
228 m_xUndoManager, m_aModel->getModel() );
232 //prepare and open dialog
233 ::vos::OGuard aGuard( Application::GetSolarMutex());
234 SchLegendDlg aDlg( m_pChartWindow, m_xCC );
235 aDlg.init( m_aModel->getModel() );
236 if( aDlg.Execute() == RET_OK )
238 // lock controllers till end of block
239 ControllerLockGuard aCLGuard( m_aModel->getModel() );
240 bool bChanged = aDlg.writeToModel( m_aModel->getModel() );
241 if( bChanged )
242 aUndoGuard.commitAction();
245 catch( uno::RuntimeException& e)
247 ASSERT_EXCEPTION( e );
251 //-----------------------------------------------------------------------------
252 //-----------------------------------------------------------------------------
254 void SAL_CALL ChartController::executeDispatch_InsertDataLabel()
256 UndoGuard aUndoGuard(
257 ActionDescriptionProvider::createDescription(
258 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_DATALABELS )))),
259 m_xUndoManager, m_aModel->getModel() );
263 wrapper::AllDataLabelItemConverter aItemConverter(
264 m_aModel->getModel(),
265 m_pDrawModelWrapper->GetItemPool(),
266 m_pDrawModelWrapper->getSdrModel(),
267 uno::Reference< lang::XMultiServiceFactory >( m_aModel->getModel(), uno::UNO_QUERY ));
268 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
269 aItemConverter.FillItemSet( aItemSet );
271 //prepare and open dialog
272 ::vos::OGuard aGuard( Application::GetSolarMutex());
274 //get number formatter
275 uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( m_aModel->getModel(), uno::UNO_QUERY );
276 NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
277 SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
279 DataLabelsDialog aDlg( m_pChartWindow, aItemSet, pNumberFormatter);
281 if( aDlg.Execute() == RET_OK )
283 SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
284 aDlg.FillItemSet( aOutItemSet );
285 // lock controllers till end of block
286 ControllerLockGuard aCLGuard( m_aModel->getModel());
287 bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
288 if( bChanged )
289 aUndoGuard.commitAction();
292 catch( uno::RuntimeException& e)
294 ASSERT_EXCEPTION( e );
298 void SAL_CALL ChartController::executeDispatch_InsertYErrorbars()
300 UndoGuard aUndoGuard(
301 ActionDescriptionProvider::createDescription(
302 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_PAGE_YERROR_BARS )))),
303 m_xUndoManager, m_aModel->getModel() );
307 wrapper::AllSeriesStatisticsConverter aItemConverter(
308 m_aModel->getModel(), m_pDrawModelWrapper->GetItemPool() );
309 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
310 aItemConverter.FillItemSet( aItemSet );
312 //prepare and open dialog
313 ::vos::OGuard aGuard( Application::GetSolarMutex());
314 InsertErrorBarsDialog aDlg(
315 m_pChartWindow, aItemSet,
316 uno::Reference< chart2::XChartDocument >( m_aModel->getModel(), uno::UNO_QUERY ));
317 aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
318 InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( m_aModel->getModel(), m_xChartView, rtl::OUString() ) );
320 if( aDlg.Execute() == RET_OK )
322 SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
323 aDlg.FillItemSet( aOutItemSet );
325 // lock controllers till end of block
326 ControllerLockGuard aCLGuard( m_aModel->getModel());
327 bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
328 if( bChanged )
329 aUndoGuard.commitAction();
332 catch( uno::RuntimeException& e)
334 ASSERT_EXCEPTION( e );
338 void SAL_CALL ChartController::executeDispatch_InsertMeanValue()
340 UndoGuard aUndoGuard(
341 ActionDescriptionProvider::createDescription(
342 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
343 m_xUndoManager, m_aModel->getModel());
344 lcl_InsertMeanValueLine( m_xCC ).operator()(
345 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()));
346 aUndoGuard.commitAction();
349 void SAL_CALL ChartController::executeDispatch_InsertMeanValues()
351 ::std::vector< uno::Reference< chart2::XDataSeries > > aSeries(
352 DiagramHelper::getDataSeriesFromDiagram( ChartModelHelper::findDiagram( m_aModel->getModel())));
353 UndoGuard aUndoGuard(
354 ActionDescriptionProvider::createDescription(
355 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
356 m_xUndoManager, m_aModel->getModel() );
357 ::std::for_each( aSeries.begin(), aSeries.end(), lcl_InsertMeanValueLine( m_xCC ));
358 aUndoGuard.commitAction();
361 void SAL_CALL ChartController::executeDispatch_InsertTrendlines()
363 UndoGuard aUndoGuard(
364 ActionDescriptionProvider::createDescription(
365 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVES )))),
366 m_xUndoManager, m_aModel->getModel() );
370 wrapper::AllSeriesStatisticsConverter aItemConverter(
371 m_aModel->getModel(), m_pDrawModelWrapper->GetItemPool() );
372 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
373 aItemConverter.FillItemSet( aItemSet );
375 //prepare and open dialog
376 ::vos::OGuard aGuard( Application::GetSolarMutex());
377 InsertTrendlineDialog aDlg( m_pChartWindow, aItemSet );
378 aDlg.adjustSize();
380 if( aDlg.Execute() == RET_OK )
382 SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
383 aDlg.FillItemSet( aOutItemSet );
385 // lock controllers till end of block
386 ControllerLockGuard aCLGuard( m_aModel->getModel());
387 bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
388 if( bChanged )
389 aUndoGuard.commitAction();
392 catch( uno::RuntimeException& e)
394 ASSERT_EXCEPTION( e );
398 void SAL_CALL ChartController::executeDispatch_InsertTrendline()
400 uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
401 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
402 if( xRegCurveCnt.is())
404 UndoLiveUpdateGuard aUndoGuard(
405 ActionDescriptionProvider::createDescription(
406 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
407 m_xUndoManager, m_aModel->getModel() );
409 // add a linear curve
410 RegressionCurveHelper::addRegressionCurve(
411 RegressionCurveHelper::REGRESSION_TYPE_LINEAR, xRegCurveCnt, m_xCC );
413 // get an appropriate item converter
414 uno::Reference< chart2::XRegressionCurve > xCurve(
415 RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ));
416 uno::Reference< beans::XPropertySet > xCurveProp( xCurve, uno::UNO_QUERY );
417 if( !xCurveProp.is())
418 return;
419 wrapper::RegressionCurveItemConverter aItemConverter(
420 xCurveProp, xRegCurveCnt, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
421 m_pDrawModelWrapper->getSdrModel(),
422 uno::Reference< lang::XMultiServiceFactory >( m_aModel->getModel(), uno::UNO_QUERY ));
424 // open dialog
425 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
426 aItemConverter.FillItemSet( aItemSet );
427 ObjectPropertiesDialogParameter aDialogParameter = ObjectPropertiesDialogParameter(
428 ObjectIdentifier::createDataCurveCID(
429 ObjectIdentifier::getSeriesParticleFromCID( m_aSelection.getSelectedCID()),
430 RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt, xCurve ), false ));
431 aDialogParameter.init( m_aModel->getModel() );
432 ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
433 ::vos::OGuard aGuard( Application::GetSolarMutex());
434 SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
435 uno::Reference< util::XNumberFormatsSupplier >( m_aModel->getModel(), uno::UNO_QUERY ));
437 // note: when a user pressed "OK" but didn't change any settings in the
438 // dialog, the SfxTabDialog returns "Cancel"
439 if( aDlg.Execute() == RET_OK || aDlg.DialogWasClosedWithOK())
441 const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
442 if( pOutItemSet )
444 ControllerLockGuard aCLGuard( m_aModel->getModel());
445 aItemConverter.ApplyItemSet( *pOutItemSet );
447 aUndoGuard.commitAction();
452 void SAL_CALL ChartController::executeDispatch_InsertYErrorbar()
454 uno::Reference< chart2::XDataSeries > xSeries(
455 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
456 if( xSeries.is())
458 UndoLiveUpdateGuard aUndoGuard(
459 ActionDescriptionProvider::createDescription(
460 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_ERROR_INDICATOR )))),
461 m_xUndoManager, m_aModel->getModel() );
463 // add error bars with standard deviation
464 uno::Reference< beans::XPropertySet > xErrorBarProp(
465 StatisticsHelper::addErrorBars( xSeries, m_xCC, ::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION ));
467 // get an appropriate item converter
468 wrapper::ErrorBarItemConverter aItemConverter(
469 m_aModel->getModel(), xErrorBarProp, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
470 m_pDrawModelWrapper->getSdrModel(),
471 uno::Reference< lang::XMultiServiceFactory >( m_aModel->getModel(), uno::UNO_QUERY ));
473 // open dialog
474 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
475 aItemConverter.FillItemSet( aItemSet );
476 ObjectPropertiesDialogParameter aDialogParameter = ObjectPropertiesDialogParameter(
477 ObjectIdentifier::createClassifiedIdentifierWithParent(
478 OBJECTTYPE_DATA_ERRORS, ::rtl::OUString(), m_aSelection.getSelectedCID()));
479 aDialogParameter.init( m_aModel->getModel() );
480 ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
481 ::vos::OGuard aGuard( Application::GetSolarMutex());
482 SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
483 uno::Reference< util::XNumberFormatsSupplier >( m_aModel->getModel(), uno::UNO_QUERY ));
484 aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
485 InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( m_aModel->getModel(), m_xChartView, m_aSelection.getSelectedCID()));
487 // note: when a user pressed "OK" but didn't change any settings in the
488 // dialog, the SfxTabDialog returns "Cancel"
489 if( aDlg.Execute() == RET_OK || aDlg.DialogWasClosedWithOK())
491 const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
492 if( pOutItemSet )
494 ControllerLockGuard aCLGuard( m_aModel->getModel());
495 aItemConverter.ApplyItemSet( *pOutItemSet );
497 aUndoGuard.commitAction();
502 void SAL_CALL ChartController::executeDispatch_InsertTrendlineEquation()
504 uno::Reference< chart2::XRegressionCurve > xRegCurve(
505 ObjectIdentifier::getObjectPropertySet( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
506 if( xRegCurve.is())
508 uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties());
509 if( xEqProp.is())
511 // using assignment for broken gcc 3.3
512 UndoGuard aUndoGuard = UndoGuard(
513 ActionDescriptionProvider::createDescription(
514 ActionDescriptionProvider::INSERT, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE_EQUATION )))),
515 m_xUndoManager, m_aModel->getModel() );
516 xEqProp->setPropertyValue( C2U("ShowEquation"), uno::makeAny( true ));
517 xEqProp->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( false ));
518 aUndoGuard.commitAction();
523 void SAL_CALL ChartController::executeDispatch_DeleteMeanValue()
525 uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
526 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
527 if( xRegCurveCnt.is())
529 UndoGuard aUndoGuard(
530 ActionDescriptionProvider::createDescription(
531 ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_AVERAGE_LINE )))),
532 m_xUndoManager, m_aModel->getModel());
533 RegressionCurveHelper::removeMeanValueLine( xRegCurveCnt );
534 aUndoGuard.commitAction();
538 void SAL_CALL ChartController::executeDispatch_DeleteTrendline()
540 uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
541 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()), uno::UNO_QUERY );
542 if( xRegCurveCnt.is())
544 UndoGuard aUndoGuard(
545 ActionDescriptionProvider::createDescription(
546 ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
547 m_xUndoManager, m_aModel->getModel());
548 RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCurveCnt );
549 aUndoGuard.commitAction();
553 void SAL_CALL ChartController::executeDispatch_DeleteYErrorbar()
555 uno::Reference< chart2::XDataSeries > xDataSeries(
556 ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), m_aModel->getModel()));
557 if( xDataSeries.is())
559 UndoGuard aUndoGuard(
560 ActionDescriptionProvider::createDescription(
561 ActionDescriptionProvider::DELETE, ::rtl::OUString( String( SchResId( STR_OBJECT_CURVE )))),
562 m_xUndoManager, m_aModel->getModel());
563 StatisticsHelper::removeErrorBars( xDataSeries );
564 aUndoGuard.commitAction();
569 //.............................................................................
570 } //namespace chart
571 //.............................................................................