1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include "oox/drawingml/chart/chartconverter.hxx"
25 
26 #include <com/sun/star/chart2/XChartDocument.hpp>
27 #include "oox/drawingml/chart/chartspaceconverter.hxx"
28 #include "oox/drawingml/chart/chartspacemodel.hxx"
29 
30 namespace oox {
31 namespace drawingml {
32 namespace chart {
33 
34 // ============================================================================
35 
36 using namespace ::com::sun::star::awt;
37 using namespace ::com::sun::star::chart2;
38 using namespace ::com::sun::star::chart2::data;
39 using namespace ::com::sun::star::drawing;
40 using namespace ::com::sun::star::uno;
41 
42 using ::oox::core::XmlFilterBase;
43 using ::rtl::OUString;
44 
45 // ============================================================================
46 
ChartConverter()47 ChartConverter::ChartConverter()
48 {
49 }
50 
~ChartConverter()51 ChartConverter::~ChartConverter()
52 {
53 }
54 
convertFromModel(XmlFilterBase & rFilter,ChartSpaceModel & rChartModel,const Reference<XChartDocument> & rxChartDoc,const Reference<XShapes> & rxExternalPage,const Point & rChartPos,const Size & rChartSize)55 void ChartConverter::convertFromModel( XmlFilterBase& rFilter,
56         ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc,
57         const Reference< XShapes >& rxExternalPage, const Point& rChartPos, const Size& rChartSize )
58 {
59     OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" );
60     if( rxChartDoc.is() )
61     {
62         ConverterRoot aConvBase( rFilter, *this, rChartModel, rxChartDoc, rChartSize );
63         ChartSpaceConverter aSpaceConv( aConvBase, rChartModel );
64         aSpaceConv.convertFromModel( rxExternalPage, rChartPos );
65     }
66 }
67 
createDataProvider(const Reference<XChartDocument> & rxChartDoc)68 void ChartConverter::createDataProvider( const Reference< XChartDocument >& rxChartDoc )
69 {
70     try
71     {
72         if( !rxChartDoc->hasInternalDataProvider() )
73             rxChartDoc->createInternalDataProvider( sal_False );
74     }
75     catch( Exception& )
76     {
77     }
78 }
79 
createDataSequence(const Reference<XDataProvider> &,const DataSequenceModel &)80 Reference< XDataSequence > ChartConverter::createDataSequence( const Reference< XDataProvider >&, const DataSequenceModel& )
81 {
82     return 0;
83 }
84 
85 // ============================================================================
86 
87 } // namespace chart
88 } // namespace drawingml
89 } // namespace oox
90