Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include "oox/drawingml/chart/datasourceconverter.hxx"
21 : :
22 : : #include <com/sun/star/chart2/XChartDocument.hpp>
23 : : #include "oox/drawingml/chart/chartconverter.hxx"
24 : : #include "oox/drawingml/chart/datasourcemodel.hxx"
25 : : #include "oox/token/properties.hxx"
26 : :
27 : : namespace oox {
28 : : namespace drawingml {
29 : : namespace chart {
30 : :
31 : : // ============================================================================
32 : :
33 : : using namespace ::com::sun::star::chart2::data;
34 : : using namespace ::com::sun::star::uno;
35 : :
36 : : using ::rtl::OUString;
37 : :
38 : : // ============================================================================
39 : :
40 : 0 : DataSequenceConverter::DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel ) :
41 : 0 : ConverterBase< DataSequenceModel >( rParent, rModel )
42 : : {
43 : 0 : }
44 : :
45 : 0 : DataSequenceConverter::~DataSequenceConverter()
46 : : {
47 [ # # ]: 0 : }
48 : :
49 : 0 : Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUString& rRole )
50 : : {
51 : : // create data sequence from data source model (virtual call at chart converter)
52 : 0 : Reference< XDataSequence > xDataSeq;
53 [ # # ][ # # ]: 0 : if( getChartConverter() )
54 : : {
55 [ # # ][ # # ]: 0 : xDataSeq = getChartConverter()->createDataSequence( getChartDocument()->getDataProvider(), mrModel );
[ # # ][ # # ]
[ # # ][ # # ]
56 : :
57 : : // set sequen ce role
58 [ # # ]: 0 : PropertySet aSeqProp( xDataSeq );
59 [ # # ][ # # ]: 0 : aSeqProp.setProperty( PROP_Role, rRole );
60 : : }
61 : 0 : return xDataSeq;
62 : : }
63 : :
64 : : // ============================================================================
65 : :
66 : 0 : DataSourceConverter::DataSourceConverter( const ConverterRoot& rParent, DataSourceModel& rModel ) :
67 : 0 : ConverterBase< DataSourceModel >( rParent, rModel )
68 : : {
69 : 0 : }
70 : :
71 : 0 : DataSourceConverter::~DataSourceConverter()
72 : : {
73 [ # # ]: 0 : }
74 : :
75 : 0 : Reference< XDataSequence > DataSourceConverter::createDataSequence( const OUString& rRole )
76 : : {
77 : 0 : Reference< XDataSequence > xDataSeq;
78 [ # # ][ # # ]: 0 : if( mrModel.mxDataSeq.is() )
79 : : {
80 [ # # ]: 0 : DataSequenceConverter aDataSeqConv( *this, *mrModel.mxDataSeq );
81 [ # # ][ # # ]: 0 : xDataSeq = aDataSeqConv.createDataSequence( rRole );
[ # # ]
82 : : }
83 : 0 : return xDataSeq;
84 : : }
85 : :
86 : : // ============================================================================
87 : :
88 : : } // namespace chart
89 : : } // namespace drawingml
90 [ + - ][ + - ]: 285 : } // namespace oox
91 : :
92 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|