Branch data Line data Source code
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 "ChartController.hxx"
21 : : #include "ChartWindow.hxx"
22 : : #include "chartview/DrawModelWrapper.hxx"
23 : : #include "ObjectIdentifier.hxx"
24 : : #include "chartview/ExplicitValueProvider.hxx"
25 : : #include "macros.hxx"
26 : : #include "dlg_ObjectProperties.hxx"
27 : : #include "dlg_View3D.hxx"
28 : : #include "dlg_InsertErrorBars.hxx"
29 : : #include "ViewElementListProvider.hxx"
30 : : #include "DataPointItemConverter.hxx"
31 : : #include "AxisItemConverter.hxx"
32 : : #include "MultipleChartConverters.hxx"
33 : : #include "TitleItemConverter.hxx"
34 : : #include "LegendItemConverter.hxx"
35 : : #include "RegressionCurveItemConverter.hxx"
36 : : #include "RegressionEquationItemConverter.hxx"
37 : : #include "ErrorBarItemConverter.hxx"
38 : : #include "ChartModelHelper.hxx"
39 : : #include "AxisHelper.hxx"
40 : : #include "TitleHelper.hxx"
41 : : #include "LegendHelper.hxx"
42 : : #include "ChartTypeHelper.hxx"
43 : : #include "ColorPerPointHelper.hxx"
44 : : #include "DiagramHelper.hxx"
45 : : #include "servicenames_charttypes.hxx"
46 : : #include "ControllerLockGuard.hxx"
47 : : #include "UndoGuard.hxx"
48 : : #include "ObjectNameProvider.hxx"
49 : : #include "ResId.hxx"
50 : : #include "Strings.hrc"
51 : : #include "ReferenceSizeProvider.hxx"
52 : : #include "RegressionCurveHelper.hxx"
53 : : #include <com/sun/star/chart2/XChartDocument.hpp>
54 : :
55 : : //for auto_ptr
56 : : #include <memory>
57 : :
58 : : // header for define RET_OK
59 : : #include <vcl/msgbox.hxx>
60 : : // for SolarMutex
61 : : #include <vcl/svapp.hxx>
62 : : #include <osl/mutex.hxx>
63 : : #include <svx/ActionDescriptionProvider.hxx>
64 : :
65 : : //.............................................................................
66 : : namespace chart
67 : : {
68 : : //.............................................................................
69 : : using namespace ::com::sun::star;
70 : : using namespace ::com::sun::star::chart2;
71 : : using ::com::sun::star::uno::Reference;
72 : : using ::rtl::OUString;
73 : :
74 : : namespace
75 : : {
76 : :
77 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
78 : 0 : ::comphelper::ItemConverter* createItemConverter(
79 : : const ::rtl::OUString & aObjectCID
80 : : , const uno::Reference< frame::XModel > & xChartModel
81 : : , const uno::Reference< uno::XComponentContext > & xContext
82 : : , SdrModel & rDrawModel
83 : : , NumberFormatterWrapper * pNumberFormatterWrapper = NULL
84 : : , ExplicitValueProvider * pExplicitValueProvider = NULL
85 : : , ::std::auto_ptr< ReferenceSizeProvider > pRefSizeProvider =
86 : : ::std::auto_ptr< ReferenceSizeProvider >()
87 : : )
88 : : {
89 : 0 : ::comphelper::ItemConverter* pItemConverter=NULL;
90 : :
91 : : //-------------------------------------------------------------
92 : : //get type of selected object
93 [ # # ]: 0 : ObjectType eObjectType = ObjectIdentifier::getObjectType( aObjectCID );
94 [ # # ]: 0 : if( OBJECTTYPE_UNKNOWN==eObjectType )
95 : : {
96 : : OSL_FAIL("unknown ObjectType");
97 : 0 : return NULL;
98 : : }
99 : :
100 [ # # ]: 0 : rtl::OUString aParticleID = ObjectIdentifier::getParticleID( aObjectCID );
101 [ # # ]: 0 : bool bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS"));
102 : : //-------------------------------------------------------------
103 [ # # ]: 0 : if( !bAffectsMultipleObjects )
104 : : {
105 : : uno::Reference< beans::XPropertySet > xObjectProperties =
106 [ # # ]: 0 : ObjectIdentifier::getObjectPropertySet( aObjectCID, xChartModel );
107 [ # # ]: 0 : if(!xObjectProperties.is())
108 : 0 : return NULL;
109 : : //create itemconverter for a single object
110 [ # # # # : 0 : switch(eObjectType)
# # # # #
# # # # #
# # ]
111 : : {
112 : : case OBJECTTYPE_PAGE:
113 : : pItemConverter = new wrapper::GraphicPropertyItemConverter(
114 : : xObjectProperties, rDrawModel.GetItemPool(),
115 : : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
116 [ # # ][ # # ]: 0 : wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES );
[ # # ]
117 : 0 : break;
118 : : case OBJECTTYPE_TITLE:
119 : : {
120 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
121 [ # # ]: 0 : if( pRefSizeProvider.get() )
122 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
123 : :
124 : : pItemConverter = new wrapper::TitleItemConverter( xObjectProperties,
125 : : rDrawModel.GetItemPool(), rDrawModel,
126 : : uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
127 [ # # ][ # # ]: 0 : pRefSize );
[ # # ]
128 : : }
129 : 0 : break;
130 : : case OBJECTTYPE_LEGEND:
131 : : {
132 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
133 [ # # ]: 0 : if( pRefSizeProvider.get() )
134 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
135 : :
136 : : pItemConverter = new wrapper::LegendItemConverter( xObjectProperties,
137 : : rDrawModel.GetItemPool(), rDrawModel,
138 : : uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
139 [ # # ][ # # ]: 0 : pRefSize );
[ # # ]
140 : : }
141 : 0 : break;
142 : : case OBJECTTYPE_LEGEND_ENTRY:
143 : 0 : break;
144 : : case OBJECTTYPE_DIAGRAM:
145 : 0 : break;
146 : : case OBJECTTYPE_DIAGRAM_WALL:
147 : : case OBJECTTYPE_DIAGRAM_FLOOR:
148 : : pItemConverter = new wrapper::GraphicPropertyItemConverter(
149 : : xObjectProperties, rDrawModel.GetItemPool(),
150 : : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
151 [ # # ][ # # ]: 0 : wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES );
[ # # ]
152 : 0 : break;
153 : : case OBJECTTYPE_AXIS:
154 : : {
155 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
156 [ # # ]: 0 : if( pRefSizeProvider.get() )
157 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
158 : :
159 : 0 : uno::Reference< beans::XPropertySet > xDiaProp;
160 [ # # ][ # # ]: 0 : xDiaProp.set( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
161 : :
162 : : // the second property set contains the property CoordinateOrigin
163 : : // nOriginIndex is the index of the corresponding index of the
164 : : // origin (x=0, y=1, z=2)
165 : :
166 [ # # ]: 0 : ExplicitScaleData aExplicitScale;
167 [ # # ]: 0 : ExplicitIncrementData aExplicitIncrement;
168 [ # # ]: 0 : if( pExplicitValueProvider )
169 : : pExplicitValueProvider->getExplicitValuesForAxis(
170 : : uno::Reference< XAxis >( xObjectProperties, uno::UNO_QUERY ),
171 [ # # ][ # # ]: 0 : aExplicitScale, aExplicitIncrement );
172 : :
173 : : pItemConverter = new wrapper::AxisItemConverter(
174 : : xObjectProperties, rDrawModel.GetItemPool(),
175 : : rDrawModel,
176 : : uno::Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY ),
177 : : &aExplicitScale, &aExplicitIncrement,
178 [ # # ][ # # ]: 0 : pRefSize );
[ # # ][ # # ]
179 : : }
180 : 0 : break;
181 : : case OBJECTTYPE_AXIS_UNITLABEL:
182 : 0 : break;
183 : : case OBJECTTYPE_DATA_LABELS:
184 : : case OBJECTTYPE_DATA_SERIES:
185 : : case OBJECTTYPE_DATA_LABEL:
186 : : case OBJECTTYPE_DATA_POINT:
187 : : {
188 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
189 [ # # ]: 0 : if( pRefSizeProvider.get() )
190 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
191 : :
192 : : wrapper::GraphicPropertyItemConverter::eGraphicObjectType eMapTo =
193 : 0 : wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT;
194 : :
195 [ # # ]: 0 : uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel );
196 [ # # ]: 0 : uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
197 : :
198 [ # # ]: 0 : uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
199 [ # # ]: 0 : sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
200 [ # # ][ # # ]: 0 : if( !ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount ) )
201 : 0 : eMapTo = wrapper::GraphicPropertyItemConverter::LINE_DATA_POINT;
202 : :
203 [ # # ][ # # ]: 0 : bool bDataSeries = ( eObjectType == OBJECTTYPE_DATA_SERIES || eObjectType == OBJECTTYPE_DATA_LABELS );
204 : :
205 : : //special color for pie chart:
206 : 0 : bool bUseSpecialFillColor = false;
207 : 0 : sal_Int32 nSpecialFillColor =0;
208 : 0 : sal_Int32 nPointIndex = -1; /*-1 for whole series*/
209 [ # # ]: 0 : if(!bDataSeries)
210 : : {
211 : 0 : nPointIndex = aParticleID.toInt32();
212 [ # # ]: 0 : uno::Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
213 : 0 : bool bVaryColorsByPoint = false;
214 [ # # # # ]: 0 : if( xSeriesProp.is() &&
[ # # ][ # # ]
215 [ # # ][ # # ]: 0 : (xSeriesProp->getPropertyValue(C2U("VaryColorsByPoint")) >>= bVaryColorsByPoint) &&
[ # # ][ # # ]
[ # # ]
[ # # # # ]
216 : : bVaryColorsByPoint )
217 : : {
218 [ # # ][ # # ]: 0 : if( !ColorPerPointHelper::hasPointOwnColor( xSeriesProp, nPointIndex, xObjectProperties ) )
219 : : {
220 : 0 : bUseSpecialFillColor = true;
221 : : OSL_ASSERT( xDiagram.is());
222 [ # # ][ # # ]: 0 : uno::Reference< XColorScheme > xColorScheme( xDiagram->getDefaultColorScheme() );
223 [ # # ]: 0 : if( xColorScheme.is())
224 [ # # ][ # # ]: 0 : nSpecialFillColor = xColorScheme->getColorByIndex( nPointIndex );
225 : : }
226 : 0 : }
227 : : }
228 [ # # ]: 0 : sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, xSeries, nPointIndex, xDiagram );
229 : : sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
230 [ # # ][ # # ]: 0 : xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
231 : :
232 : : pItemConverter = new wrapper::DataPointItemConverter( xChartModel, xContext,
233 : : xObjectProperties, xSeries, rDrawModel.GetItemPool(), rDrawModel,
234 : : pNumberFormatterWrapper,
235 : : uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
236 : : eMapTo, pRefSize, bDataSeries, bUseSpecialFillColor, nSpecialFillColor, false,
237 [ # # ][ # # ]: 0 : nNumberFormat, nPercentNumberFormat );
[ # # ]
238 : 0 : break;
239 : : }
240 : : case OBJECTTYPE_GRID:
241 : : case OBJECTTYPE_SUBGRID:
242 : : case OBJECTTYPE_DATA_AVERAGE_LINE:
243 : : pItemConverter = new wrapper::GraphicPropertyItemConverter(
244 : : xObjectProperties, rDrawModel.GetItemPool(),
245 : : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
246 [ # # ][ # # ]: 0 : wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES );
[ # # ]
247 : 0 : break;
248 : :
249 : : case OBJECTTYPE_DATA_ERRORS_X:
250 : : case OBJECTTYPE_DATA_ERRORS_Y:
251 : : case OBJECTTYPE_DATA_ERRORS_Z:
252 : : pItemConverter = new wrapper::ErrorBarItemConverter(
253 : : xChartModel, xObjectProperties, rDrawModel.GetItemPool(),
254 [ # # ][ # # ]: 0 : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ));
[ # # ]
255 : 0 : break;
256 : :
257 : : case OBJECTTYPE_DATA_CURVE:
258 : : pItemConverter = new wrapper::RegressionCurveItemConverter(
259 : : xObjectProperties, uno::Reference< chart2::XRegressionCurveContainer >(
260 : : ObjectIdentifier::getDataSeriesForCID( aObjectCID, xChartModel ), uno::UNO_QUERY ),
261 : : rDrawModel.GetItemPool(), rDrawModel,
262 [ # # ][ # # ]: 0 : uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ));
[ # # ][ # # ]
[ # # ]
263 : 0 : break;
264 : : case OBJECTTYPE_DATA_CURVE_EQUATION:
265 : : {
266 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
267 [ # # ]: 0 : if( pRefSizeProvider.get() )
268 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
269 : :
270 : : pItemConverter = new wrapper::RegressionEquationItemConverter(
271 : : xObjectProperties, rDrawModel.GetItemPool(), rDrawModel,
272 : : uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
273 [ # # ][ # # ]: 0 : pRefSize );
[ # # ]
274 : 0 : break;
275 : : }
276 : : case OBJECTTYPE_DATA_STOCK_RANGE:
277 : 0 : break;
278 : : case OBJECTTYPE_DATA_STOCK_LOSS:
279 : : case OBJECTTYPE_DATA_STOCK_GAIN:
280 : : pItemConverter = new wrapper::GraphicPropertyItemConverter(
281 : : xObjectProperties, rDrawModel.GetItemPool(),
282 : : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ),
283 [ # # ][ # # ]: 0 : wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES );
[ # # ]
284 : 0 : break;
285 : : default: //OBJECTTYPE_UNKNOWN
286 : 0 : break;
287 [ # # ]: 0 : }
288 : : }
289 : : else
290 : : {
291 : : //create itemconverter for a all objects of given type
292 [ # # # # ]: 0 : switch(eObjectType)
293 : : {
294 : : case OBJECTTYPE_TITLE:
295 : : pItemConverter = new wrapper::AllTitleItemConverter( xChartModel, rDrawModel.GetItemPool(),
296 [ # # ][ # # ]: 0 : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ));
[ # # ]
297 : 0 : break;
298 : : case OBJECTTYPE_AXIS:
299 : : {
300 : 0 : ::std::auto_ptr< awt::Size > pRefSize;
301 [ # # ]: 0 : if( pRefSizeProvider.get() )
302 [ # # ][ # # ]: 0 : pRefSize.reset( new awt::Size( pRefSizeProvider->getPageSize()));
303 : :
304 : : pItemConverter = new wrapper::AllAxisItemConverter( xChartModel, rDrawModel.GetItemPool(),
305 [ # # ][ # # ]: 0 : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ), pRefSize );
[ # # ]
306 : : }
307 : 0 : break;
308 : : case OBJECTTYPE_GRID:
309 : : case OBJECTTYPE_SUBGRID:
310 : : pItemConverter = new wrapper::AllGridItemConverter( xChartModel, rDrawModel.GetItemPool(),
311 [ # # ][ # # ]: 0 : rDrawModel, uno::Reference< lang::XMultiServiceFactory >( xChartModel, uno::UNO_QUERY ));
[ # # ]
312 : 0 : break;
313 : : default: //for this type it is not supported to change all elements at once
314 : 0 : break;
315 : : }
316 : :
317 : : }
318 : 0 : return pItemConverter;
319 : : }
320 : : SAL_WNODEPRECATED_DECLARATIONS_POP
321 : :
322 : 0 : rtl::OUString lcl_getTitleCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< frame::XModel > & xChartModel )
323 : : {
324 [ # # ]: 0 : if( rDispatchCommand.equals("AllTitles"))
325 [ # # ][ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_TITLE, C2U("ALLELEMENTS") );
326 : :
327 : 0 : TitleHelper::eTitleType nTitleType( TitleHelper::MAIN_TITLE );
328 [ # # ]: 0 : if( rDispatchCommand.equals("SubTitle") )
329 : 0 : nTitleType = TitleHelper::SUB_TITLE;
330 [ # # ]: 0 : else if( rDispatchCommand.equals("XTitle") )
331 : 0 : nTitleType = TitleHelper::X_AXIS_TITLE;
332 [ # # ]: 0 : else if( rDispatchCommand.equals("YTitle") )
333 : 0 : nTitleType = TitleHelper::Y_AXIS_TITLE;
334 [ # # ]: 0 : else if( rDispatchCommand.equals("ZTitle") )
335 : 0 : nTitleType = TitleHelper::Z_AXIS_TITLE;
336 [ # # ]: 0 : else if( rDispatchCommand.equals("SecondaryXTitle") )
337 : 0 : nTitleType = TitleHelper::SECONDARY_X_AXIS_TITLE;
338 [ # # ]: 0 : else if( rDispatchCommand.equals("SecondaryYTitle") )
339 : 0 : nTitleType = TitleHelper::SECONDARY_Y_AXIS_TITLE;
340 : :
341 [ # # ]: 0 : uno::Reference< XTitle > xTitle( TitleHelper::getTitle( nTitleType, xChartModel ) );
342 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel );
343 : : }
344 : :
345 : 0 : rtl::OUString lcl_getAxisCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< frame::XModel >& xChartModel )
346 : : {
347 [ # # ]: 0 : if( rDispatchCommand.equals("DiagramAxisAll"))
348 [ # # ][ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_AXIS, C2U("ALLELEMENTS") );
349 : :
350 : 0 : sal_Int32 nDimensionIndex=0;
351 : 0 : bool bMainAxis=true;
352 [ # # ]: 0 : if( rDispatchCommand.equals("DiagramAxisX"))
353 : : {
354 : 0 : nDimensionIndex=0; bMainAxis=true;
355 : : }
356 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramAxisY"))
357 : : {
358 : 0 : nDimensionIndex=1; bMainAxis=true;
359 : : }
360 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramAxisZ"))
361 : : {
362 : 0 : nDimensionIndex=2; bMainAxis=true;
363 : : }
364 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramAxisA"))
365 : : {
366 : 0 : nDimensionIndex=0; bMainAxis=false;
367 : : }
368 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramAxisB"))
369 : : {
370 : 0 : nDimensionIndex=1; bMainAxis=false;
371 : : }
372 : :
373 [ # # ]: 0 : uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
374 [ # # ]: 0 : uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
375 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel );
376 : : }
377 : :
378 : 0 : rtl::OUString lcl_getGridCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< frame::XModel >& xChartModel )
379 : : {
380 [ # # ]: 0 : uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
381 : :
382 [ # # ]: 0 : if( rDispatchCommand.equals("DiagramGridAll"))
383 [ # # ][ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_GRID, C2U("ALLELEMENTS") );
384 : :
385 : 0 : sal_Int32 nDimensionIndex=0;
386 : 0 : bool bMainGrid=true;
387 : :
388 : : //x and y is swapped in the commands
389 : :
390 [ # # ]: 0 : if( rDispatchCommand.equals("DiagramGridYMain"))
391 : : {
392 : 0 : nDimensionIndex=0; bMainGrid=true;
393 : : }
394 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramGridXMain"))
395 : : {
396 : 0 : nDimensionIndex=1; bMainGrid=true;
397 : : }
398 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramGridZMain"))
399 : : {
400 : 0 : nDimensionIndex=2; bMainGrid=true;
401 : : }
402 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramGridYHelp"))
403 : : {
404 : 0 : nDimensionIndex=0; bMainGrid=false;
405 : : }
406 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramGridXHelp"))
407 : : {
408 : 0 : nDimensionIndex=1; bMainGrid=false;
409 : : }
410 [ # # ]: 0 : else if( rDispatchCommand.equals("DiagramGridZHelp"))
411 : : {
412 : 0 : nDimensionIndex=2; bMainGrid=false;
413 : : }
414 : :
415 : 0 : bool bMainAxis = true;
416 [ # # ]: 0 : uno::Reference< XAxis > xAxis( AxisHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ) );
417 : :
418 [ # # ]: 0 : sal_Int32 nSubGridIndex= bMainGrid ? (-1) : 0;
419 [ # # ]: 0 : rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, nSubGridIndex ) );
420 : 0 : return aCID;
421 : : }
422 : :
423 : 0 : rtl::OUString lcl_getErrorCIDForCommand( const ObjectType eDispatchType, const ObjectType &eSelectedType, const ::rtl::OUString &rSelectedCID)
424 : : {
425 [ # # ]: 0 : if( eSelectedType == eDispatchType )
426 : 0 : return rSelectedCID;
427 : :
428 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierWithParent( eDispatchType, ::rtl::OUString(), rSelectedCID );
429 : : }
430 : :
431 : 0 : rtl::OUString lcl_getObjectCIDForCommand( const ::rtl::OString& rDispatchCommand, const uno::Reference< XChartDocument > & xChartDocument, const rtl::OUString& rSelectedCID )
432 : : {
433 : 0 : ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
434 : 0 : rtl::OUString aParticleID;
435 : :
436 [ # # ]: 0 : uno::Reference< frame::XModel > xChartModel( xChartDocument, uno::UNO_QUERY );
437 [ # # ]: 0 : const ObjectType eSelectedType = ObjectIdentifier::getObjectType( rSelectedCID );
438 [ # # ]: 0 : uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( rSelectedCID, xChartModel );
439 [ # # ]: 0 : uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xSeries, uno::UNO_QUERY );
440 : :
441 : : //-------------------------------------------------------------------------
442 : : //legend
443 [ # # ][ # # ]: 0 : if( rDispatchCommand.equals("Legend") || rDispatchCommand.equals("FormatLegend") )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
444 : : {
445 : 0 : eObjectType = OBJECTTYPE_LEGEND;
446 : : //@todo set particular aParticleID if we have more than one legend
447 : : }
448 : : //-------------------------------------------------------------------------
449 : : //wall floor area
450 [ # # ][ # # ]: 0 : else if( rDispatchCommand.equals("DiagramWall") || rDispatchCommand.equals("FormatWall") )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
451 : : {
452 : : //OBJECTTYPE_DIAGRAM;
453 : 0 : eObjectType = OBJECTTYPE_DIAGRAM_WALL;
454 : : //@todo set particular aParticleID if we have more than one diagram
455 : : }
456 [ # # ][ # # ]: 0 : else if( rDispatchCommand.equals("DiagramFloor") || rDispatchCommand.equals("FormatFloor") )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
457 : : {
458 : 0 : eObjectType = OBJECTTYPE_DIAGRAM_FLOOR;
459 : : //@todo set particular aParticleID if we have more than one diagram
460 : : }
461 [ # # ][ # # ]: 0 : else if( rDispatchCommand.equals("DiagramArea") || rDispatchCommand.equals("FormatChartArea") )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
462 : : {
463 : 0 : eObjectType = OBJECTTYPE_PAGE;
464 : : }
465 : : //-------------------------------------------------------------------------
466 : : //title
467 [ # # # # : 0 : else if( rDispatchCommand.equals("MainTitle")
# # # # #
# # # # #
# # ][ # # ]
[ # # ][ # # ]
468 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("SubTitle")
469 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("XTitle")
470 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("YTitle")
471 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("ZTitle")
472 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("SecondaryXTitle")
473 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("SecondaryYTitle")
474 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("AllTitles")
475 : : )
476 : : {
477 [ # # ]: 0 : return lcl_getTitleCIDForCommand( rDispatchCommand, xChartModel );
478 : : }
479 : : //-------------------------------------------------------------------------
480 : : //axis
481 [ # # # # : 0 : else if( rDispatchCommand.equals("DiagramAxisX")
# # # # #
# # # ]
[ # # ][ # # ]
[ # # ]
482 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramAxisY")
483 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramAxisZ")
484 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramAxisA")
485 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramAxisB")
486 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramAxisAll")
487 : : )
488 : : {
489 [ # # ]: 0 : return lcl_getAxisCIDForCommand( rDispatchCommand, xChartModel );
490 : : }
491 : : //-------------------------------------------------------------------------
492 : : //grid
493 [ # # # # : 0 : else if( rDispatchCommand.equals("DiagramGridYMain")
# # # # #
# # # #
# ][ # # ]
[ # # ][ # # ]
494 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridXMain")
495 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridZMain")
496 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridYHelp")
497 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridXHelp")
498 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridZHelp")
499 [ # # ][ # # ]: 0 : || rDispatchCommand.equals("DiagramGridAll")
500 : : )
501 : : {
502 [ # # ]: 0 : return lcl_getGridCIDForCommand( rDispatchCommand, xChartModel );
503 : : }
504 : : //-------------------------------------------------------------------------
505 : : //data series
506 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatDataSeries") )
507 : : {
508 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_SERIES )
509 : 0 : return rSelectedCID;
510 : : else
511 : : return ObjectIdentifier::createClassifiedIdentifier(
512 [ # # ][ # # ]: 0 : OBJECTTYPE_DATA_SERIES, ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ) );
513 : : }
514 : : //-------------------------------------------------------------------------
515 : : //data point
516 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatDataPoint") )
517 : : {
518 : 0 : return rSelectedCID;
519 : : }
520 : : //-------------------------------------------------------------------------
521 : : //data labels
522 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatDataLabels") )
523 : : {
524 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_LABELS )
525 : 0 : return rSelectedCID;
526 : : else
527 : : return ObjectIdentifier::createClassifiedIdentifierWithParent(
528 [ # # ]: 0 : OBJECTTYPE_DATA_LABELS, ::rtl::OUString(), rSelectedCID );
529 : : }
530 : : //-------------------------------------------------------------------------
531 : : //data labels
532 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatDataLabel") )
533 : : {
534 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_LABEL )
535 : 0 : return rSelectedCID;
536 : : else
537 : : {
538 [ # # ]: 0 : sal_Int32 nPointIndex = ObjectIdentifier::getParticleID( rSelectedCID ).toInt32();
539 [ # # ]: 0 : if( nPointIndex>=0 )
540 : : {
541 [ # # ]: 0 : OUString aSeriesParticle = ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID );
542 [ # # ]: 0 : OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
543 [ # # ]: 0 : aChildParticle+=(C2U("="));
544 [ # # ]: 0 : OUString aLabelsCID = ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle );
545 : : OUString aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifierWithParent(
546 [ # # ]: 0 : OBJECTTYPE_DATA_LABEL, ::rtl::OUString(), aLabelsCID );
547 : :
548 [ # # ]: 0 : return ObjectIdentifier::createPointCID( aLabelCID_Stub, nPointIndex );
549 : : }
550 : : }
551 : : }
552 : : //-------------------------------------------------------------------------
553 : : //mean value line
554 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatMeanValue") )
555 : : {
556 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_AVERAGE_LINE )
557 : 0 : return rSelectedCID;
558 : : else
559 : : return ObjectIdentifier::createDataCurveCID(
560 : : ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
561 : : RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
562 [ # # ][ # # ]: 0 : RegressionCurveHelper::getMeanValueLine( xRegCurveCnt ) ), true );
[ # # ][ # # ]
563 : : }
564 : : //-------------------------------------------------------------------------
565 : : //trend line
566 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatTrendline") )
567 : : {
568 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_CURVE )
569 : 0 : return rSelectedCID;
570 : : else
571 : : return ObjectIdentifier::createDataCurveCID(
572 : : ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
573 : : RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
574 [ # # ][ # # ]: 0 : RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ), false );
[ # # ][ # # ]
575 : : }
576 : : //-------------------------------------------------------------------------
577 : : //trend line equation
578 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatTrendlineEquation") )
579 : : {
580 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_CURVE_EQUATION )
581 : 0 : return rSelectedCID;
582 : : else
583 : : return ObjectIdentifier::createDataCurveEquationCID(
584 : : ObjectIdentifier::getSeriesParticleFromCID( rSelectedCID ),
585 : : RegressionCurveHelper::getRegressionCurveIndex( xRegCurveCnt,
586 [ # # ][ # # ]: 0 : RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) ) );
[ # # ][ # # ]
587 : : }
588 : : //-------------------------------------------------------------------------
589 : : // y error bars
590 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatXErrorBars") )
591 : : {
592 [ # # ]: 0 : return lcl_getErrorCIDForCommand(OBJECTTYPE_DATA_ERRORS_X, eSelectedType, rSelectedCID );
593 : : }
594 : : //-------------------------------------------------------------------------
595 : : // y error bars
596 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatYErrorBars") )
597 : : {
598 [ # # ]: 0 : return lcl_getErrorCIDForCommand(OBJECTTYPE_DATA_ERRORS_Y, eSelectedType, rSelectedCID );
599 : : }
600 : : //-------------------------------------------------------------------------
601 : : // axis
602 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatAxis") )
603 : : {
604 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_AXIS )
605 : 0 : return rSelectedCID;
606 : : else
607 : : {
608 [ # # ]: 0 : Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
609 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierForObject( xAxis , xChartModel );
610 : : }
611 : : }
612 : : //-------------------------------------------------------------------------
613 : : // major grid
614 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatMajorGrid") )
615 : : {
616 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_GRID )
617 : 0 : return rSelectedCID;
618 : : else
619 : : {
620 [ # # ]: 0 : Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
621 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel );
622 : : }
623 : :
624 : : }
625 : : //-------------------------------------------------------------------------
626 : : // minor grid
627 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatMinorGrid") )
628 : : {
629 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_SUBGRID )
630 : 0 : return rSelectedCID;
631 : : else
632 : : {
633 [ # # ]: 0 : Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( rSelectedCID, xChartModel );
634 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartModel, 0 /*sub grid index*/ );
635 : : }
636 : : }
637 : : //-------------------------------------------------------------------------
638 : : // title
639 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatTitle") )
640 : : {
641 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_TITLE )
642 : 0 : return rSelectedCID;
643 : : }
644 : : //-------------------------------------------------------------------------
645 : : // stock loss
646 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatStockLoss") )
647 : : {
648 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_STOCK_LOSS )
649 : 0 : return rSelectedCID;
650 : : else
651 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_LOSS, rtl::OUString());
652 : : }
653 : : //-------------------------------------------------------------------------
654 : : // stock gain
655 [ # # ]: 0 : else if( rDispatchCommand.equals("FormatStockGain") )
656 : : {
657 [ # # ]: 0 : if( eSelectedType == OBJECTTYPE_DATA_STOCK_GAIN )
658 : 0 : return rSelectedCID;
659 : : else
660 [ # # ]: 0 : return ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DATA_STOCK_GAIN, rtl::OUString() );
661 : : }
662 : :
663 : : return ObjectIdentifier::createClassifiedIdentifier(
664 [ # # ]: 0 : eObjectType, aParticleID );
665 : : }
666 : :
667 : : }
668 : : // anonymous namespace
669 : :
670 : 0 : void SAL_CALL ChartController::executeDispatch_FormatObject(const ::rtl::OUString& rDispatchCommand)
671 : : {
672 [ # # ][ # # ]: 0 : uno::Reference< XChartDocument > xChartDocument( getModel(), uno::UNO_QUERY );
673 [ # # ]: 0 : rtl::OString aCommand( rtl::OUStringToOString( rDispatchCommand, RTL_TEXTENCODING_ASCII_US ) );
674 [ # # ][ # # ]: 0 : rtl::OUString rObjectCID = lcl_getObjectCIDForCommand( aCommand, xChartDocument, m_aSelection.getSelectedCID() );
675 [ # # ]: 0 : executeDlg_ObjectProperties( rObjectCID );
676 : 0 : }
677 : :
678 : 0 : void SAL_CALL ChartController::executeDispatch_ObjectProperties()
679 : : {
680 [ # # ]: 0 : executeDlg_ObjectProperties( m_aSelection.getSelectedCID() );
681 : 0 : }
682 : :
683 : : namespace
684 : : {
685 : :
686 : 0 : rtl::OUString lcl_getFormatCIDforSelectedCID( const ::rtl::OUString& rSelectedCID )
687 : : {
688 : 0 : ::rtl::OUString aFormatCID(rSelectedCID);
689 : :
690 : : //get type of selected object
691 [ # # ]: 0 : ObjectType eObjectType = ObjectIdentifier::getObjectType( aFormatCID );
692 : :
693 : : // some legend entries are handled as if they were data series
694 [ # # ]: 0 : if( OBJECTTYPE_LEGEND_ENTRY==eObjectType )
695 : : {
696 [ # # ]: 0 : rtl::OUString aParentParticle( ObjectIdentifier::getFullParentParticle( rSelectedCID ) );
697 [ # # ]: 0 : aFormatCID = ObjectIdentifier::createClassifiedIdentifierForParticle( aParentParticle );
698 : : }
699 : :
700 : : // treat diagram as wall
701 [ # # ]: 0 : if( OBJECTTYPE_DIAGRAM==eObjectType )
702 [ # # ]: 0 : aFormatCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM_WALL, rtl::OUString() );
703 : :
704 : 0 : return aFormatCID;
705 : : }
706 : :
707 : : }//end anonymous namespace
708 : :
709 : 0 : void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUString& rSelectedObjectCID )
710 : : {
711 [ # # ]: 0 : rtl::OUString aObjectCID = lcl_getFormatCIDforSelectedCID( rSelectedObjectCID );
712 : :
713 : : UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
714 : : ActionDescriptionProvider::FORMAT,
715 : : ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
716 [ # # ][ # # ]: 0 : m_xUndoManager );
[ # # ][ # # ]
717 : :
718 [ # # ]: 0 : bool bSuccess = ChartController::executeDlg_ObjectProperties_withoutUndoGuard( aObjectCID, false );
719 [ # # ]: 0 : if( bSuccess )
720 [ # # ][ # # ]: 0 : aUndoGuard.commit();
721 : 0 : }
722 : :
723 : 0 : bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const ::rtl::OUString& rObjectCID, bool bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso )
724 : : {
725 : : //return true if the properties were changed successfully
726 : 0 : bool bRet = false;
727 [ # # ]: 0 : if( rObjectCID.isEmpty() )
728 : : {
729 : 0 : return bRet;
730 : : }
731 : : try
732 : : {
733 [ # # ][ # # ]: 0 : NumberFormatterWrapper aNumberFormatterWrapper( uno::Reference< util::XNumberFormatsSupplier >(getModel(), uno::UNO_QUERY) );
[ # # ]
734 : :
735 : : //-------------------------------------------------------------
736 : : //get type of object
737 [ # # ]: 0 : ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID );
738 [ # # ]: 0 : if( OBJECTTYPE_UNKNOWN==eObjectType )
739 : : {
740 : 0 : return bRet;
741 : : }
742 [ # # ][ # # ]: 0 : if( OBJECTTYPE_DIAGRAM_WALL==eObjectType || OBJECTTYPE_DIAGRAM_FLOOR==eObjectType )
743 : : {
744 [ # # ][ # # ]: 0 : if( !DiagramHelper::isSupportingFloorAndWall( ChartModelHelper::findDiagram( getModel() ) ) )
[ # # ][ # # ]
745 : 0 : return bRet;
746 : : }
747 : :
748 : : //-------------------------------------------------------------
749 : : //convert properties to ItemSet
750 : :
751 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
752 : : ::std::auto_ptr< ReferenceSizeProvider > pRefSizeProv(
753 [ # # ][ # # ]: 0 : impl_createReferenceSizeProvider());
754 : : ::std::auto_ptr< ::comphelper::ItemConverter > apItemConverter(
755 : 0 : createItemConverter( rObjectCID, getModel(), m_xCC,
756 [ # # ]: 0 : m_pDrawModelWrapper->getSdrModel(),
757 : : &aNumberFormatterWrapper,
758 : : ExplicitValueProvider::getExplicitValueProvider(m_xChartView),
759 [ # # ][ # # ]: 0 : pRefSizeProv ));
[ # # ][ # # ]
760 : : SAL_WNODEPRECATED_DECLARATIONS_POP
761 [ # # ]: 0 : if(!apItemConverter.get())
762 : 0 : return bRet;
763 : :
764 [ # # ]: 0 : SfxItemSet aItemSet = apItemConverter->CreateEmptyItemSet();
765 : :
766 [ # # ][ # # ]: 0 : if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X || eObjectType == OBJECTTYPE_DATA_ERRORS_Y )
767 [ # # ][ # # ]: 0 : aItemSet.Put(SfxBoolItem(SCHATTR_STAT_ERRORBAR_TYPE, eObjectType == OBJECTTYPE_DATA_ERRORS_Y ));
[ # # ]
768 : :
769 [ # # ]: 0 : apItemConverter->FillItemSet( aItemSet );
770 : :
771 : : //-------------------------------------------------------------
772 : : //prepare dialog
773 [ # # ]: 0 : ObjectPropertiesDialogParameter aDialogParameter = ObjectPropertiesDialogParameter( rObjectCID );
774 [ # # ][ # # ]: 0 : aDialogParameter.init( getModel() );
775 [ # # ]: 0 : ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() );
776 : :
777 [ # # ]: 0 : SolarMutexGuard aGuard;
778 : : SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider
779 [ # # ][ # # ]: 0 : , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) );
[ # # ]
780 : :
781 [ # # ][ # # ]: 0 : if(aDialogParameter.HasSymbolProperties())
782 : : {
783 : 0 : SfxItemSet* pSymbolShapeProperties=NULL;
784 : : uno::Reference< beans::XPropertySet > xObjectProperties =
785 [ # # ][ # # ]: 0 : ObjectIdentifier::getObjectPropertySet( rObjectCID, getModel() );
786 : 0 : wrapper::DataPointItemConverter aSymbolItemConverter( getModel(), m_xCC
787 : 0 : , xObjectProperties, ObjectIdentifier::getDataSeriesForCID( rObjectCID, getModel() )
788 [ # # ]: 0 : , m_pDrawModelWrapper->getSdrModel().GetItemPool()
789 [ # # ]: 0 : , m_pDrawModelWrapper->getSdrModel()
790 : : , &aNumberFormatterWrapper
791 : 0 : , uno::Reference< lang::XMultiServiceFactory >( getModel(), uno::UNO_QUERY )
792 [ # # # # ]: 0 : , wrapper::GraphicPropertyItemConverter::FILLED_DATA_POINT );
[ # # ][ # # ]
[ # # ][ # # ]
793 : :
794 [ # # ][ # # ]: 0 : pSymbolShapeProperties = new SfxItemSet( aSymbolItemConverter.CreateEmptyItemSet() );
795 [ # # ]: 0 : aSymbolItemConverter.FillItemSet( *pSymbolShapeProperties );
796 : :
797 : 0 : sal_Int32 nStandardSymbol=0;//@todo get from somewhere
798 [ # # ][ # # ]: 0 : Graphic* pAutoSymbolGraphic = new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties ) );
799 : : // note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
800 [ # # ][ # # ]: 0 : aDlg.setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
801 : : }
802 [ # # ][ # # ]: 0 : if( aDialogParameter.HasStatisticProperties() )
803 : : {
804 : : aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
805 [ # # ][ # # ]: 0 : InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, rObjectCID ) );
[ # # ]
806 : : }
807 : :
808 : : //-------------------------------------------------------------
809 : : //open the dialog
810 [ # # ][ # # ]: 0 : if( aDlg.Execute() == RET_OK || (bOkClickOnUnchangedDialogSouldBeRatedAsSuccessAlso && aDlg.DialogWasClosedWithOK()) )
[ # # ][ # # ]
[ # # ][ # # ]
811 : : {
812 : 0 : const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
813 [ # # ]: 0 : if(pOutItemSet)
814 : : {
815 [ # # ][ # # ]: 0 : ControllerLockGuard aCLGuard( getModel());
816 [ # # ]: 0 : apItemConverter->ApplyItemSet( *pOutItemSet );//model should be changed now
817 [ # # ]: 0 : bRet = true;
818 : : }
819 [ # # ][ # # ]: 0 : }
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
[ # # # ]
820 : : }
821 : 0 : catch( const util::CloseVetoException& )
822 : : {
823 : : }
824 : 0 : catch( const uno::RuntimeException& )
825 : : {
826 : : }
827 : 0 : return bRet;
828 : : }
829 : :
830 : 0 : void SAL_CALL ChartController::executeDispatch_View3D()
831 : : {
832 : : try
833 : : {
834 : : // using assignment for broken gcc 3.3
835 : : UndoLiveUpdateGuard aUndoGuard = UndoLiveUpdateGuard(
836 : : String( SchResId( STR_ACTION_EDIT_3D_VIEW )),
837 [ # # ][ # # ]: 0 : m_xUndoManager );
[ # # ][ # # ]
[ # # ]
838 : :
839 : : //open dialog
840 [ # # ]: 0 : SolarMutexGuard aSolarGuard;
841 [ # # ][ # # ]: 0 : View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
[ # # ]
842 [ # # ][ # # ]: 0 : if( aDlg.Execute() == RET_OK )
843 [ # # ][ # # ]: 0 : aUndoGuard.commit();
[ # # ][ # # ]
[ # # ]
844 : : }
845 : 0 : catch(const uno::RuntimeException& e)
846 : : {
847 : : ASSERT_EXCEPTION( e );
848 : : }
849 : 0 : }
850 : :
851 : : //.............................................................................
852 : : } //namespace chart
853 : : //.............................................................................
854 : :
855 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|