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