LibreOffice Module chart2 (master) 1
ChartController_Insert.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <ChartController.hxx>
22#include <ChartView.hxx>
23
26#include <dlg_InsertLegend.hxx>
28#include <dlg_InsertTitle.hxx>
31
32#include <Axis.hxx>
33#include <AxisHelper.hxx>
34#include <TitleHelper.hxx>
35#include <DataSeries.hxx>
36#include <DiagramHelper.hxx>
37#include <Diagram.hxx>
38#include <GridProperties.hxx>
45#include "UndoGuard.hxx"
46#include <ResId.hxx>
47#include <strings.hrc>
49#include <ObjectIdentifier.hxx>
52#include <StatisticsHelper.hxx>
54#include <DataSeriesHelper.hxx>
56#include <Legend.hxx>
57#include <LegendHelper.hxx>
58#include <DataTable.hxx>
60
61#include <com/sun/star/chart2/XRegressionCurve.hpp>
62#include <com/sun/star/chart/ErrorBarStyle.hpp>
63#include <com/sun/star/beans/XPropertySet.hpp>
65
67#include <vcl/svapp.hxx>
68
69using namespace ::com::sun::star;
70using namespace ::com::sun::star::chart2;
71using ::com::sun::star::uno::Reference;
72using ::com::sun::star::uno::Sequence;
73
74namespace
75{
76
77void lcl_InsertMeanValueLine( const rtl::Reference< ::chart::DataSeries > & xSeries )
78{
79 if( xSeries.is())
80 {
82 xSeries, xSeries);
83 }
84}
85
86} // anonymous namespace
87
88namespace chart
89{
90
92{
93 UndoGuard aUndoGuard(
97
98 try
99 {
100 InsertAxisOrGridDialogData aDialogInput;
102 AxisHelper::getAxisOrGridExistence( aDialogInput.aExistenceList, xDiagram );
104
105 SolarMutexGuard aGuard;
106 SchAxisDlg aDlg(GetChartFrame(), aDialogInput);
107 if (aDlg.run() == RET_OK)
108 {
109 // lock controllers till end of block
111
112 InsertAxisOrGridDialogData aDialogOutput;
113 aDlg.getResult(aDialogOutput);
114 std::unique_ptr< ReferenceSizeProvider > pRefSizeProvider(
116 bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram
117 , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC
118 , pRefSizeProvider.get() );
119 if( bChanged )
120 aUndoGuard.commit();
121 }
122 }
123 catch(const uno::RuntimeException&)
124 {
125 TOOLS_WARN_EXCEPTION("chart2", "" );
126 }
127}
128
130{
131 UndoGuard aUndoGuard(
135
136 try
137 {
138 InsertAxisOrGridDialogData aDialogInput;
140 AxisHelper::getAxisOrGridExistence( aDialogInput.aExistenceList, xDiagram, false );
141 AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, false );
142
143 SolarMutexGuard aGuard;
144 SchGridDlg aDlg(GetChartFrame(), aDialogInput);//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
145 if (aDlg.run() == RET_OK)
146 {
147 // lock controllers till end of block
149 InsertAxisOrGridDialogData aDialogOutput;
150 aDlg.getResult( aDialogOutput );
151 bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
152 , aDialogInput.aExistenceList, aDialogOutput.aExistenceList );
153 if( bChanged )
154 aUndoGuard.commit();
155 }
156 }
157 catch(const uno::RuntimeException&)
158 {
159 TOOLS_WARN_EXCEPTION("chart2", "" );
160 }
161}
162
164{
165 SolarMutexGuard aGuard;
166
168 UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
169
171
173 {
174 // init values
176 auto xDataTable = xDiagram->getDataTable();
177 aData.mbShow = xDataTable.is();
178 if (xDataTable.is())
179 {
180 uno::Reference<beans::XPropertySet> xProperties(xDataTable, uno::UNO_QUERY);
181
182 uno::Any aAny = xProperties->getPropertyValue("HBorder");
183 if (aAny.has<bool>())
184 aData.mbHorizontalBorders = aAny.get<bool>();
185
186 aAny = xProperties->getPropertyValue("VBorder");
187 if (aAny.has<bool>())
188 aData.mbVerticalBorders = aAny.get<bool>();
189
190 aAny = xProperties->getPropertyValue("Outline");
191 if (aAny.has<bool>())
192 aData.mbOutline = aAny.get<bool>();
193
194 aAny = xProperties->getPropertyValue("Keys");
195 if (aAny.has<bool>())
196 aData.mbKeys = aAny.get<bool>();
197 }
198 aDialog.init(aData);
199 }
200
201 // show the dialog
202 if (aDialog.run() == RET_OK)
203 {
204 bool bChanged = false;
205
206 auto& rDialogData = aDialog.getDataTableDialogData();
207 auto xDataTable = xDiagram->getDataTable();
208 if (!rDialogData.mbShow && xDataTable.is())
209 {
210 xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
211 bChanged = true;
212 }
213 else if (rDialogData.mbShow && !xDataTable.is())
214 {
216 if (xNewDataTable.is())
217 {
218 xDiagram->setDataTable(xNewDataTable);
219 bChanged = true;
220 }
221 }
222
223 // Set the properties
224 xDataTable = xDiagram->getDataTable();
225 if (rDialogData.mbShow && xDataTable.is())
226 {
227 uno::Reference<beans::XPropertySet> xProperties(xDataTable, uno::UNO_QUERY);
228 xProperties->setPropertyValue("HBorder" , uno::Any(rDialogData.mbHorizontalBorders));
229 xProperties->setPropertyValue("VBorder" , uno::Any(rDialogData.mbVerticalBorders));
230 xProperties->setPropertyValue("Outline" , uno::Any(rDialogData.mbOutline));
231 xProperties->setPropertyValue("Keys" , uno::Any(rDialogData.mbKeys));
232 bChanged = true;
233 }
234
235 if (bChanged)
236 aUndoGuard.commit();
237 }
238}
239
242{
244 UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
245
246
248 auto xDataTable = xDiagram->getDataTable();
249 if (!xDataTable.is())
250 {
252 if (xNewDataTable.is())
253 {
254 xDiagram->setDataTable(xNewDataTable);
255 aUndoGuard.commit();
256 }
257 }
258}
259
262{
264 UndoGuard aUndoGuard(aUndoDescription, m_xUndoManager);
265
267 auto xDataTable = xDiagram->getDataTable();
268 if (xDataTable.is())
269 {
270 // insert a empty data table reference
271 xDiagram->setDataTable(uno::Reference<chart2::XDataTable>());
272 aUndoGuard.commit();
273 }
274}
275
277{
278 UndoGuard aUndoGuard(
282
283 try
284 {
285 TitleDialogData aDialogInput;
286 aDialogInput.readFromModel( getChartModel() );
287
288 SolarMutexGuard aGuard;
289 SchTitleDlg aDlg(GetChartFrame(), aDialogInput);
290 if (aDlg.run() == RET_OK)
291 {
292 // lock controllers till end of block
295 aDlg.getResult(aDialogOutput);
296 bool bChanged = aDialogOutput.writeDifferenceToModel( getChartModel(), m_xCC, &aDialogInput );
297 if( bChanged )
298 aUndoGuard.commit();
299 }
300 }
301 catch(const uno::RuntimeException&)
302 {
303 TOOLS_WARN_EXCEPTION("chart2", "" );
304 }
305}
306
308{
309 UndoGuard aUndoGuard(
313
315 aUndoGuard.commit();
316}
317
319{
320 UndoGuard aUndoGuard(
324
326 aUndoGuard.commit();
327}
328
330{
331 UndoGuard aUndoGuard(
335
336 try
337 {
338 //prepare and open dialog
339 SolarMutexGuard aGuard;
341 aDlg.init( getChartModel() );
342 if (aDlg.run() == RET_OK)
343 {
344 // lock controllers till end of block
346 aDlg.writeToModel( getChartModel() );
347 aUndoGuard.commit();
348 }
349 }
350 catch(const uno::RuntimeException&)
351 {
352 TOOLS_WARN_EXCEPTION("chart2", "" );
353 }
354}
355
357{
358 UndoGuard aUndoGuard(
362
363 //if a series is selected insert labels for that series only:
366 if( xSeries.is() )
367 {
368 // add labels
370
371 OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) + "=" );
374
375 bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, true );
376 if( bSuccess )
377 aUndoGuard.commit();
378 return;
379 }
380
381 try
382 {
385 m_pDrawModelWrapper->GetItemPool(),
386 m_pDrawModelWrapper->getSdrModel(),
387 getChartModel() );
388 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
389 aItemConverter.FillItemSet( aItemSet );
390
391 //prepare and open dialog
392 SolarMutexGuard aGuard;
393
394 //get number formatter
395 NumberFormatterWrapper aNumberFormatterWrapper( getChartModel() );
396 SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
397
398 DataLabelsDialog aDlg(GetChartFrame(), aItemSet, pNumberFormatter);
399
400 if (aDlg.run() == RET_OK)
401 {
402 SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
403 aDlg.FillItemSet(aOutItemSet);
404 // lock controllers till end of block
406 bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
407 if( bChanged )
408 aUndoGuard.commit();
409 }
410 }
411 catch(const uno::RuntimeException&)
412 {
413 TOOLS_WARN_EXCEPTION("chart2", "" );
414 }
415}
416
418{
419 UndoGuard aUndoGuard(
421 ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_AVERAGE_LINE )),
424 getChartModel() ) );
425 aUndoGuard.commit();
426}
427
429{
430 UndoGuard aUndoGuard(
432 ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_AVERAGE_LINE )),
434
437 if( xSeries.is() )
438 {
439 //if a series is selected insert mean value only for that series:
440 lcl_InsertMeanValueLine( xSeries );
441 }
442 else if (rtl::Reference<Diagram> xDiagram = getFirstDiagram())
443 {
444 std::vector< rtl::Reference< DataSeries > > aSeries =
445 xDiagram->getDataSeries();
446
447 for( const auto& xSrs : aSeries )
448 lcl_InsertMeanValueLine( xSrs );
449 }
450 aUndoGuard.commit();
451}
452
454{
455 OUString aCID = m_aSelection.getSelectedCID();
456
459
460 if( !xSeries.is() )
461 return;
462
464}
465
467{
468 rtl::Reference< DataSeries > xRegressionCurveContainer =
470
471 if( !xRegressionCurveContainer.is() )
472 return;
473
474 UndoLiveUpdateGuard aUndoGuard(
478
481 SvxChartRegress::Linear,
482 xRegressionCurveContainer );
483
484 if( !xCurve.is())
485 return;
486
488 xCurve, xRegressionCurveContainer, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
489 m_pDrawModelWrapper->getSdrModel(),
490 getChartModel() );
491
492 // open dialog
493 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
494 aItemConverter.FillItemSet( aItemSet );
495 ObjectPropertiesDialogParameter aDialogParameter(
498 RegressionCurveHelper::getRegressionCurveIndex( xRegressionCurveContainer, xCurve ), false ));
499 aDialogParameter.init( getChartModel() );
500 ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
501 SolarMutexGuard aGuard;
502 SchAttribTabDlg aDialog(
503 GetChartFrame(), &aItemSet, &aDialogParameter,
504 &aViewElementListProvider,
505 getChartModel() );
506
507 // note: when a user pressed "OK" but didn't change any settings in the
508 // dialog, the SfxTabDialog returns "Cancel"
509 if( aDialog.run() == RET_OK || aDialog.DialogWasClosedWithOK())
510 {
511 const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
512 if( pOutItemSet )
513 {
515 aItemConverter.ApplyItemSet( *pOutItemSet );
516 }
517 aUndoGuard.commit();
518 }
519}
520
522{
524
525 //if a series is selected insert error bars for that series only:
528
529 if( xSeries.is())
530 {
531 UndoLiveUpdateGuard aUndoGuard(
534 SchResId( bYError ? STR_OBJECT_ERROR_BARS_Y : STR_OBJECT_ERROR_BARS_X )),
536
537 // add error bars with standard deviation
540 css::chart::ErrorBarStyle::STANDARD_DEVIATION,
541 bYError));
542
543 // get an appropriate item converter
544 wrapper::ErrorBarItemConverter aItemConverter(
545 getChartModel(), xErrorBarProp, m_pDrawModelWrapper->getSdrModel().GetItemPool(),
546 m_pDrawModelWrapper->getSdrModel(),
547 getChartModel() );
548
549 // open dialog
550 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
551 aItemSet.Put(SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE,bYError));
552 aItemConverter.FillItemSet( aItemSet );
553 ObjectPropertiesDialogParameter aDialogParameter(
555 objType, u"", m_aSelection.getSelectedCID()));
556 aDialogParameter.init( getChartModel() );
557 ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
558 SolarMutexGuard aGuard;
559 SchAttribTabDlg aDlg(
560 GetChartFrame(), &aItemSet, &aDialogParameter,
561 &aViewElementListProvider,
562 getChartModel() );
566
567 // note: when a user pressed "OK" but didn't change any settings in the
568 // dialog, the SfxTabDialog returns "Cancel"
569 if (aDlg.run() == RET_OK || aDlg.DialogWasClosedWithOK())
570 {
571 const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
572 if( pOutItemSet )
573 {
575 aItemConverter.ApplyItemSet( *pOutItemSet );
576 }
577 aUndoGuard.commit();
578 }
579 }
580 else
581 {
582 //if no series is selected insert error bars for all series
583 UndoGuard aUndoGuard(
588
589 try
590 {
592 getChartModel(), m_pDrawModelWrapper->GetItemPool() );
593 SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
594 aItemConverter.FillItemSet( aItemSet );
595
596 //prepare and open dialog
597 SolarMutexGuard aGuard;
599 GetChartFrame(), aItemSet,
602
605
606 if (aDlg.run() == RET_OK)
607 {
608 SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
609 aDlg.FillItemSet( aOutItemSet );
610
611 // lock controllers till end of block
613 bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
614 if( bChanged )
615 aUndoGuard.commit();
616 }
617 }
618 catch(const uno::RuntimeException&)
619 {
620 TOOLS_WARN_EXCEPTION("chart2", "" );
621 }
622 }
623}
624
626{
629 if( !xRegCurve.is() )
630 {
631 rtl::Reference< DataSeries > xRegCurveCnt =
633 xRegCurve.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
634 }
635 if( !xRegCurve.is())
636 return;
637
638 uno::Reference< beans::XPropertySet > xEqProp( xRegCurve->getEquationProperties());
639 if( xEqProp.is())
640 {
641 UndoGuard aUndoGuard(
643 ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
645 xEqProp->setPropertyValue( "ShowEquation", uno::Any( true ));
646 xEqProp->setPropertyValue( "XName", uno::Any( OUString("x") ));
647 xEqProp->setPropertyValue( "YName", uno::Any( OUString("f(x)") ));
648 xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( bInsertR2 ));
649 aUndoGuard.commit();
650 }
651}
652
654{
657 if( xEqProp.is())
658 {
659 UndoGuard aUndoGuard(
661 ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
663 xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( true ));
664 aUndoGuard.commit();
665 }
666}
667
669{
672 if( xEqProp.is())
673 {
674 UndoGuard aUndoGuard(
676 ActionDescriptionProvider::ActionType::Insert, SchResId( STR_OBJECT_CURVE_EQUATION )),
678 xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::Any( false ));
679 aUndoGuard.commit();
680 }
681}
682
684{
685 rtl::Reference< DataSeries > xRegCurveCnt =
687 if( xRegCurveCnt.is())
688 {
689 UndoGuard aUndoGuard(
691 ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_AVERAGE_LINE )),
694 aUndoGuard.commit();
695 }
696}
697
699{
700 rtl::Reference< DataSeries > xRegCurveCnt =
702 if( xRegCurveCnt.is())
703 {
704 UndoGuard aUndoGuard(
709 aUndoGuard.commit();
710 }
711}
712
714{
715 rtl::Reference< DataSeries > xRegCurveCnt =
717 if( xRegCurveCnt.is())
718 {
719 UndoGuard aUndoGuard(
721 ActionDescriptionProvider::ActionType::Delete, SchResId( STR_OBJECT_CURVE_EQUATION )),
724 aUndoGuard.commit();
725 }
726}
727
729{
730 rtl::Reference< DataSeries > xDataSeries =
732 if( xDataSeries.is())
733 {
734 UndoGuard aUndoGuard(
738 StatisticsHelper::removeErrorBars( xDataSeries, bYError );
739 aUndoGuard.commit();
740 }
741}
742
744{
747 if( xSeries.is() )
748 {
750 SchResId( STR_OBJECT_DATALABELS )),
753 aUndoGuard.commit();
754 }
755}
756
758{
760 SchResId( STR_OBJECT_LABEL )),
763 aUndoGuard.commit();
764}
765
767{
770 if( xSeries.is() )
771 {
773 SchResId( STR_OBJECT_DATALABELS )),
776 aUndoGuard.commit();
777 }
778}
779
781{
783 SchResId( STR_OBJECT_LABEL )),
786 aUndoGuard.commit();
787}
788
790{
792 SchResId( STR_OBJECT_DATAPOINTS )),
795 if( xSeries.is() )
796 xSeries->resetAllDataPoints();
797 aUndoGuard.commit();
798}
800{
802 SchResId( STR_OBJECT_DATAPOINT )),
805 if( xSeries.is() )
806 {
808 xSeries->resetDataPoint( nPointIndex );
809 }
810 aUndoGuard.commit();
811}
812
814{
815 try
816 {
818 {
819 UndoGuard aUndoGuard(
823
825 sal_Int32 nDimensionIndex = -1;
826 sal_Int32 nCooSysIndex = -1;
827 sal_Int32 nAxisIndex = -1;
828 AxisHelper::getIndicesForAxis( xAxis, getFirstDiagram(), nCooSysIndex, nDimensionIndex, nAxisIndex );
829
831 if( nDimensionIndex==0 )
833 else if( nDimensionIndex==1 )
835 else
836 eTitleType = TitleHelper::Z_AXIS_TITLE;
837
838 std::unique_ptr< ReferenceSizeProvider > apRefSizeProvider( impl_createReferenceSizeProvider());
839 xTitle = TitleHelper::createTitle( eTitleType, ObjectNameProvider::getTitleNameByType(eTitleType), getChartModel(), m_xCC, apRefSizeProvider.get() );
840 aUndoGuard.commit();
841 }
842 }
843 catch(const uno::RuntimeException&)
844 {
845 TOOLS_WARN_EXCEPTION("chart2", "" );
846 }
847}
848
850{
851 UndoGuard aUndoGuard(
855
856 try
857 {
859 if( xAxis.is() )
860 {
862 aUndoGuard.commit();
863 }
864 }
865 catch(const uno::RuntimeException&)
866 {
867 TOOLS_WARN_EXCEPTION("chart2", "" );
868 }
869}
870
872{
873 UndoGuard aUndoGuard(
877
878 try
879 {
881 if( xAxis.is() )
882 {
884 aUndoGuard.commit();
885 }
886 }
887 catch(const uno::RuntimeException&)
888 {
889 TOOLS_WARN_EXCEPTION("chart2", "" );
890 }
891}
892
894{
895 UndoGuard aUndoGuard(
899
900 try
901 {
903 if( xAxis.is() )
904 {
905 AxisHelper::makeGridVisible( xAxis->getGridProperties2() );
906 aUndoGuard.commit();
907 }
908 }
909 catch(const uno::RuntimeException&)
910 {
911 TOOLS_WARN_EXCEPTION("chart2", "" );
912 }
913}
914
916{
917 UndoGuard aUndoGuard(
921
922 try
923 {
925 if( xAxis.is() )
926 {
927 AxisHelper::makeGridInvisible( xAxis->getGridProperties2() );
928 aUndoGuard.commit();
929 }
930 }
931 catch(const uno::RuntimeException&)
932 {
933 TOOLS_WARN_EXCEPTION("chart2", "" );
934 }
935}
936
938{
939 UndoGuard aUndoGuard(
943
944 try
945 {
947 if( xAxis.is() )
948 {
949 std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
950 for( rtl::Reference< GridProperties > const & props : aSubGrids)
952 aUndoGuard.commit();
953 }
954 }
955 catch(const uno::RuntimeException&)
956 {
957 TOOLS_WARN_EXCEPTION("chart2", "" );
958 }
959}
960
962{
963 UndoGuard aUndoGuard(
967
968 try
969 {
971 if( xAxis.is() )
972 {
973 std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
974 for( rtl::Reference< ::chart::GridProperties > const & props : aSubGrids)
976 aUndoGuard.commit();
977 }
978 }
979 catch(const uno::RuntimeException&)
980 {
981 TOOLS_WARN_EXCEPTION("chart2", "" );
982 }
983}
984
985} //namespace chart
986
987/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr TypedWhichId< SfxBoolItem > SCHATTR_STAT_ERRORBAR_TYPE(SCHATTR_STAT_START+9)
static OUString createDescription(ActionType eActionType, std::u16string_view rObjectName)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
static void makeAxisInvisible(const rtl::Reference< ::chart::Axis > &xAxis)
Definition: AxisHelper.cxx:467
static void getAxisOrGridExistence(css::uno::Sequence< sal_Bool > &rExistenceList, const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAxis=true)
Definition: AxisHelper.cxx:915
static void makeGridInvisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
Definition: AxisHelper.cxx:517
static void makeAxisVisible(const rtl::Reference< ::chart::Axis > &xAxis)
Definition: AxisHelper.cxx:442
static bool getIndicesForAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, sal_Int32 &rOutDimensionIndex, sal_Int32 &rOutAxisIndex)
static void makeGridVisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
Definition: AxisHelper.cxx:452
static void getAxisOrGridPossibilities(css::uno::Sequence< sal_Bool > &rPossibilityList, const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAxis=true)
Definition: AxisHelper.cxx:846
static bool changeVisibilityOfGrids(const rtl::Reference< ::chart::Diagram > &xDiagram, const css::uno::Sequence< sal_Bool > &rOldExistenceList, const css::uno::Sequence< sal_Bool > &rNewExistenceList)
Definition: AxisHelper.cxx:963
static bool changeVisibilityOfAxes(const rtl::Reference< ::chart::Diagram > &xDiagram, const css::uno::Sequence< sal_Bool > &rOldExistenceList, const css::uno::Sequence< sal_Bool > &rNewExistenceList, const css::uno::Reference< css::uno::XComponentContext > &xContext, ReferenceSizeProvider *pRefSizeProvider)
Definition: AxisHelper.cxx:940
void executeDispatch_DeleteErrorBars(bool bYError)
rtl::Reference<::chart::ChartModel > getChartModel()
css::uno::Reference< css::document::XUndoManager > m_xUndoManager
std::unique_ptr< ReferenceSizeProvider > impl_createReferenceSizeProvider()
std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper
rtl::Reference<::chart::ChartView > m_xChartView
weld::Window * GetChartFrame()
bool executeDlg_ObjectProperties_withoutUndoGuard(const OUString &rObjectCID, bool bSuccessOnUnchanged)
void executeDispatch_DeleteDataTable()
Delete a data table from the chart.
rtl::Reference<::chart::Diagram > getFirstDiagram()
void executeDispatch_InsertDataTable()
Create and insert a data table to the chart.
css::uno::Reference< css::uno::XComponentContext > m_xCC
void executeDispatch_InsertErrorBars(bool bYError)
void executeDispatch_InsertTrendlineEquation(bool bInsertR2=false)
This guard calls lockControllers at the given Model in the CTOR and unlockControllers in the DTOR.
void FillItemSet(SfxItemSet &rOutAttrs)
Data table implementation.
Definition: DataTable.hxx:32
The dialog to change the data table specific properties.
void init(DataTableDialogData const &rData)
Set the initial state of the data table properties.
DataTableDialogData & getDataTableDialogData()
Get the state of the data table properties from the dialog.
void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth)
void FillItemSet(SfxItemSet &rOutAttrs)
static double getAxisMinorStepWidthForErrorBarDecimals(const rtl::Reference<::chart::ChartModel > &xChartModel, const rtl::Reference<::chart::ChartView > &xChartView, std::u16string_view rSelectedObjectCID)
static rtl::Reference< ::chart::Legend > showLegend(ChartModel &rModel, const css::uno::Reference< css::uno::XComponentContext > &xContext)
static void hideLegend(ChartModel &rModel)
SvNumberFormatter * getSvNumberFormatter() const
static OUString getSeriesParticleFromCID(std::u16string_view rCID)
static rtl::Reference< ::chart::DataSeries > getDataSeriesForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static OUString getStringForType(ObjectType eObjectType)
static OUString createDataCurveCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine)
static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet(std::u16string_view rObjectCID, const rtl::Reference< ::chart::ChartModel > &xChartDocument)
static OUString createClassifiedIdentifierForParticles(std::u16string_view rParentParticle, std::u16string_view rChildParticle, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static rtl::Reference< ::chart::Axis > getAxisForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static sal_Int32 getIndexFromParticleOrCID(std::u16string_view rParticleOrCID)
static OUString createClassifiedIdentifierWithParent(enum ObjectType, std::u16string_view rParticleID, std::u16string_view rParentPartical, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static OUString getTitleNameByType(TitleHelper::eTitleType eType)
static OUString getName_ObjectForAllSeries(ObjectType eObjectType)
void init(const rtl::Reference<::chart::ChartModel > &xModel)
void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth)
void getResult(InsertAxisOrGridDialogData &rOutput)
void writeToModel(const rtl::Reference<::chart::ChartModel > &xChartModel) const
void init(const rtl::Reference<::chart::ChartModel > &xChartModel)
void getResult(TitleDialogData &rOutput)
OUString const & getSelectedCID() const
static rtl::Reference< ::chart::Title > createTitle(eTitleType nTitleIndex, const OUString &rTitleText, const rtl::Reference< ::chart::ChartModel > &xModel, const css::uno::Reference< css::uno::XComponentContext > &xContext, ReferenceSizeProvider *pRefSizeProvider=nullptr)
A guard which does nothing, unless you explicitly call commitAction.
Definition: UndoGuard.hxx:37
A guard which, in its destructor, restores the model state it found in the constructor.
Definition: UndoGuard.hxx:68
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
SfxItemSet CreateEmptyItemSet() const
creates an empty item set using the given pool or a common pool if empty (see GetItemPool) and allowi...
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
virtual short run()
#define TOOLS_WARN_EXCEPTION(area, stream)
float u
constexpr OUStringLiteral aData
OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint(const css::uno::Reference< css::beans::XPropertySet > &xPointPropertySet)
OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints(const rtl::Reference< ::chart::DataSeries > &xSeries)
OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints(const rtl::Reference< ::chart::DataSeries > &xSeries)
OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint(const css::uno::Reference< css::beans::XPropertySet > &xPointPropertySet)
OOO_DLLPUBLIC_CHARTTOOLS bool removeAllExceptMeanValueLine(rtl::Reference<::chart::DataSeries > const &xCurveContainer)
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference<::chart::RegressionCurveModel > getFirstCurveNotMeanValueLine(const css::uno::Reference< css::chart2::XRegressionCurveContainer > &xCurveContainer)
Returns the first regression curve found that is not of type mean-value line.
OOO_DLLPUBLIC_CHARTTOOLS void removeEquations(rtl::Reference<::chart::DataSeries > const &xCurveContainer)
OOO_DLLPUBLIC_CHARTTOOLS void removeMeanValueLine(css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xRegCnt)
OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getRegressionCurveIndex(const rtl::Reference<::chart::DataSeries > &xContainer, const rtl::Reference<::chart::RegressionCurveModel > &xCurve)
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference<::chart::RegressionCurveModel > addRegressionCurve(SvxChartRegress eType, css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xCurveContainer, const css::uno::Reference< css::beans::XPropertySet > &xPropertySource=css::uno::Reference< css::beans::XPropertySet >(), const css::uno::Reference< css::beans::XPropertySet > &xEquationProperties=css::uno::Reference< css::beans::XPropertySet >())
OOO_DLLPUBLIC_CHARTTOOLS void addMeanValueLine(css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xRegCnt, const css::uno::Reference< css::beans::XPropertySet > &xSeriesProp)
creates a mean-value line and adds it to the container.
OOO_DLLPUBLIC_CHARTTOOLS void removeErrorBars(const rtl::Reference< ::chart::DataSeries > &xDataSeries, bool bYError=true)
OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet > addErrorBars(const rtl::Reference< ::chart::DataSeries > &xDataSeries, sal_Int32 nStyle, bool bYError=true)
@ OBJECTTYPE_DATA_LABELS
@ OBJECTTYPE_DATA_ERRORS_X
@ OBJECTTYPE_DATA_ERRORS_Y
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
Definition: ResId.cxx:24
dictionary props
The data table properties (data) used by the dialog.
css::uno::Sequence< sal_Bool > aExistenceList
css::uno::Sequence< sal_Bool > aPossibilityList
bool writeDifferenceToModel(const rtl::Reference<::chart::ChartModel > &xChartModel, const css::uno::Reference< css::uno::XComponentContext > &xContext, const TitleDialogData *pOldState=nullptr)
void readFromModel(const rtl::Reference<::chart::ChartModel > &xChartModel)
RET_OK