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 
31*cdf0e10cSrcweir #include "ChartDebugTrace.hxx"
32*cdf0e10cSrcweir #include "macros.hxx"
33*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/chart2/AxisType.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/chart2/XChartTypeContainer.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/chart2/StackingDirection.hpp>
39*cdf0e10cSrcweir #include <rtl/math.hxx>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir using namespace ::com::sun::star;
42*cdf0e10cSrcweir using namespace ::com::sun::star::chart2;
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
45*cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
46*cdf0e10cSrcweir using ::rtl::OUString;
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir namespace
51*cdf0e10cSrcweir {
52*cdf0e10cSrcweir /*
53*cdf0e10cSrcweir const char lcl_aSpace=' ';
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir void lcl_IndentedTrace( int nIndent, char* pStr )
56*cdf0e10cSrcweir {
57*cdf0e10cSrcweir     if( nIndent > 0 )
58*cdf0e10cSrcweir     {
59*cdf0e10cSrcweir         OSL_TRACE( "%*c%s", nIndent, lcl_aSpace, pStr );
60*cdf0e10cSrcweir     }
61*cdf0e10cSrcweir     else
62*cdf0e10cSrcweir     {
63*cdf0e10cSrcweir         OSL_TRACE( pStr );
64*cdf0e10cSrcweir     }
65*cdf0e10cSrcweir }
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir void lcl_TraceException( const uno::Exception & aEx )
68*cdf0e10cSrcweir {
69*cdf0e10cSrcweir     OSL_TRACE(
70*cdf0e10cSrcweir         U2C( C2U( "*** Exception caught during trace. Type: " ) +
71*cdf0e10cSrcweir              OUString::createFromAscii( typeid( aEx ).name()) +
72*cdf0e10cSrcweir              C2U( ", Message: " ) +
73*cdf0e10cSrcweir              aEx.Message ));
74*cdf0e10cSrcweir }
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir void lcl_TraceCategories( const Reference< data::XLabeledDataSequence > & xCat, int nIndent )
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir     if( ! xCat.is())
79*cdf0e10cSrcweir         return;
80*cdf0e10cSrcweir     try
81*cdf0e10cSrcweir     {
82*cdf0e10cSrcweir         Reference< data::XDataSequence > xValues( xCat->getValues());
83*cdf0e10cSrcweir         if( xValues.is())
84*cdf0e10cSrcweir         {
85*cdf0e10cSrcweir             OSL_TRACE( "%*ccategories: source: %s", nIndent, lcl_aSpace,
86*cdf0e10cSrcweir                        U2C( xValues->getSourceRangeRepresentation()));
87*cdf0e10cSrcweir         }
88*cdf0e10cSrcweir         Reference< data::XDataSequence > xLabel( xCat->getLabel());
89*cdf0e10cSrcweir         if( xLabel.is())
90*cdf0e10cSrcweir         {
91*cdf0e10cSrcweir             OSL_TRACE( "%*ccategories' label: source: %s", nIndent, lcl_aSpace,
92*cdf0e10cSrcweir                        U2C( xLabel->getSourceRangeRepresentation()));
93*cdf0e10cSrcweir         }
94*cdf0e10cSrcweir     }
95*cdf0e10cSrcweir     catch( uno::Exception & ex )
96*cdf0e10cSrcweir     {
97*cdf0e10cSrcweir         lcl_TraceException( ex );
98*cdf0e10cSrcweir     }
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir void lcl_TraceDataSeriesSeq( const Sequence< Reference< XDataSeries > > & aSeries, int nIndent )
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir     for( sal_Int32 j = 0; j < aSeries.getLength(); ++j )
104*cdf0e10cSrcweir     {
105*cdf0e10cSrcweir         Reference< beans::XPropertySet > xProp( aSeries[j], uno::UNO_QUERY );
106*cdf0e10cSrcweir         OUString aId;
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir         OSL_TRACE( "%*cindex %ld", nIndent, lcl_aSpace, j );
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir         StackingDirection aStDir;
111*cdf0e10cSrcweir         if( xProp.is() &&
112*cdf0e10cSrcweir             ( xProp->getPropertyValue( C2U( "StackingDirection" )) >>= aStDir ) &&
113*cdf0e10cSrcweir             aStDir != StackingDirection_NO_STACKING )
114*cdf0e10cSrcweir         {
115*cdf0e10cSrcweir             OSL_TRACE( "%*cstacking in %s", nIndent + 2, lcl_aSpace,
116*cdf0e10cSrcweir                        (aStDir == StackingDirection_Y_STACKING)
117*cdf0e10cSrcweir                        ? "y-direction" : "z-direction" );
118*cdf0e10cSrcweir         }
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir         Reference< data::XDataSource > xSource( aSeries[j], uno::UNO_QUERY );
121*cdf0e10cSrcweir         if( xSource.is())
122*cdf0e10cSrcweir         {
123*cdf0e10cSrcweir             Sequence< Reference< data::XLabeledDataSequence > > aSequences( xSource->getDataSequences());
124*cdf0e10cSrcweir             const sal_Int32 nMax = aSequences.getLength();
125*cdf0e10cSrcweir             for( sal_Int32 k = 0; k < nMax; ++k )
126*cdf0e10cSrcweir             {
127*cdf0e10cSrcweir                 if( aSequences[k].is())
128*cdf0e10cSrcweir                 {
129*cdf0e10cSrcweir                     OUString aSourceId(C2U("<none>"));
130*cdf0e10cSrcweir                     if( aSequences[k]->getValues().is())
131*cdf0e10cSrcweir                         aSourceId = aSequences[k]->getValues()->getSourceRangeRepresentation();
132*cdf0e10cSrcweir                     xProp.set( aSequences[k]->getValues(), uno::UNO_QUERY );
133*cdf0e10cSrcweir                     if( xProp.is() &&
134*cdf0e10cSrcweir                         ( xProp->getPropertyValue( C2U( "Role" )) >>= aId ))
135*cdf0e10cSrcweir                     {
136*cdf0e10cSrcweir                         OSL_TRACE( "%*cdata sequence %d: role: %s, source: %s",
137*cdf0e10cSrcweir                                    nIndent + 2, lcl_aSpace, k, U2C( aId ), U2C( aSourceId ));
138*cdf0e10cSrcweir                     }
139*cdf0e10cSrcweir                     else
140*cdf0e10cSrcweir                     {
141*cdf0e10cSrcweir                         OSL_TRACE( "%*cdata sequence %d, unknown role, source: %s",
142*cdf0e10cSrcweir                                    nIndent + 2, lcl_aSpace, k, U2C( aSourceId ) );
143*cdf0e10cSrcweir                     }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir                     aSourceId = C2U("<none>");
146*cdf0e10cSrcweir                     if( aSequences[k]->getLabel().is())
147*cdf0e10cSrcweir                         aSourceId = OUString( aSequences[k]->getLabel()->getSourceRangeRepresentation());
148*cdf0e10cSrcweir                     xProp.set( aSequences[k]->getLabel(), uno::UNO_QUERY );
149*cdf0e10cSrcweir                     if( xProp.is() &&
150*cdf0e10cSrcweir                         ( xProp->getPropertyValue( C2U( "Role" )) >>= aId ))
151*cdf0e10cSrcweir                     {
152*cdf0e10cSrcweir                         OSL_TRACE( "%*cdata sequence label %d: role: %s, source: %s",
153*cdf0e10cSrcweir                                    nIndent + 2, lcl_aSpace, k, U2C( aId ), U2C( aSourceId ));
154*cdf0e10cSrcweir                     }
155*cdf0e10cSrcweir                     else
156*cdf0e10cSrcweir                     {
157*cdf0e10cSrcweir                         OSL_TRACE( "%*cdata sequence label %d: unknown role, source: %s",
158*cdf0e10cSrcweir                                    nIndent + 2, lcl_aSpace, k, U2C( aSourceId ) );
159*cdf0e10cSrcweir                     }
160*cdf0e10cSrcweir                 }
161*cdf0e10cSrcweir             }
162*cdf0e10cSrcweir         }
163*cdf0e10cSrcweir     }
164*cdf0e10cSrcweir }
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir void lcl_TraceChartType( const Reference< XChartType > & xChartType, int nIndent )
167*cdf0e10cSrcweir {
168*cdf0e10cSrcweir     if( xChartType.is())
169*cdf0e10cSrcweir     {
170*cdf0e10cSrcweir         OSL_TRACE( "%*c* type: %s", nIndent, lcl_aSpace, U2C( xChartType->getChartType()) );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir         lcl_IndentedTrace( nIndent + 2, "Supported Roles" );
173*cdf0e10cSrcweir         sal_Int32 i=0;
174*cdf0e10cSrcweir         Sequence< OUString > aMandRoles( xChartType->getSupportedMandatoryRoles());
175*cdf0e10cSrcweir         if( aMandRoles.getLength() > 0 )
176*cdf0e10cSrcweir         {
177*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent + 4, "mandatory" );
178*cdf0e10cSrcweir             for( i=0; i<aMandRoles.getLength(); ++i )
179*cdf0e10cSrcweir             {
180*cdf0e10cSrcweir                 OSL_TRACE( "%*c%s", nIndent + 6, lcl_aSpace, U2C( aMandRoles[i] ));
181*cdf0e10cSrcweir             }
182*cdf0e10cSrcweir         }
183*cdf0e10cSrcweir         Sequence< OUString > aOptRoles( xChartType->getSupportedOptionalRoles());
184*cdf0e10cSrcweir         if( aOptRoles.getLength() > 0 )
185*cdf0e10cSrcweir         {
186*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent + 4, "optional" );
187*cdf0e10cSrcweir             for( i=0; i<aOptRoles.getLength(); ++i )
188*cdf0e10cSrcweir             {
189*cdf0e10cSrcweir                 OSL_TRACE( "%*c%s", nIndent + 6, lcl_aSpace, U2C( aOptRoles[i] ));
190*cdf0e10cSrcweir             }
191*cdf0e10cSrcweir         }
192*cdf0e10cSrcweir         OSL_TRACE( "%*crole of sequence for label: %s", nIndent + 2, lcl_aSpace,
193*cdf0e10cSrcweir                    U2C( xChartType->getRoleOfSequenceForSeriesLabel()));
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir         Reference< XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY );
196*cdf0e10cSrcweir         if( xDSCnt.is())
197*cdf0e10cSrcweir         {
198*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent + 2, "Data Series" );
199*cdf0e10cSrcweir             lcl_TraceDataSeriesSeq( xDSCnt->getDataSeries(), nIndent + 4 );
200*cdf0e10cSrcweir         }
201*cdf0e10cSrcweir     }
202*cdf0e10cSrcweir }
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir void lcl_TraceCoordinateSystem( const Reference< XCoordinateSystem > & xCooSys, int nIndent )
205*cdf0e10cSrcweir {
206*cdf0e10cSrcweir     if( xCooSys.is()) try
207*cdf0e10cSrcweir     {
208*cdf0e10cSrcweir         sal_Int32 nDim = xCooSys->getDimension();
209*cdf0e10cSrcweir         OSL_TRACE( "%*c* dim: %ld, type: %s", nIndent, lcl_aSpace,
210*cdf0e10cSrcweir                    nDim, U2C( xCooSys->getCoordinateSystemType() ));
211*cdf0e10cSrcweir         nIndent += 2;
212*cdf0e10cSrcweir         OSL_TRACE( "%*cview service-name: %s", nIndent, lcl_aSpace,
213*cdf0e10cSrcweir                    U2C( xCooSys->getViewServiceName() ));
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir         Reference< beans::XPropertySet > xProp( xCooSys, uno::UNO_QUERY );
216*cdf0e10cSrcweir         if( xProp.is())
217*cdf0e10cSrcweir         {
218*cdf0e10cSrcweir             Reference< beans::XPropertySetInfo > xInfo( xProp->getPropertySetInfo(), uno::UNO_QUERY );
219*cdf0e10cSrcweir             sal_Bool bSwap;
220*cdf0e10cSrcweir             if( xInfo.is() &&
221*cdf0e10cSrcweir                 xInfo->hasPropertyByName( C2U("SwapXAndYAxis")) &&
222*cdf0e10cSrcweir                 (xProp->getPropertyValue( C2U("SwapXAndYAxis")) >>= bSwap) &&
223*cdf0e10cSrcweir                 bSwap )
224*cdf0e10cSrcweir             {
225*cdf0e10cSrcweir                 lcl_IndentedTrace( nIndent, "swap x-axis and y-axis" );
226*cdf0e10cSrcweir             }
227*cdf0e10cSrcweir         }
228*cdf0e10cSrcweir 
229*cdf0e10cSrcweir         if( nDim >= 2 )
230*cdf0e10cSrcweir         {
231*cdf0e10cSrcweir             const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(1);
232*cdf0e10cSrcweir             for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI)
233*cdf0e10cSrcweir             {
234*cdf0e10cSrcweir                 Reference< XScale > xScale( xCooSys->getAxisByDimension( 1, nI ));
235*cdf0e10cSrcweir                 if( xScale.is())
236*cdf0e10cSrcweir                 {
237*cdf0e10cSrcweir                     ScaleData aData( xScale->getScaleData());
238*cdf0e10cSrcweir                     if( aData.AxisType==AxisType::PERCENT )
239*cdf0e10cSrcweir                         lcl_IndentedTrace( nIndent, "percent stacking at y-scale" );
240*cdf0e10cSrcweir                 }
241*cdf0e10cSrcweir             }
242*cdf0e10cSrcweir         }
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir         Sequence< uno::Any > aOrigin( xCooSys->getOrigin());
245*cdf0e10cSrcweir         double x, y, z;
246*cdf0e10cSrcweir         ::rtl::math::setNan( &x ), ::rtl::math::setNan( &y ), ::rtl::math::setNan( &z );
247*cdf0e10cSrcweir         if( aOrigin.getLength() > 0 &&
248*cdf0e10cSrcweir             aOrigin[0].hasValue() )
249*cdf0e10cSrcweir             aOrigin[0] >>= x;
250*cdf0e10cSrcweir         if( aOrigin.getLength() > 1 &&
251*cdf0e10cSrcweir             aOrigin[1].hasValue() )
252*cdf0e10cSrcweir             aOrigin[1] >>= y;
253*cdf0e10cSrcweir         if( aOrigin.getLength() > 2 &&
254*cdf0e10cSrcweir             aOrigin[2].hasValue() )
255*cdf0e10cSrcweir             aOrigin[2] >>= z;
256*cdf0e10cSrcweir         OSL_TRACE( "%*corigin: (%f, %f, %f)", nIndent, lcl_aSpace, x, y, z );
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir         Reference< XChartTypeContainer > xCTCnt( xCooSys, uno::UNO_QUERY );
259*cdf0e10cSrcweir         if( xCTCnt.is())
260*cdf0e10cSrcweir         {
261*cdf0e10cSrcweir             Sequence< Reference< XChartType > > aChartTypes( xCTCnt->getChartTypes());
262*cdf0e10cSrcweir             if( aChartTypes.getLength() > 0 )
263*cdf0e10cSrcweir             {
264*cdf0e10cSrcweir                 lcl_IndentedTrace( nIndent, "Chart Types" );
265*cdf0e10cSrcweir                 for( sal_Int32 i=0; i<aChartTypes.getLength(); ++i )
266*cdf0e10cSrcweir                 {
267*cdf0e10cSrcweir                     lcl_TraceChartType( aChartTypes[i], nIndent + 2 );
268*cdf0e10cSrcweir                 }
269*cdf0e10cSrcweir             }
270*cdf0e10cSrcweir         }
271*cdf0e10cSrcweir     }
272*cdf0e10cSrcweir     catch( uno::Exception & ex )
273*cdf0e10cSrcweir     {
274*cdf0e10cSrcweir         lcl_TraceException( ex );
275*cdf0e10cSrcweir     }
276*cdf0e10cSrcweir }
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir void lcl_TraceMeter(
279*cdf0e10cSrcweir     const Reference< XMeter > & xMeter,
280*cdf0e10cSrcweir     const Sequence< Reference< XCoordinateSystem > > & aCooSys,
281*cdf0e10cSrcweir     bool bWithCategories,
282*cdf0e10cSrcweir     int nIndent )
283*cdf0e10cSrcweir {
284*cdf0e10cSrcweir     try
285*cdf0e10cSrcweir     {
286*cdf0e10cSrcweir         Reference< XCoordinateSystem > xCooSys( xMeter->getCoordinateSystem());
287*cdf0e10cSrcweir         for( sal_Int32 i=0; i<aCooSys.getLength(); ++i )
288*cdf0e10cSrcweir             if( aCooSys[i] == xCooSys )
289*cdf0e10cSrcweir             {
290*cdf0e10cSrcweir                 OSL_TRACE( "%*cbelongs to Coordinate System %ld.", nIndent + 2, lcl_aSpace, i );
291*cdf0e10cSrcweir             }
292*cdf0e10cSrcweir         OSL_TRACE( "%*crepresents  Dimension %ld.", nIndent + 2, lcl_aSpace, xMeter->getRepresentedDimension());
293*cdf0e10cSrcweir         if( bWithCategories )
294*cdf0e10cSrcweir         {
295*cdf0e10cSrcweir             Reference< XScale > xScale( xCooSys->getAxisByDimension( xMeter->getRepresentedDimension(), xMeter->getIndex() ));
296*cdf0e10cSrcweir             if( xScale.is())
297*cdf0e10cSrcweir             {
298*cdf0e10cSrcweir                 ScaleData aData = xScale->getScaleData();
299*cdf0e10cSrcweir                 if( aData.Categories.is())
300*cdf0e10cSrcweir                 {
301*cdf0e10cSrcweir                     lcl_TraceCategories( aData.Categories, nIndent + 2 );
302*cdf0e10cSrcweir                 }
303*cdf0e10cSrcweir             }
304*cdf0e10cSrcweir         }
305*cdf0e10cSrcweir     }
306*cdf0e10cSrcweir     catch( uno::Exception & ex )
307*cdf0e10cSrcweir     {
308*cdf0e10cSrcweir         lcl_TraceException( ex );
309*cdf0e10cSrcweir     }
310*cdf0e10cSrcweir }
311*cdf0e10cSrcweir */
312*cdf0e10cSrcweir } // anonymous namespace
313*cdf0e10cSrcweir #endif
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir namespace chart
317*cdf0e10cSrcweir {
318*cdf0e10cSrcweir namespace debug
319*cdf0e10cSrcweir {
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir void ChartDebugTraceDocument(
324*cdf0e10cSrcweir     const Reference< XChartDocument > & /*xDoc*/,
325*cdf0e10cSrcweir     int /*nIndent*/ )
326*cdf0e10cSrcweir {
327*cdf0e10cSrcweir     /*
328*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
329*cdf0e10cSrcweir     try
330*cdf0e10cSrcweir     {
331*cdf0e10cSrcweir         OSL_TRACE( "%*cas %sternal data", nIndent, 'h',
332*cdf0e10cSrcweir                    xDoc->hasInternalDataProvider() ? "in": "ex" );
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir         Reference< lang::XMultiServiceFactory > xCTManager( xDoc->getChartTypeManager(), uno::UNO_QUERY );
335*cdf0e10cSrcweir         if( xCTManager.is())
336*cdf0e10cSrcweir         {
337*cdf0e10cSrcweir             Sequence< OUString > aServiceNames( xCTManager->getAvailableServiceNames());
338*cdf0e10cSrcweir             OSL_TRACE( "%*c ChartTypeManager has %ld entries", nIndent, '*', aServiceNames.getLength());
339*cdf0e10cSrcweir # if OSL_DEBUG_LEVEL >= (CHART_TRACE_OSL_DEBUG_LEVEL + 1)
340*cdf0e10cSrcweir             for( sal_Int32 i=0; i<aServiceNames.getLength(); ++i )
341*cdf0e10cSrcweir             {
342*cdf0e10cSrcweir                 OSL_TRACE( "%*c%s", nIndent + 2, lcl_aSpace, U2C( aServiceNames[i] ));
343*cdf0e10cSrcweir             }
344*cdf0e10cSrcweir # endif
345*cdf0e10cSrcweir         }
346*cdf0e10cSrcweir         Reference< XDiagram > xDiagram( xDoc->getFirstDiagram());
347*cdf0e10cSrcweir         lcl_IndentedTrace( nIndent, "* Diagram" );
348*cdf0e10cSrcweir         ChartDebugTraceDiagram( xDiagram, nIndent + 2 );
349*cdf0e10cSrcweir     }
350*cdf0e10cSrcweir     catch( uno::Exception & ex )
351*cdf0e10cSrcweir     {
352*cdf0e10cSrcweir         lcl_TraceException( ex );
353*cdf0e10cSrcweir     }
354*cdf0e10cSrcweir #endif
355*cdf0e10cSrcweir     */
356*cdf0e10cSrcweir }
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir void ChartDebugTraceDiagram(
359*cdf0e10cSrcweir     const Reference< XDiagram > & /*xDiagram*/,
360*cdf0e10cSrcweir     int /*nIndent*/ )
361*cdf0e10cSrcweir {
362*cdf0e10cSrcweir     /*
363*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL >= CHART_TRACE_OSL_DEBUG_LEVEL
364*cdf0e10cSrcweir     try
365*cdf0e10cSrcweir     {
366*cdf0e10cSrcweir         Reference< XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
367*cdf0e10cSrcweir         Sequence< Reference< XCoordinateSystem > > aCooSys( xCooSysCnt->getCoordinateSystems() );
368*cdf0e10cSrcweir         if( aCooSys.getLength() > 0 )
369*cdf0e10cSrcweir         {
370*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "CoordinateSystems" );
371*cdf0e10cSrcweir             for( sal_Int32 i=0; i<aCooSys.getLength(); ++i )
372*cdf0e10cSrcweir                 lcl_TraceCoordinateSystem( aCooSys[i], nIndent + 2 );
373*cdf0e10cSrcweir         }
374*cdf0e10cSrcweir         else
375*cdf0e10cSrcweir         {
376*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "<No Coordinate Systems>" );
377*cdf0e10cSrcweir         }
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir         Reference< XAxisContainer > xAxisCnt( xDiagram, uno::UNO_QUERY_THROW );
380*cdf0e10cSrcweir         Sequence< Reference< XAxis > > aAxes( xAxisCnt->getAxes() );
381*cdf0e10cSrcweir         if( aAxes.getLength() > 0 )
382*cdf0e10cSrcweir         {
383*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "Axes" );
384*cdf0e10cSrcweir             for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
385*cdf0e10cSrcweir                 lcl_TraceMeter( Reference< XMeter >( aAxes[i], uno::UNO_QUERY ), aCooSys, true, nIndent + 2 );
386*cdf0e10cSrcweir         }
387*cdf0e10cSrcweir         else
388*cdf0e10cSrcweir         {
389*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "<No Axes>" );
390*cdf0e10cSrcweir         }
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir         Reference< XGridContainer > xGridCnt( xDiagram, uno::UNO_QUERY_THROW );
393*cdf0e10cSrcweir         Sequence< Reference< XGrid > > aGrids( xGridCnt->getGrids() );
394*cdf0e10cSrcweir         if( aGrids.getLength() > 0 )
395*cdf0e10cSrcweir         {
396*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "Grids" );
397*cdf0e10cSrcweir             for( sal_Int32 i=0; i<aGrids.getLength(); ++i )
398*cdf0e10cSrcweir                 lcl_TraceMeter( Reference< XMeter >( aGrids[i], uno::UNO_QUERY ), aCooSys, false, nIndent + 2 );
399*cdf0e10cSrcweir         }
400*cdf0e10cSrcweir         else
401*cdf0e10cSrcweir         {
402*cdf0e10cSrcweir             lcl_IndentedTrace( nIndent, "<No Grids>" );
403*cdf0e10cSrcweir         }
404*cdf0e10cSrcweir     }
405*cdf0e10cSrcweir     catch( uno::Exception & ex )
406*cdf0e10cSrcweir     {
407*cdf0e10cSrcweir         lcl_TraceException( ex );
408*cdf0e10cSrcweir     }
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir #endif
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir */
413*cdf0e10cSrcweir }
414*cdf0e10cSrcweir #endif
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir } // namespace debug
417*cdf0e10cSrcweir } //  namespace chart
418