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 <svl/zforlist.hxx>
21 : #include "dlg_ObjectProperties.hxx"
22 : #include "ResourceIds.hrc"
23 : #include "Strings.hrc"
24 : #include "TabPages.hrc"
25 : #include "tp_AxisLabel.hxx"
26 : #include "tp_DataLabel.hxx"
27 : #include "tp_LegendPosition.hxx"
28 : #include "tp_PointGeometry.hxx"
29 : #include "tp_Scale.hxx"
30 : #include "tp_AxisPositions.hxx"
31 : #include "tp_ErrorBars.hxx"
32 : #include "tp_Trendline.hxx"
33 : #include "tp_SeriesToAxis.hxx"
34 : #include "tp_TitleRotation.hxx"
35 : #include "tp_PolarOptions.hxx"
36 : #include "ResId.hxx"
37 : #include "ViewElementListProvider.hxx"
38 : #include "macros.hxx"
39 : #include "ChartModelHelper.hxx"
40 : #include "ChartTypeHelper.hxx"
41 : #include "ObjectNameProvider.hxx"
42 : #include "DiagramHelper.hxx"
43 : #include "NumberFormatterWrapper.hxx"
44 : #include "AxisIndexDefines.hxx"
45 : #include "AxisHelper.hxx"
46 : #include "ExplicitCategoriesProvider.hxx"
47 :
48 : #include <com/sun/star/chart2/XAxis.hpp>
49 : #include <com/sun/star/chart2/XChartType.hpp>
50 : #include <com/sun/star/chart2/XDataSeries.hpp>
51 : #include <svl/intitem.hxx>
52 : #include <svl/languageoptions.hxx>
53 :
54 : #include <svx/svxids.hrc>
55 :
56 : #include <svx/drawitem.hxx>
57 : #include <svx/ofaitem.hxx>
58 : #include <svx/svxgrahicitem.hxx>
59 :
60 : #include <svx/dialogs.hrc>
61 : #include <editeng/flstitem.hxx>
62 : #include <svx/tabline.hxx>
63 :
64 : #include <svx/flagsdef.hxx>
65 : #include <svx/numinf.hxx>
66 :
67 : #include <svl/cjkoptions.hxx>
68 :
69 : //.............................................................................
70 : namespace chart
71 : {
72 : //.............................................................................
73 :
74 : using namespace ::com::sun::star;
75 : using namespace ::com::sun::star::chart2;
76 : using ::com::sun::star::uno::Reference;
77 :
78 : //-----------------------------------------------------------------------------
79 : //-----------------------------------------------------------------------------
80 : //-----------------------------------------------------------------------------
81 :
82 0 : ObjectPropertiesDialogParameter::ObjectPropertiesDialogParameter( const OUString& rObjectCID )
83 : : m_aObjectCID( rObjectCID )
84 0 : , m_eObjectType( ObjectIdentifier::getObjectType( m_aObjectCID ) )
85 : , m_bAffectsMultipleObjects(false)
86 : , m_aLocalizedName()
87 : , m_bHasGeometryProperties(false)
88 : , m_bHasStatisticProperties(false)
89 : , m_bProvidesSecondaryYAxis(false)
90 : , m_bProvidesOverlapAndGapWidth(false)
91 : , m_bProvidesBarConnectors(false)
92 : , m_bHasAreaProperties(false)
93 : , m_bHasSymbolProperties(false)
94 : , m_bHasNumberProperties(false)
95 : , m_bProvidesStartingAngle(false)
96 : , m_bProvidesMissingValueTreatments(false)
97 : , m_bHasScaleProperties(false)
98 : , m_bCanAxisLabelsBeStaggered(false)
99 : , m_bSupportingAxisPositioning(false)
100 : , m_bShowAxisOrigin(false)
101 : , m_bIsCrossingAxisIsCategoryAxis(false)
102 : , m_aCategories()
103 : , m_xChartDocument( 0 )
104 0 : , m_bComplexCategoriesAxis( false )
105 : {
106 0 : OUString aParticleID = ObjectIdentifier::getParticleID( m_aObjectCID );
107 0 : m_bAffectsMultipleObjects = (aParticleID == "ALLELEMENTS");
108 0 : }
109 0 : ObjectPropertiesDialogParameter::~ObjectPropertiesDialogParameter()
110 : {
111 0 : }
112 0 : ObjectType ObjectPropertiesDialogParameter::getObjectType() const
113 : {
114 0 : return m_eObjectType;
115 : }
116 0 : OUString ObjectPropertiesDialogParameter::getLocalizedName() const
117 : {
118 0 : return m_aLocalizedName;
119 : }
120 :
121 0 : void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel >& xChartModel )
122 : {
123 0 : m_xChartDocument.set( xChartModel, uno::UNO_QUERY );
124 0 : uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
125 0 : uno::Reference< XDataSeries > xSeries = ObjectIdentifier::getDataSeriesForCID( m_aObjectCID, xChartModel );
126 0 : uno::Reference< XChartType > xChartType = ChartModelHelper::getChartTypeOfSeries( xChartModel, xSeries );
127 0 : sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
128 :
129 0 : bool bHasSeriesProperties = (OBJECTTYPE_DATA_SERIES==m_eObjectType);
130 0 : bool bHasDataPointproperties = (OBJECTTYPE_DATA_POINT==m_eObjectType);
131 :
132 0 : if( bHasSeriesProperties || bHasDataPointproperties )
133 : {
134 0 : m_bHasGeometryProperties = ChartTypeHelper::isSupportingGeometryProperties( xChartType, nDimensionCount );
135 0 : m_bHasAreaProperties = ChartTypeHelper::isSupportingAreaProperties( xChartType, nDimensionCount );
136 0 : m_bHasSymbolProperties = ChartTypeHelper::isSupportingSymbolProperties( xChartType, nDimensionCount );
137 :
138 0 : if( bHasSeriesProperties )
139 : {
140 0 : m_bHasStatisticProperties = ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount );
141 0 : m_bProvidesSecondaryYAxis = ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount, 1 );
142 0 : m_bProvidesOverlapAndGapWidth = ChartTypeHelper::isSupportingOverlapAndGapWidthProperties( xChartType, nDimensionCount );
143 0 : m_bProvidesBarConnectors = ChartTypeHelper::isSupportingBarConnectors( xChartType, nDimensionCount );
144 0 : m_bProvidesStartingAngle = ChartTypeHelper::isSupportingStartingAngle( xChartType );
145 :
146 : m_bProvidesMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType )
147 0 : .getLength() ? true : false;
148 : }
149 : }
150 :
151 0 : if( m_eObjectType == OBJECTTYPE_DATA_ERRORS_X ||
152 : m_eObjectType == OBJECTTYPE_DATA_ERRORS_Y ||
153 : m_eObjectType == OBJECTTYPE_DATA_ERRORS_Z)
154 0 : m_bHasStatisticProperties = true;
155 :
156 0 : if( OBJECTTYPE_AXIS == m_eObjectType )
157 : {
158 : //show scale properties only for a single axis not for multiselection
159 0 : m_bHasScaleProperties = !m_bAffectsMultipleObjects;
160 :
161 0 : if( m_bHasScaleProperties )
162 : {
163 0 : uno::Reference< XAxis > xAxis( ObjectIdentifier::getAxisForCID( m_aObjectCID, xChartModel ) );
164 0 : if( xAxis.is() )
165 : {
166 : //no scale page for series axis
167 0 : ScaleData aData( xAxis->getScaleData() );
168 0 : if( chart2::AxisType::SERIES == aData.AxisType )
169 0 : m_bHasScaleProperties = false;
170 0 : if( chart2::AxisType::SERIES != aData.AxisType )
171 0 : m_bHasNumberProperties = true;
172 :
173 0 : sal_Int32 nCooSysIndex=0;
174 0 : sal_Int32 nDimensionIndex=0;
175 0 : sal_Int32 nAxisIndex=0;
176 0 : if( AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex ) )
177 : {
178 0 : xChartType = AxisHelper::getFirstChartTypeWithSeriesAttachedToAxisIndex( xDiagram, nAxisIndex );
179 : //show positioning controls only if they make sense
180 0 : m_bSupportingAxisPositioning = ChartTypeHelper::isSupportingAxisPositioning( xChartType, nDimensionCount, nDimensionIndex );
181 :
182 : //show axis origin only for secondary y axis
183 0 : if( 1==nDimensionIndex && 1==nAxisIndex && ChartTypeHelper::isSupportingBaseValue( xChartType ) )
184 0 : m_bShowAxisOrigin = true;
185 : }
186 :
187 : //is the crossin main axis a category axes?:
188 0 : uno::Reference< XCoordinateSystem > xCooSys( AxisHelper::getCoordinateSystemOfAxis( xAxis, xDiagram ) );
189 0 : uno::Reference< XAxis > xCrossingMainAxis( AxisHelper::getCrossingMainAxis( xAxis, xCooSys ) );
190 0 : if( xCrossingMainAxis.is() )
191 : {
192 0 : ScaleData aScale( xCrossingMainAxis->getScaleData() );
193 0 : m_bIsCrossingAxisIsCategoryAxis = ( chart2::AxisType::CATEGORY == aScale.AxisType );
194 0 : if( m_bIsCrossingAxisIsCategoryAxis )
195 0 : m_aCategories = DiagramHelper::getExplicitSimpleCategories( Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY) );
196 : }
197 :
198 0 : m_bComplexCategoriesAxis = false;
199 0 : if ( nDimensionIndex == 0 && aData.AxisType == chart2::AxisType::CATEGORY )
200 : {
201 0 : ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, xChartModel );
202 0 : m_bComplexCategoriesAxis = aExplicitCategoriesProvider.hasComplexCategories();
203 0 : }
204 0 : }
205 : }
206 :
207 : //no staggering of labels for 3D axis
208 0 : m_bCanAxisLabelsBeStaggered = nDimensionCount==2;
209 : }
210 :
211 : //create gui name for this object
212 : {
213 0 : if( !m_bAffectsMultipleObjects && OBJECTTYPE_AXIS == m_eObjectType )
214 : {
215 0 : m_aLocalizedName = ObjectNameProvider::getAxisName( m_aObjectCID, xChartModel );
216 : }
217 0 : else if( !m_bAffectsMultipleObjects && ( OBJECTTYPE_GRID == m_eObjectType || OBJECTTYPE_SUBGRID == m_eObjectType ) )
218 : {
219 0 : m_aLocalizedName = ObjectNameProvider::getGridName( m_aObjectCID, xChartModel );
220 : }
221 0 : else if( !m_bAffectsMultipleObjects && OBJECTTYPE_TITLE == m_eObjectType )
222 : {
223 0 : m_aLocalizedName = ObjectNameProvider::getTitleName( m_aObjectCID, xChartModel );
224 : }
225 : else
226 : {
227 0 : switch( m_eObjectType )
228 : {
229 : case OBJECTTYPE_DATA_POINT:
230 : case OBJECTTYPE_DATA_LABEL:
231 : case OBJECTTYPE_DATA_LABELS:
232 : case OBJECTTYPE_DATA_ERRORS_X:
233 : case OBJECTTYPE_DATA_ERRORS_Y:
234 : case OBJECTTYPE_DATA_ERRORS_Z:
235 : case OBJECTTYPE_DATA_AVERAGE_LINE:
236 : case OBJECTTYPE_DATA_CURVE:
237 : case OBJECTTYPE_DATA_CURVE_EQUATION:
238 0 : if( m_bAffectsMultipleObjects )
239 0 : m_aLocalizedName = ObjectNameProvider::getName_ObjectForAllSeries( m_eObjectType );
240 : else
241 0 : m_aLocalizedName = ObjectNameProvider::getName_ObjectForSeries( m_eObjectType, m_aObjectCID, m_xChartDocument );
242 0 : break;
243 : default:
244 0 : m_aLocalizedName = ObjectNameProvider::getName(m_eObjectType,m_bAffectsMultipleObjects);
245 0 : break;
246 : }
247 : }
248 0 : }
249 0 : }
250 :
251 0 : bool ObjectPropertiesDialogParameter::HasGeometryProperties() const
252 : {
253 0 : return m_bHasGeometryProperties;
254 : }
255 0 : bool ObjectPropertiesDialogParameter::HasStatisticProperties() const
256 : {
257 0 : return m_bHasStatisticProperties;
258 : }
259 0 : bool ObjectPropertiesDialogParameter::ProvidesSecondaryYAxis() const
260 : {
261 0 : return m_bProvidesSecondaryYAxis;
262 : }
263 0 : bool ObjectPropertiesDialogParameter::ProvidesOverlapAndGapWidth() const
264 : {
265 0 : return m_bProvidesOverlapAndGapWidth;
266 : }
267 0 : bool ObjectPropertiesDialogParameter::ProvidesBarConnectors() const
268 : {
269 0 : return m_bProvidesBarConnectors;
270 : }
271 0 : bool ObjectPropertiesDialogParameter::HasAreaProperties() const
272 : {
273 0 : return m_bHasAreaProperties;
274 : }
275 0 : bool ObjectPropertiesDialogParameter::HasSymbolProperties() const
276 : {
277 0 : return m_bHasSymbolProperties;
278 : }
279 0 : bool ObjectPropertiesDialogParameter::HasScaleProperties() const
280 : {
281 0 : return m_bHasScaleProperties;
282 : }
283 0 : bool ObjectPropertiesDialogParameter::CanAxisLabelsBeStaggered() const
284 : {
285 0 : return m_bCanAxisLabelsBeStaggered;
286 : }
287 0 : bool ObjectPropertiesDialogParameter::ShowAxisOrigin() const
288 : {
289 0 : return m_bShowAxisOrigin;
290 : }
291 0 : bool ObjectPropertiesDialogParameter::IsSupportingAxisPositioning() const
292 : {
293 0 : return m_bSupportingAxisPositioning;
294 : }
295 0 : bool ObjectPropertiesDialogParameter::IsCrossingAxisIsCategoryAxis() const
296 : {
297 0 : return m_bIsCrossingAxisIsCategoryAxis;
298 : }
299 0 : const uno::Sequence< OUString >& ObjectPropertiesDialogParameter::GetCategories() const
300 : {
301 0 : return m_aCategories;
302 : }
303 0 : bool ObjectPropertiesDialogParameter::HasNumberProperties() const
304 : {
305 0 : return m_bHasNumberProperties;
306 : }
307 0 : bool ObjectPropertiesDialogParameter::ProvidesStartingAngle() const
308 : {
309 0 : return m_bProvidesStartingAngle;
310 : }
311 0 : bool ObjectPropertiesDialogParameter::ProvidesMissingValueTreatments() const
312 : {
313 0 : return m_bProvidesMissingValueTreatments;
314 : }
315 0 : uno::Reference< chart2::XChartDocument > ObjectPropertiesDialogParameter::getDocument() const
316 : {
317 0 : return m_xChartDocument;
318 : }
319 0 : bool ObjectPropertiesDialogParameter::IsComplexCategoriesAxis() const
320 : {
321 0 : return m_bComplexCategoriesAxis;
322 : }
323 :
324 : const sal_uInt16 nNoArrowNoShadowDlg = 1101;
325 :
326 : //-------------------------------------------------------------------
327 : //-------------------------------------------------------------------
328 : //-------------------------------------------------------------------
329 :
330 0 : void SchAttribTabDlg::setSymbolInformation( SfxItemSet* pSymbolShapeProperties,
331 : Graphic* pAutoSymbolGraphic )
332 : {
333 0 : m_pSymbolShapeProperties = pSymbolShapeProperties;
334 0 : m_pAutoSymbolGraphic = pAutoSymbolGraphic;
335 0 : }
336 :
337 0 : void SchAttribTabDlg::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
338 : {
339 0 : m_fAxisMinorStepWidthForErrorBarDecimals = fMinorStepWidth;
340 0 : }
341 :
342 0 : SchAttribTabDlg::SchAttribTabDlg(Window* pParent,
343 : const SfxItemSet* pAttr,
344 : const ObjectPropertiesDialogParameter* pDialogParameter,
345 : const ViewElementListProvider* pViewElementListProvider,
346 : const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier
347 : )
348 : : SfxTabDialog(pParent, SchResId(DLG_OBJECT_PROPERTIES), pAttr)
349 0 : , eObjectType(pDialogParameter->getObjectType())
350 : , nDlgType(nNoArrowNoShadowDlg)
351 : , nPageType(0)
352 : , m_pParameter( pDialogParameter )
353 : , m_pViewElementListProvider( pViewElementListProvider )
354 : , m_pNumberFormatter(0)
355 : , m_pSymbolShapeProperties(NULL)
356 : , m_pAutoSymbolGraphic(NULL)
357 : , m_fAxisMinorStepWidthForErrorBarDecimals(0.1)
358 0 : , m_bOKPressed(false)
359 : {
360 0 : FreeResource();
361 :
362 0 : NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
363 0 : m_pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
364 :
365 0 : this->SetText( pDialogParameter->getLocalizedName() );
366 :
367 0 : SvtCJKOptions aCJKOptions;
368 :
369 0 : switch (eObjectType)
370 : {
371 : case OBJECTTYPE_TITLE:
372 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_BORDER));
373 0 : AddTabPage(RID_SVXPAGE_AREA, SCH_RESSTR(STR_PAGE_AREA));
374 0 : AddTabPage(RID_SVXPAGE_TRANSPARENCE, SCH_RESSTR(STR_PAGE_TRANSPARENCY));
375 0 : AddTabPage(RID_SVXPAGE_CHAR_NAME, SCH_RESSTR(STR_PAGE_FONT));
376 0 : AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SCH_RESSTR(STR_PAGE_FONT_EFFECTS));
377 0 : AddTabPage(TP_ALIGNMENT, SCH_RESSTR(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::Create, NULL);
378 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
379 0 : AddTabPage(RID_SVXPAGE_PARA_ASIAN, SCH_RESSTR(STR_PAGE_ASIAN));
380 0 : break;
381 :
382 : case OBJECTTYPE_LEGEND:
383 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_BORDER));
384 0 : AddTabPage(RID_SVXPAGE_AREA, SCH_RESSTR(STR_PAGE_AREA));
385 0 : AddTabPage(RID_SVXPAGE_TRANSPARENCE, SCH_RESSTR(STR_PAGE_TRANSPARENCY));
386 0 : AddTabPage(RID_SVXPAGE_CHAR_NAME, SCH_RESSTR(STR_PAGE_FONT));
387 0 : AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SCH_RESSTR(STR_PAGE_FONT_EFFECTS));
388 0 : AddTabPage(TP_LEGEND_POS, SCH_RESSTR(STR_PAGE_POSITION), SchLegendPosTabPage::Create, NULL);
389 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
390 0 : AddTabPage(RID_SVXPAGE_PARA_ASIAN, SCH_RESSTR(STR_PAGE_ASIAN));
391 0 : break;
392 :
393 : case OBJECTTYPE_DATA_SERIES:
394 : case OBJECTTYPE_DATA_POINT:
395 0 : if( m_pParameter->ProvidesSecondaryYAxis() || m_pParameter->ProvidesOverlapAndGapWidth() || m_pParameter->ProvidesMissingValueTreatments() )
396 0 : AddTabPage(TP_OPTIONS, SCH_RESSTR(STR_PAGE_OPTIONS),SchOptionTabPage::Create, NULL);
397 0 : if( m_pParameter->ProvidesStartingAngle())
398 0 : AddTabPage(TP_POLAROPTIONS, SCH_RESSTR(STR_PAGE_OPTIONS),PolarOptionsTabPage::Create, NULL);
399 :
400 0 : if( m_pParameter->HasGeometryProperties() )
401 0 : AddTabPage(TP_LAYOUT, SCH_RESSTR(STR_PAGE_LAYOUT),SchLayoutTabPage::Create, NULL);
402 :
403 0 : if(m_pParameter->HasAreaProperties())
404 : {
405 0 : AddTabPage(RID_SVXPAGE_AREA, SCH_RESSTR(STR_PAGE_AREA));
406 0 : AddTabPage(RID_SVXPAGE_TRANSPARENCE, SCH_RESSTR(STR_PAGE_TRANSPARENCY));
407 : }
408 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR( m_pParameter->HasAreaProperties() ? STR_PAGE_BORDER : STR_PAGE_LINE ));
409 0 : break;
410 :
411 : case OBJECTTYPE_DATA_LABEL:
412 : case OBJECTTYPE_DATA_LABELS:
413 0 : AddTabPage(TP_DATA_DESCR, SCH_RESSTR(STR_OBJECT_DATALABELS), DataLabelsTabPage::Create, NULL);
414 0 : AddTabPage(RID_SVXPAGE_CHAR_NAME, SCH_RESSTR(STR_PAGE_FONT));
415 0 : AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SCH_RESSTR(STR_PAGE_FONT_EFFECTS));
416 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
417 0 : AddTabPage(RID_SVXPAGE_PARA_ASIAN, SCH_RESSTR(STR_PAGE_ASIAN));
418 :
419 0 : break;
420 :
421 : case OBJECTTYPE_AXIS:
422 : {
423 0 : if( m_pParameter->HasScaleProperties() )
424 0 : AddTabPage(TP_SCALE, SCH_RESSTR(STR_PAGE_SCALE), ScaleTabPage::Create, NULL);
425 :
426 0 : if( m_pParameter->HasScaleProperties() )//no positioning page for z axes so far as the tickmarks are not shown so far
427 0 : AddTabPage(TP_AXIS_POSITIONS, SCH_RESSTR(STR_PAGE_POSITIONING), AxisPositionsTabPage::Create, NULL);
428 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_LINE));
429 0 : AddTabPage(TP_AXIS_LABEL, SCH_RESSTR(STR_OBJECT_LABEL), SchAxisLabelTabPage::Create, NULL);
430 0 : if( m_pParameter->HasNumberProperties() )
431 0 : AddTabPage(RID_SVXPAGE_NUMBERFORMAT, SCH_RESSTR(STR_PAGE_NUMBERS));
432 0 : AddTabPage(RID_SVXPAGE_CHAR_NAME, SCH_RESSTR(STR_PAGE_FONT));
433 0 : AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SCH_RESSTR(STR_PAGE_FONT_EFFECTS));
434 0 : if( aCJKOptions.IsAsianTypographyEnabled() )
435 0 : AddTabPage(RID_SVXPAGE_PARA_ASIAN, SCH_RESSTR(STR_PAGE_ASIAN));
436 0 : break;
437 : }
438 :
439 : case OBJECTTYPE_DATA_ERRORS_X:
440 0 : AddTabPage(TP_XERRORBAR, SCH_RESSTR(STR_PAGE_XERROR_BARS), ErrorBarsTabPage::Create, NULL);
441 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_LINE));
442 0 : break;
443 :
444 : case OBJECTTYPE_DATA_ERRORS_Y:
445 0 : AddTabPage(TP_YERRORBAR, SCH_RESSTR(STR_PAGE_YERROR_BARS), ErrorBarsTabPage::Create, NULL);
446 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_LINE));
447 0 : break;
448 :
449 : case OBJECTTYPE_DATA_ERRORS_Z:
450 0 : break;
451 :
452 : case OBJECTTYPE_GRID:
453 : case OBJECTTYPE_SUBGRID:
454 : case OBJECTTYPE_DATA_AVERAGE_LINE:
455 : case OBJECTTYPE_DATA_STOCK_RANGE:
456 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_LINE));
457 0 : break;
458 :
459 : case OBJECTTYPE_DATA_CURVE:
460 0 : AddTabPage(TP_TRENDLINE, SCH_RESSTR(STR_PAGE_TRENDLINE_TYPE), TrendlineTabPage::Create, NULL);
461 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_LINE));
462 0 : break;
463 :
464 : case OBJECTTYPE_DATA_STOCK_LOSS:
465 : case OBJECTTYPE_DATA_STOCK_GAIN:
466 : case OBJECTTYPE_PAGE:
467 : case OBJECTTYPE_DIAGRAM_FLOOR:
468 : case OBJECTTYPE_DIAGRAM_WALL:
469 : case OBJECTTYPE_DIAGRAM:
470 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_BORDER));
471 0 : AddTabPage(RID_SVXPAGE_AREA, SCH_RESSTR(STR_PAGE_AREA));
472 0 : AddTabPage(RID_SVXPAGE_TRANSPARENCE, SCH_RESSTR(STR_PAGE_TRANSPARENCY));
473 0 : break;
474 :
475 : case OBJECTTYPE_LEGEND_ENTRY:
476 : case OBJECTTYPE_AXIS_UNITLABEL:
477 : case OBJECTTYPE_UNKNOWN:
478 : // nothing
479 0 : break;
480 : case OBJECTTYPE_DATA_CURVE_EQUATION:
481 0 : AddTabPage(RID_SVXPAGE_LINE, SCH_RESSTR(STR_PAGE_BORDER));
482 0 : AddTabPage(RID_SVXPAGE_AREA, SCH_RESSTR(STR_PAGE_AREA));
483 0 : AddTabPage(RID_SVXPAGE_TRANSPARENCE, SCH_RESSTR(STR_PAGE_TRANSPARENCY));
484 0 : AddTabPage(RID_SVXPAGE_CHAR_NAME, SCH_RESSTR(STR_PAGE_FONT));
485 0 : AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SCH_RESSTR(STR_PAGE_FONT_EFFECTS));
486 0 : AddTabPage(RID_SVXPAGE_NUMBERFORMAT, SCH_RESSTR(STR_PAGE_NUMBERS));
487 0 : if( SvtLanguageOptions().IsCTLFontEnabled() )
488 : /* When rotation is supported for equation text boxes, use
489 : SchAlignmentTabPage::Create here. The special
490 : SchAlignmentTabPage::CreateWithoutRotation can be deleted. */
491 0 : AddTabPage(TP_ALIGNMENT, SCH_RESSTR(STR_PAGE_ALIGNMENT), SchAlignmentTabPage::CreateWithoutRotation, NULL);
492 0 : break;
493 : default:
494 0 : break;
495 : }
496 :
497 : // used to find out if user left the dialog with OK. When OK is pressed but
498 : // no changes were done, Cancel is returned by the SfxTabDialog. See method
499 : // DialogWasClosedWithOK.
500 0 : m_aOriginalOKClickHdl = GetOKButton().GetClickHdl();
501 0 : GetOKButton().SetClickHdl( LINK( this, SchAttribTabDlg, OKPressed ));
502 0 : }
503 :
504 0 : SchAttribTabDlg::~SchAttribTabDlg()
505 : {
506 0 : delete m_pSymbolShapeProperties;
507 0 : delete m_pAutoSymbolGraphic;
508 0 : }
509 :
510 0 : void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
511 : {
512 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
513 0 : switch (nId)
514 : {
515 : case TP_LAYOUT:
516 0 : break;
517 : case RID_SVXPAGE_LINE:
518 0 : aSet.Put (SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
519 0 : aSet.Put (SvxDashListItem(m_pViewElementListProvider->GetDashList(),SID_DASH_LIST));
520 0 : aSet.Put (SvxLineEndListItem(m_pViewElementListProvider->GetLineEndList(),SID_LINEEND_LIST));
521 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
522 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
523 :
524 0 : if( m_pParameter->HasSymbolProperties() )
525 : {
526 0 : aSet.Put(OfaPtrItem(SID_OBJECT_LIST,m_pViewElementListProvider->GetSymbolList()));
527 0 : if( m_pSymbolShapeProperties )
528 0 : aSet.Put(SfxTabDialogItem(SID_ATTR_SET,*m_pSymbolShapeProperties));
529 0 : if( m_pAutoSymbolGraphic )
530 0 : aSet.Put(SvxGraphicItem(SID_GRAPHIC,*m_pAutoSymbolGraphic));
531 : }
532 0 : rPage.PageCreated(aSet);
533 0 : break;
534 :
535 : case RID_SVXPAGE_AREA:
536 0 : aSet.Put(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
537 0 : aSet.Put(SvxGradientListItem(m_pViewElementListProvider->GetGradientList(),SID_GRADIENT_LIST));
538 0 : aSet.Put(SvxHatchListItem(m_pViewElementListProvider->GetHatchList(),SID_HATCH_LIST));
539 0 : aSet.Put(SvxBitmapListItem(m_pViewElementListProvider->GetBitmapList(),SID_BITMAP_LIST));
540 0 : aSet.Put(SfxUInt16Item(SID_PAGE_TYPE,nPageType));
541 0 : aSet.Put(SfxUInt16Item(SID_DLG_TYPE,nDlgType));
542 0 : rPage.PageCreated(aSet);
543 0 : break;
544 :
545 : case RID_SVXPAGE_TRANSPARENCE:
546 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
547 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
548 0 : rPage.PageCreated(aSet);
549 0 : break;
550 :
551 : case RID_SVXPAGE_CHAR_NAME:
552 :
553 0 : aSet.Put (SvxFontListItem(m_pViewElementListProvider->getFontList(), SID_ATTR_CHAR_FONTLIST));
554 0 : rPage.PageCreated(aSet);
555 0 : break;
556 :
557 : case RID_SVXPAGE_CHAR_EFFECTS:
558 0 : aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
559 0 : rPage.PageCreated(aSet);
560 0 : break;
561 :
562 : case TP_AXIS_LABEL:
563 : {
564 0 : bool bShowStaggeringControls = m_pParameter->CanAxisLabelsBeStaggered();
565 0 : ((SchAxisLabelTabPage&)rPage).ShowStaggeringControls( bShowStaggeringControls );
566 0 : ( dynamic_cast< SchAxisLabelTabPage& >( rPage ) ).SetComplexCategories( m_pParameter->IsComplexCategoriesAxis() );
567 0 : break;
568 : }
569 :
570 : case TP_ALIGNMENT:
571 0 : break;
572 :
573 :
574 : case TP_AXIS_POSITIONS:
575 : {
576 0 : AxisPositionsTabPage* pPage = dynamic_cast< AxisPositionsTabPage* >( &rPage );
577 0 : if(pPage)
578 : {
579 0 : pPage->SetNumFormatter( m_pNumberFormatter );
580 0 : if( m_pParameter->IsCrossingAxisIsCategoryAxis() )
581 : {
582 0 : pPage->SetCrossingAxisIsCategoryAxis( m_pParameter->IsCrossingAxisIsCategoryAxis() );
583 0 : pPage->SetCategories( m_pParameter->GetCategories() );
584 : }
585 0 : pPage->SupportAxisPositioning( m_pParameter->IsSupportingAxisPositioning() );
586 : }
587 : }
588 0 : break;
589 :
590 : case TP_SCALE:
591 : {
592 0 : ScaleTabPage* pScaleTabPage = dynamic_cast< ScaleTabPage* >( &rPage );
593 0 : if(pScaleTabPage)
594 : {
595 0 : pScaleTabPage->SetNumFormatter( m_pNumberFormatter );
596 0 : pScaleTabPage->ShowAxisOrigin( m_pParameter->ShowAxisOrigin() );
597 : }
598 : }
599 0 : break;
600 :
601 : case TP_DATA_DESCR:
602 : {
603 0 : DataLabelsTabPage* pLabelPage = dynamic_cast< DataLabelsTabPage* >( &rPage );
604 0 : if( pLabelPage )
605 0 : pLabelPage->SetNumberFormatter( m_pNumberFormatter );
606 : }
607 0 : break;
608 :
609 : case RID_SVXPAGE_NUMBERFORMAT:
610 0 : aSet.Put (SvxNumberInfoItem( m_pNumberFormatter, (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
611 0 : rPage.PageCreated(aSet);
612 0 : break;
613 : case TP_XERRORBAR:
614 : {
615 0 : ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( &rPage );
616 : OSL_ASSERT( pTabPage );
617 0 : if( pTabPage )
618 : {
619 0 : pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( m_fAxisMinorStepWidthForErrorBarDecimals );
620 0 : pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_X );
621 0 : pTabPage->SetChartDocumentForRangeChoosing( m_pParameter->getDocument());
622 : }
623 0 : break;
624 : }
625 : case TP_YERRORBAR:
626 : {
627 0 : ErrorBarsTabPage * pTabPage = dynamic_cast< ErrorBarsTabPage * >( &rPage );
628 : OSL_ASSERT( pTabPage );
629 0 : if( pTabPage )
630 : {
631 0 : pTabPage->SetAxisMinorStepWidthForErrorBarDecimals( m_fAxisMinorStepWidthForErrorBarDecimals );
632 0 : pTabPage->SetErrorBarType( ErrorBarResources::ERROR_BAR_Y );
633 0 : pTabPage->SetChartDocumentForRangeChoosing( m_pParameter->getDocument());
634 : }
635 0 : break;
636 : }
637 : case TP_OPTIONS:
638 : {
639 0 : SchOptionTabPage* pTabPage = dynamic_cast< SchOptionTabPage* >( &rPage );
640 0 : if( pTabPage && m_pParameter )
641 0 : pTabPage->Init( m_pParameter->ProvidesSecondaryYAxis(), m_pParameter->ProvidesOverlapAndGapWidth(),
642 0 : m_pParameter->ProvidesBarConnectors() );
643 0 : break;
644 : }
645 0 : }
646 0 : }
647 :
648 0 : IMPL_LINK_NOARG(SchAttribTabDlg, OKPressed)
649 : {
650 0 : m_bOKPressed = true;
651 0 : return m_aOriginalOKClickHdl.Call( this );
652 : }
653 :
654 0 : bool SchAttribTabDlg::DialogWasClosedWithOK() const
655 : {
656 0 : return m_bOKPressed;
657 : }
658 :
659 : //.............................................................................
660 3 : } //namespace chart
661 : //.............................................................................
662 :
663 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|