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