1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
30 
31 #include "DataSourceHelper.hxx"
32 #include "macros.hxx"
33 #include "ChartModelHelper.hxx"
34 #include "DiagramHelper.hxx"
35 #include "DataSeriesHelper.hxx"
36 #include "DataSource.hxx"
37 #include "ContainerHelper.hxx"
38 #include "ControllerLockGuard.hxx"
39 #include "PropertyHelper.hxx"
40 #include "CachedDataSequence.hxx"
41 #include "LabeledDataSequence.hxx"
42 
43 #include <com/sun/star/chart2/XChartDocument.hpp>
44 #include <com/sun/star/chart2/data/XDataSource.hpp>
45 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
46 
47 #include <com/sun/star/chart/ChartDataRowSource.hpp>
48 #include <com/sun/star/chart/ErrorBarStyle.hpp>
49 
50 //.............................................................................
51 namespace chart
52 {
53 //.............................................................................
54 using namespace ::com::sun::star;
55 using namespace ::com::sun::star::chart2;
56 using ::com::sun::star::uno::Reference;
57 using ::com::sun::star::uno::Sequence;
58 using ::rtl::OUString;
59 
60 namespace
61 {
62 void lcl_addRanges( ::std::vector< ::rtl::OUString > & rOutResult,
63                     const uno::Reference< data::XLabeledDataSequence > & xLabeledSeq )
64 {
65     if( ! xLabeledSeq.is())
66         return;
67     uno::Reference< data::XDataSequence > xSeq( xLabeledSeq->getLabel());
68     if( xSeq.is())
69         rOutResult.push_back( xSeq->getSourceRangeRepresentation());
70     xSeq.set( xLabeledSeq->getValues());
71     if( xSeq.is())
72         rOutResult.push_back( xSeq->getSourceRangeRepresentation());
73 }
74 
75 void lcl_addDataSourceRanges(
76     ::std::vector< ::rtl::OUString > & rOutResult,
77     const uno::Reference< data::XDataSource > & xDataSource )
78 {
79     if( xDataSource.is() )
80     {
81         uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
82         for( sal_Int32 i=0; i<aDataSequences.getLength(); ++i)
83             lcl_addRanges( rOutResult, aDataSequences[i] );
84     }
85 }
86 
87 void lcl_addErrorBarRanges(
88     ::std::vector< ::rtl::OUString > & rOutResult,
89     const uno::Reference< XDataSeries > & xDataSeries )
90 {
91     uno::Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
92     if( !xSeriesProp.is())
93         return;
94 
95     try
96     {
97         uno::Reference< beans::XPropertySet > xErrorBarProp;
98         if( ( xSeriesProp->getPropertyValue( C2U("ErrorBarY")) >>= xErrorBarProp ) &&
99             xErrorBarProp.is())
100         {
101             sal_Int32 eStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
102             if( ( xErrorBarProp->getPropertyValue( C2U("ErrorBarStyle")) >>= eStyle ) &&
103                 eStyle == ::com::sun::star::chart::ErrorBarStyle::FROM_DATA )
104             {
105                 uno::Reference< data::XDataSource > xErrorBarDataSource( xErrorBarProp, uno::UNO_QUERY );
106                 if( xErrorBarDataSource.is() )
107                     lcl_addDataSourceRanges( rOutResult, xErrorBarDataSource );
108             }
109         }
110     }
111     catch( const uno::Exception & ex )
112     {
113         ASSERT_EXCEPTION( ex );
114     }
115 }
116 
117 } // anonymous namespace
118 
119 Reference< chart2::data::XDataSource > DataSourceHelper::createDataSource(
120         const Sequence< Reference< chart2::data::XLabeledDataSequence > >& rSequences )
121 {
122     return new DataSource(rSequences);
123 }
124 
125 Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence()
126 {
127     return new ::chart::CachedDataSequence();
128 }
129 
130 Reference< chart2::data::XDataSequence > DataSourceHelper::createCachedDataSequence( const ::rtl::OUString& rSingleText )
131 {
132     return new ::chart::CachedDataSequence( rSingleText );
133 }
134 
135 Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
136         const Reference< chart2::data::XDataSequence >& xValues ,
137         const Reference< chart2::data::XDataSequence >& xLabels )
138 {
139     return new ::chart::LabeledDataSequence( xValues, xLabels );
140 }
141 
142 Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
143         const Reference< chart2::data::XDataSequence >& xValues )
144 {
145     return new ::chart::LabeledDataSequence( xValues );
146 }
147 
148 Reference< chart2::data::XLabeledDataSequence > DataSourceHelper::createLabeledDataSequence(
149         const Reference< uno::XComponentContext >& xContext )
150 {
151     return new ::chart::LabeledDataSequence( xContext );
152 }
153 
154 uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
155                                             bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories )
156 {
157     ::com::sun::star::chart::ChartDataRowSource eRowSource = ::com::sun::star::chart::ChartDataRowSource_ROWS;
158     if( bUseColumns )
159         eRowSource = ::com::sun::star::chart::ChartDataRowSource_COLUMNS;
160 
161     uno::Sequence< beans::PropertyValue > aArguments(3);
162     aArguments[0] = beans::PropertyValue( C2U("DataRowSource")
163         , -1, uno::makeAny( eRowSource )
164         , beans::PropertyState_DIRECT_VALUE );
165     aArguments[1] = beans::PropertyValue( C2U("FirstCellAsLabel")
166         , -1, uno::makeAny( bFirstCellAsLabel )
167         , beans::PropertyState_DIRECT_VALUE );
168     aArguments[2] = beans::PropertyValue( C2U("HasCategories")
169         , -1, uno::makeAny( bHasCategories )
170         , beans::PropertyState_DIRECT_VALUE );
171 
172     return aArguments;
173 }
174 
175 uno::Sequence< beans::PropertyValue > DataSourceHelper::createArguments(
176                                             const ::rtl::OUString & rRangeRepresentation,
177                                             const uno::Sequence< sal_Int32 >& rSequenceMapping,
178                                             bool bUseColumns, bool bFirstCellAsLabel, bool bHasCategories )
179 {
180     uno::Sequence< beans::PropertyValue > aArguments( createArguments( bUseColumns, bFirstCellAsLabel, bHasCategories ));
181     aArguments.realloc( aArguments.getLength() + 1 );
182     aArguments[aArguments.getLength() - 1] =
183         beans::PropertyValue( C2U("CellRangeRepresentation")
184                               , -1, uno::makeAny( rRangeRepresentation )
185                               , beans::PropertyState_DIRECT_VALUE );
186     if( rSequenceMapping.getLength() )
187     {
188         aArguments.realloc( aArguments.getLength() + 1 );
189         aArguments[aArguments.getLength() - 1] =
190             beans::PropertyValue( C2U("SequenceMapping")
191                                 , -1, uno::makeAny( rSequenceMapping )
192                                 , beans::PropertyState_DIRECT_VALUE );
193     }
194     return aArguments;
195 }
196 
197 void DataSourceHelper::readArguments( const uno::Sequence< beans::PropertyValue >& rArguments
198                                      , ::rtl::OUString & rRangeRepresentation, uno::Sequence< sal_Int32 >& rSequenceMapping
199             , bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories )
200 {
201     const beans::PropertyValue* pArguments = rArguments.getConstArray();
202 	for(sal_Int32 i=0; i<rArguments.getLength(); ++i, ++pArguments)
203 	{
204         const beans::PropertyValue& aProperty = *pArguments;
205 		if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DataRowSource" ) ))
206 		{
207             ::com::sun::star::chart::ChartDataRowSource eRowSource;
208 			if( aProperty.Value >>= eRowSource )
209                 bUseColumns = (eRowSource==::com::sun::star::chart::ChartDataRowSource_COLUMNS);
210 		}
211         else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FirstCellAsLabel" ) ))
212 		{
213 			aProperty.Value >>= bFirstCellAsLabel;
214 		}
215         else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasCategories" ) ))
216 		{
217 			aProperty.Value >>= bHasCategories;
218 		}
219         else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CellRangeRepresentation" ) ))
220         {
221             aProperty.Value >>= rRangeRepresentation;
222         }
223         else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SequenceMapping" ) ))
224         {
225             aProperty.Value >>= rSequenceMapping;
226         }
227     }
228 }
229 
230 uno::Reference< chart2::data::XDataSource > DataSourceHelper::pressUsedDataIntoRectangularFormat(
231         const uno::Reference< chart2::XChartDocument >& xChartDoc, bool bWithCategories )
232 {
233     ::std::vector< Reference< chart2::data::XLabeledDataSequence > > aResultVector;
234 
235     //categories are always the first sequence
236     Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram());
237 
238     if( bWithCategories )
239     {
240         Reference< chart2::data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
241         if( xCategories.is() )
242             aResultVector.push_back( xCategories );
243     }
244 
245     ::std::vector< Reference< chart2::XDataSeries > > xSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
246     uno::Reference< chart2::data::XDataSource > xSeriesSource(
247         DataSeriesHelper::getDataSource( ContainerHelper::ContainerToSequence(xSeriesVector) ) );
248     Sequence< Reference< chart2::data::XLabeledDataSequence > > aDataSeqences( xSeriesSource->getDataSequences() );
249 
250     //the first x-values is always the next sequence //todo ... other x-values get lost for old format
251     Reference< chart2::data::XLabeledDataSequence > xXValues(
252         DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-x") ) );
253     if( xXValues.is() )
254         aResultVector.push_back( xXValues );
255 
256     //add all other sequences now without x-values
257     for( sal_Int32 nN=0; nN<aDataSeqences.getLength(); nN++ )
258     {
259         OUString aRole( DataSeriesHelper::GetRole( aDataSeqences[nN] ) );
260         if( !aRole.equals(C2U("values-x")) )
261             aResultVector.push_back( aDataSeqences[nN] );
262     }
263 
264     Sequence< Reference< chart2::data::XLabeledDataSequence > > aResultSequence( aResultVector.size() );
265     ::std::copy( aResultVector.begin(), aResultVector.end(), aResultSequence.getArray() );
266 
267     return new DataSource( aResultSequence );
268 }
269 
270 uno::Sequence< ::rtl::OUString > DataSourceHelper::getUsedDataRanges(
271     const uno::Reference< chart2::XDiagram > & xDiagram )
272 {
273     ::std::vector< ::rtl::OUString > aResult;
274 
275     if( xDiagram.is())
276     {
277         uno::Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
278         if( xCategories.is() )
279             lcl_addRanges( aResult, xCategories );
280 
281         ::std::vector< uno::Reference< XDataSeries > > aSeriesVector( DiagramHelper::getDataSeriesFromDiagram( xDiagram ) );
282         for( ::std::vector< uno::Reference< XDataSeries > >::const_iterator aSeriesIt( aSeriesVector.begin() )
283                  ; aSeriesIt != aSeriesVector.end(); ++aSeriesIt )
284         {
285             uno::Reference< data::XDataSource > xDataSource( *aSeriesIt, uno::UNO_QUERY );
286             lcl_addDataSourceRanges( aResult, xDataSource );
287             lcl_addErrorBarRanges( aResult, *aSeriesIt );
288         }
289     }
290 
291     return ContainerHelper::ContainerToSequence( aResult );
292 }
293 
294 uno::Sequence< ::rtl::OUString > DataSourceHelper::getUsedDataRanges( const uno::Reference< frame::XModel > & xChartModel )
295 {
296     uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
297     return getUsedDataRanges( xDiagram );
298 }
299 
300 uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
301     const uno::Reference< chart2::XChartDocument >& xChartDoc )
302 {
303     return pressUsedDataIntoRectangularFormat( xChartDoc );
304 }
305 
306 uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
307     const uno::Reference< frame::XModel >& xChartModel )
308 {
309     ::std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > aResult;
310 
311     uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
312     uno::Reference< data::XLabeledDataSequence > xCategories( DiagramHelper::getCategoriesFromDiagram( xDiagram ) );
313     if( xCategories.is() )
314         aResult.push_back( xCategories );
315 
316     ::std::vector< uno::Reference< XDataSeries > > aSeriesVector( ChartModelHelper::getDataSeries( xChartModel ) );
317     for( ::std::vector< uno::Reference< XDataSeries > >::const_iterator aSeriesIt( aSeriesVector.begin() )
318         ; aSeriesIt != aSeriesVector.end(); ++aSeriesIt )
319     {
320         uno::Reference< data::XDataSource > xDataSource( *aSeriesIt, uno::UNO_QUERY );
321         if( !xDataSource.is() )
322             continue;
323         uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
324         ::std::copy( aDataSequences.getConstArray(), aDataSequences.getConstArray() + aDataSequences.getLength(),
325                      ::std::back_inserter( aResult ));
326     }
327 
328     return uno::Reference< chart2::data::XDataSource >(
329         new DataSource( ContainerHelper::ContainerToSequence( aResult )));
330 }
331 
332 bool DataSourceHelper::detectRangeSegmentation(
333     const uno::Reference<
334         frame::XModel >& xChartModel
335     , ::rtl::OUString& rOutRangeString
336     , ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping
337     , bool& rOutUseColumns
338     , bool& rOutFirstCellAsLabel
339     , bool& rOutHasCategories )
340 {
341     bool bSomethingDetected = false;
342 
343     uno::Reference< XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY );
344     if( !xChartDocument.is() )
345         return bSomethingDetected;
346     uno::Reference< data::XDataProvider >  xDataProvider( xChartDocument->getDataProvider() );
347     if( !xDataProvider.is() )
348         return bSomethingDetected;
349 
350     try
351     {
352         DataSourceHelper::readArguments(
353             xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument ) ),
354             rOutRangeString, rSequenceMapping, rOutUseColumns, rOutFirstCellAsLabel, rOutHasCategories );
355         bSomethingDetected = (rOutRangeString.getLength() > 0);
356 
357         uno::Reference< chart2::data::XLabeledDataSequence > xCategories(
358                     DiagramHelper::getCategoriesFromDiagram( xChartDocument->getFirstDiagram() ));
359         rOutHasCategories = xCategories.is();
360     }
361     catch( uno::Exception & ex )
362     {
363         ASSERT_EXCEPTION( ex );
364     }
365     return bSomethingDetected;
366 }
367 
368 bool DataSourceHelper::allArgumentsForRectRangeDetected(
369     const uno::Reference< chart2::XChartDocument >& xChartDocument )
370 {
371     bool bHasDataRowSource = false;
372     bool bHasFirstCellAsLabel = false;
373 //     bool bHasHasCategories = false;
374     bool bHasCellRangeRepresentation = false;
375 //     bool bHasSequenceMapping = false;
376 
377     uno::Reference< data::XDataProvider > xDataProvider( xChartDocument->getDataProvider() );
378     if( !xDataProvider.is() )
379         return false;
380 
381     try
382     {
383         const uno::Sequence< beans::PropertyValue > aArguments(
384             xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument )));
385         const beans::PropertyValue* pArguments = aArguments.getConstArray();
386         for(sal_Int32 i=0; i<aArguments.getLength(); ++i, ++pArguments)
387         {
388             const beans::PropertyValue& aProperty = *pArguments;
389             if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DataRowSource" ) ))
390             {
391                 bHasDataRowSource =
392                     (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(
393                         ::getCppuType( reinterpret_cast<
394                                        const ::com::sun::star::chart::ChartDataRowSource * >(0))));
395             }
396             else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FirstCellAsLabel" ) ))
397             {
398                 bHasFirstCellAsLabel =
399                     (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(::getBooleanCppuType()));
400             }
401 //             else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HasCategories" ) ))
402 //             {
403 //                 bHasHasCategories =
404 //                     (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(::getBooleanCppuType()));
405 //             }
406             else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CellRangeRepresentation" ) ))
407             {
408                 ::rtl::OUString aRange;
409                 bHasCellRangeRepresentation =
410                     (aProperty.Value.hasValue() && (aProperty.Value >>= aRange) && aRange.getLength() > 0);
411             }
412 //         else if( aProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SequenceMapping" ) ))
413 //         {
414 //             bHasSequenceMapping =
415 //                 (aProperty.Value.hasValue() && aProperty.Value.isExtractableTo(
416 //                     ::getCppuType( reinterpret_cast<
417 //                                    const uno::Sequence< sal_Int32 > * >(0))));
418 //         }
419         }
420     }
421     catch( const uno::Exception & ex )
422     {
423         ASSERT_EXCEPTION( ex );
424     }
425 
426     return (bHasCellRangeRepresentation && bHasDataRowSource && bHasFirstCellAsLabel);
427 }
428 
429 void DataSourceHelper::setRangeSegmentation(
430             const uno::Reference< frame::XModel >& xChartModel
431             , const ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping
432             , bool bUseColumns , bool bFirstCellAsLabel, bool bUseCategories )
433 {
434     uno::Reference< XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY );
435     if( !xChartDocument.is() )
436         return;
437     uno::Reference< data::XDataProvider > xDataProvider( xChartDocument->getDataProvider() );
438     if( !xDataProvider.is() )
439         return;
440     uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
441     if( !xDiagram.is() )
442         return;
443     uno::Reference< chart2::XChartTypeManager > xChartTypeManager( xChartDocument->getChartTypeManager() );
444     if( !xChartTypeManager.is() )
445         return;
446     uno::Reference< lang::XMultiServiceFactory > xTemplateFactory( xChartTypeManager, uno::UNO_QUERY );
447     if( !xTemplateFactory.is() )
448         return;
449 
450     ::rtl::OUString aRangeString;
451     bool bDummy;
452     uno::Sequence< sal_Int32 > aDummy;
453     readArguments( xDataProvider->detectArguments( pressUsedDataIntoRectangularFormat( xChartDocument )),
454                    aRangeString, aDummy, bDummy, bDummy, bDummy );
455 
456     uno::Sequence< beans::PropertyValue > aArguments(
457         createArguments( aRangeString, rSequenceMapping, bUseColumns, bFirstCellAsLabel, bUseCategories ) );
458 
459     uno::Reference< chart2::data::XDataSource > xDataSource( xDataProvider->createDataSource(
460                                                                  aArguments ) );
461     if( !xDataSource.is() )
462         return;
463 
464     ControllerLockGuard aCtrlLockGuard( xChartModel );
465     xDiagram->setDiagramData( xDataSource, aArguments );
466 }
467 
468 Sequence< OUString > DataSourceHelper::getRangesFromLabeledDataSequence(
469     const Reference< data::XLabeledDataSequence > & xLSeq )
470 {
471     Sequence< OUString > aResult;
472     if( xLSeq.is())
473     {
474         Reference< data::XDataSequence > xLabel( xLSeq->getLabel());
475         Reference< data::XDataSequence > xValues( xLSeq->getValues());
476 
477         if( xLabel.is())
478         {
479             if( xValues.is())
480             {
481                 aResult.realloc( 2 );
482                 aResult[0] = xLabel->getSourceRangeRepresentation();
483                 aResult[1] = xValues->getSourceRangeRepresentation();
484             }
485             else
486             {
487                 aResult.realloc( 1 );
488                 aResult[0] = xLabel->getSourceRangeRepresentation();
489             }
490         }
491         else if( xValues.is())
492         {
493             aResult.realloc( 1 );
494             aResult[0] = xValues->getSourceRangeRepresentation();
495         }
496     }
497     return aResult;
498 }
499 
500 OUString DataSourceHelper::getRangeFromValues(
501     const Reference< data::XLabeledDataSequence > & xLSeq )
502 {
503     OUString aResult;
504     if( xLSeq.is() )
505     {
506         Reference< data::XDataSequence > xValues( xLSeq->getValues() );
507         if( xValues.is() )
508             aResult = xValues->getSourceRangeRepresentation();
509     }
510     return aResult;
511 }
512 
513 Sequence< OUString > DataSourceHelper::getRangesFromDataSource( const Reference< data::XDataSource > & xSource )
514 {
515     ::std::vector< OUString > aResult;
516     if( xSource.is())
517     {
518         Sequence< Reference< data::XLabeledDataSequence > > aLSeqSeq( xSource->getDataSequences());
519         for( sal_Int32 i=0; i<aLSeqSeq.getLength(); ++i )
520         {
521             Reference< data::XDataSequence > xLabel( aLSeqSeq[i]->getLabel());
522             Reference< data::XDataSequence > xValues( aLSeqSeq[i]->getValues());
523 
524             if( xLabel.is())
525                 aResult.push_back( xLabel->getSourceRangeRepresentation());
526             if( xValues.is())
527                 aResult.push_back( xValues->getSourceRangeRepresentation());
528         }
529     }
530     return ContainerHelper::ContainerToSequence( aResult );
531 }
532 
533 //.............................................................................
534 } //namespace chart
535 //.............................................................................
536