View | Details | Raw Unified | Return to issue 120805
Collapse All | Expand All

(-)main/oox/inc/oox/drawingml/chart/datasourcemodel.hxx (-1 / +2 lines)
Lines 36-42 Link Here
36
struct DataSequenceModel
36
struct DataSequenceModel
37
{
37
{
38
    typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > AnyMap;
38
    typedef ::std::map< sal_Int32, ::com::sun::star::uno::Any > AnyMap;
39
39
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
40
	AnyMap				maCellFormatCode;   /// Number format for every cell double values.
40
    AnyMap              maData;             /// Map of values, indexed by point identifier.
41
    AnyMap              maData;             /// Map of values, indexed by point identifier.
41
    ::rtl::OUString     maFormula;          /// Formula reference, e.g. into a spreadsheet.
42
    ::rtl::OUString     maFormula;          /// Formula reference, e.g. into a spreadsheet.
42
    ::rtl::OUString     maFormatCode;       /// Number format for double values.
43
    ::rtl::OUString     maFormatCode;       /// Number format for double values.
(-)main/oox/inc/oox/ppt/pptchartconverter.hxx (+62 lines)
Line 0 Link Here
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
#ifndef OOX_PPT_PPTCHARTCONVERTER_HXX
23
#define OOX_PPT_PPTCHARTCONVERTER_HXX
24
25
#include "oox/drawingml/chart/chartconverter.hxx"
26
27
using ::rtl::OUString;
28
using ::com::sun::star::uno::Reference;
29
using ::oox::core::XmlFilterBase;
30
using ::com::sun::star::chart2::data::XDataSequence;
31
using ::com::sun::star::chart2::XChartDocument;
32
using ::com::sun::star::chart2::data::XDataProvider;
33
using ::oox::drawingml::chart::DataSequenceModel;
34
35
namespace oox { namespace ppt {
36
37
class PptChartConverter : public ::oox::drawingml::chart::ChartConverter
38
{
39
public:
40
	void SetRole(const OUString &rRole){mrRole = rRole;}
41
	void Reset();
42
    explicit            PptChartConverter( XmlFilterBase& mFilterBase );
43
    virtual             ~PptChartConverter();
44
45
    virtual Reference< XDataSequence > createDataSequence(
46
						 const Reference< XDataProvider >& rxDataProvider,
47
						 const DataSequenceModel& rDataSeq );
48
private:
49
    XmlFilterBase&						mrFilterBase;
50
	sal_Int32							mnDataIndex;
51
	sal_Int32							mnLabelIndex;
52
	OUString							mrRole;
53
};
54
55
56
// ============================================================================
57
58
} // namespace ppt
59
} // namespace oox
60
61
#endif
62
(-)main/oox/source/drawingml/chart/chartspaceconverter.cxx (+211 lines)
Lines 35-40 Link Here
35
#include "oox/drawingml/chart/chartspacemodel.hxx"
35
#include "oox/drawingml/chart/chartspacemodel.hxx"
36
#include "oox/drawingml/chart/plotareaconverter.hxx"
36
#include "oox/drawingml/chart/plotareaconverter.hxx"
37
#include "oox/drawingml/chart/titleconverter.hxx"
37
#include "oox/drawingml/chart/titleconverter.hxx"
38
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
39
#include <com/sun/star/chart/XChartDataArray.hpp>
40
#include "oox/ppt/pptchartconverter.hxx"
41
#include <com/sun/star/util/XNumberFormatter.hpp>
38
42
39
using ::rtl::OUString;
43
using ::rtl::OUString;
40
using ::com::sun::star::awt::Point;
44
using ::com::sun::star::awt::Point;
Lines 49-54 Link Here
49
using ::com::sun::star::chart2::XDiagram;
53
using ::com::sun::star::chart2::XDiagram;
50
using ::com::sun::star::chart2::XTitled;
54
using ::com::sun::star::chart2::XTitled;
51
using ::com::sun::star::chart2::data::XDataReceiver;
55
using ::com::sun::star::chart2::data::XDataReceiver;
56
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
57
using ::com::sun::star::uno::Sequence;
58
using ::com::sun::star::chart::XChartDataArray;
59
using ::com::sun::star::uno::Any;
60
using ::com::sun::star::lang::Locale;
52
using ::com::sun::star::beans::XPropertySet;
61
using ::com::sun::star::beans::XPropertySet;
53
62
54
namespace oox {
63
namespace oox {
Lines 101-107 Link Here
101
    // convert plot area (container of all chart type groups)
110
    // convert plot area (container of all chart type groups)
102
    PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
111
    PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() );
103
    aPlotAreaConv.convertFromModel( mrModel.mxView3D.getOrCreate() );
112
    aPlotAreaConv.convertFromModel( mrModel.mxView3D.getOrCreate() );
113
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
114
	oox::ppt::PptChartConverter *pConvert = dynamic_cast< oox::ppt::PptChartConverter* >(&(getChartConverter()));
115
	if (pConvert != NULL)
116
	{
117
		std::vector<std::vector<double> > vecData;
118
		std::vector<std::vector<bool> > vecDataFlag;
119
		std::vector< OUString > vecRowName;
120
		std::vector< OUString > vecColumnName;
121
		bool bSourceLinked = true;
122
		OUString strLinkedFormat;
123
		if (aPlotAreaConv.getModel().maAxes.size() > 0 && aPlotAreaConv.getModel().maAxes[0] != NULL)
124
		{
125
			const NumberFormat &nf = aPlotAreaConv.getModel().maAxes[0]->maNumberFormat;
126
			bSourceLinked = nf.mbSourceLinked;
127
			strLinkedFormat = nf.maFormatCode;
128
		}
104
129
130
		bool bSupport = true;
131
		ModelVector< TypeGroupModel >::const_iterator itTypeGroup = aPlotAreaConv.getModel().maTypeGroups.begin();
132
		for (; itTypeGroup != aPlotAreaConv.getModel().maTypeGroups.end() && *itTypeGroup != NULL; ++itTypeGroup)
133
		{
134
			sal_Int32 nType = (*itTypeGroup)->mnTypeId;
135
			if ( nType == C_TOKEN( ofPieChart )
136
				|| nType == C_TOKEN( surface3DChart )
137
				|| nType == C_TOKEN( surfaceChart ))
138
			{
139
				bSupport = false;
140
			}
141
			if (bSupport == false)
142
			{
143
				break;
144
			}
145
			bool bIsHasX = nType == C_TOKEN( bubbleChart ) || nType == C_TOKEN( scatterChart );
146
			const TypeGroupModel::SeriesVector &vecSeries = (*itTypeGroup)->maSeries;
147
			for (TypeGroupModel::SeriesVector::const_iterator itSeries = vecSeries.begin(); itSeries != vecSeries.end() && *itSeries != NULL; ++itSeries)
148
			{
149
				const SeriesModel::DataSourceMap &map = (*itSeries)->maSources;
150
				for (SeriesModel::DataSourceMap::const_iterator itDataSourceMap = map.begin(); itDataSourceMap != map.end() && itDataSourceMap->second != NULL; ++itDataSourceMap)
151
				{
152
					const DataSourceModel::DataSequenceRef &rDataModel = itDataSourceMap->second->mxDataSeq;
153
					// rDataModel->mnPointCount must be >= 0, if we haven't read it, its default value is -1.
154
					if (rDataModel.is() && rDataModel->mnPointCount >= 0)
155
					{
156
						if (itDataSourceMap->first == SeriesModel::VALUES || itDataSourceMap->first == SeriesModel::POINTS)
157
						{
158
							vecData.push_back(std::vector<double>(rDataModel->mnPointCount, 0.0));
159
							vecDataFlag.push_back(std::vector<bool>(rDataModel->mnPointCount, false));
160
							for( DataSequenceModel::AnyMap::const_iterator itData = rDataModel->maData.begin(); itData != rDataModel->maData.end(); ++itData)
161
							{
162
								double dValue = 0.0;
163
								itData->second >>= dValue;
164
								vecData.back().at(itData->first) = dValue;
165
								vecDataFlag.back().at(itData->first) = true;
166
							}
167
						}
168
						else if (itDataSourceMap->first == SeriesModel::CATEGORIES)
169
						{
170
							if (bIsHasX)
171
							{
172
								vecData.push_back(std::vector<double>(rDataModel->mnPointCount, 0.0));
173
								vecDataFlag.push_back(std::vector<bool>(rDataModel->mnPointCount, false));
174
								for( DataSequenceModel::AnyMap::const_iterator itData = rDataModel->maData.begin(); itData != rDataModel->maData.end(); ++itData)
175
								{
176
									double dValue = 0.0;
177
									itData->second >>= dValue;
178
									vecData.back().at(itData->first) = dValue;
179
									vecDataFlag.back().at(itData->first) = true;
180
								}
181
							}
182
							else
183
							{
184
								vecRowName.resize(rDataModel->mnPointCount);
185
								for( DataSequenceModel::AnyMap::const_iterator itData = rDataModel->maData.begin(); itData != rDataModel->maData.end(); ++itData)
186
								{
187
									OUString strLabel;
188
									itData->second >>= strLabel;
189
									if (strLabel.getLength() == 0 && itData->second.getValueType().equals(getCppuType(static_cast< double* >(NULL))))
190
									{
191
										OUString strCellformat;
192
										rDataModel->maCellFormatCode[itData->first] >>= strCellformat;
193
										OUString strFormat = strCellformat.getLength() == 0 ? rDataModel->maFormatCode : strCellformat;
194
										if (!bSourceLinked && strLinkedFormat.getLength() != 0)
195
										{
196
											strFormat = strLinkedFormat;
197
										}
198
										double dValue = 0.0;
199
										itData->second >>= dValue;
200
										try
201
										{
202
											Reference< XNumberFormatsSupplier > xNumFmtSupp( getChartDocument(), UNO_QUERY_THROW );
203
											Reference< XNumberFormats > xNumFormats = xNumFmtSupp->getNumberFormats();
204
											long nKey = xNumFormats->queryKey(strFormat, Locale(CREATE_OUSTRING( "en" ), CREATE_OUSTRING( "US" ), OUString()), false ); 
205
											Reference< XNumberFormatter > xFormatter = Reference< XNumberFormatter >( createInstance(OUString::createFromAscii( "com.sun.star.util.NumberFormatter" )), UNO_QUERY );
206
											xFormatter->attachNumberFormatsSupplier( xNumFmtSupp );
207
											strLabel = xFormatter->convertNumberToString( nKey, dValue ); 
208
										}
209
										catch( Exception& )
210
										{
211
											OSL_ENSURE( false, "ChartSpaceConverter::convertFromModel - UNO Query Exception" );
212
										}
213
									}
214
									vecRowName[itData->first] = strLabel;
215
								}
216
							}
217
						}
218
					}
219
				}
220
221
				const ModelRef< TextModel > &text = (*itSeries)->mxText;
222
				if (text.is())
223
				{
224
					const TextModel::DataSequenceRef &labelmodel = text->mxDataSeq;
225
					if (labelmodel.is())
226
					{
227
						for( DataSequenceModel::AnyMap::const_iterator itData = labelmodel->maData.begin(); itData != labelmodel->maData.end(); ++itData)
228
						{
229
							OUString strLabel;
230
							itData->second >>= strLabel;
231
							vecColumnName.insert(vecColumnName.end(), nType == C_TOKEN( bubbleChart ) ? 3 : 1, strLabel);
232
						}
233
					}
234
				}
235
			}
236
			if (nType == C_TOKEN( areaChart ) && (*itTypeGroup)->mnGrouping == XML_standard)
237
			{
238
				std::reverse(vecData.begin(), vecData.end());
239
				std::reverse(vecColumnName.begin(), vecColumnName.end());
240
			}
241
			if (bIsHasX)
242
			{
243
				for (unsigned int i = 0; i < vecData.size() / 2; ++i)
244
				{
245
					vecData[2 * i].swap(vecData[2 * i + 1]);
246
					vecDataFlag[2 * i].swap(vecDataFlag[2 * i + 1]);
247
				}
248
			}
249
		}
250
251
		unsigned int sizeColumn = vecData.size();
252
		unsigned int sizeRow = sizeColumn > 0 ? vecData.front().size() : 0;
253
		if (bSupport && sizeColumn > 0 && sizeRow > 0)
254
		{
255
			try
256
			{
257
				Reference< XChartDataArray > xDataArray( getChartDocument()->getDataProvider(), UNO_QUERY_THROW );
258
				Sequence< Sequence< double > > aData( sizeRow );
259
				for (unsigned int i = 0; i < sizeRow; i++)
260
				{
261
					aData[i].realloc(sizeColumn);
262
				}
263
264
				Sequence< OUString > aRowLabels( sizeRow );
265
				Sequence< OUString > aColumnLabels( sizeColumn );
266
267
				std::vector<OUString>::const_iterator it = vecColumnName.begin();
268
				for (unsigned int i = 0; it != vecColumnName.end() && i < sizeColumn; ++it, ++i)
269
				{
270
					aColumnLabels[i] = *it;
271
				}
272
				it = vecRowName.begin();
273
				for (unsigned int i = 0; it != vecRowName.end() && i < sizeRow; ++it, ++i)
274
				{
275
					aRowLabels[i] = *it;
276
				}
277
				for (unsigned int i = 0; i < sizeRow; i++)
278
				{
279
					for (unsigned int j = 0; j < sizeColumn; j++)
280
					{
281
						if (vecDataFlag[j][i] == true)
282
						{
283
							aData[i][j] = vecData[j][i];
284
						}
285
						else
286
						{
287
							aData[i][j] = xDataArray->getNotANumber();
288
						}
289
					}
290
				}
291
292
				xDataArray->setData( aData );
293
				xDataArray->setRowDescriptions( aRowLabels );
294
				xDataArray->setColumnDescriptions( aColumnLabels );
295
			}
296
			catch( Exception& )
297
			{
298
				OSL_ENSURE( false, "ChartSpaceConverter::convertFromModel - UNO Query Exception" );
299
			}
300
		}
301
		else
302
		{
303
			try
304
			{
305
				Reference< XChartDataArray > xDataArray( getChartDocument()->getDataProvider(), UNO_QUERY_THROW );
306
				xDataArray->setData( Sequence< Sequence< double > >(0) );
307
			}
308
			catch( Exception& )
309
			{
310
				OSL_ENSURE( false, "ChartSpaceConverter::convertFromModel - UNO Query Exception" );
311
			}
312
		}
313
		pConvert->Reset();
314
	}
315
105
    // plot area converter has created the diagram object
316
    // plot area converter has created the diagram object
106
    Reference< XDiagram > xDiagram = getChartDocument()->getFirstDiagram();
317
    Reference< XDiagram > xDiagram = getChartDocument()->getFirstDiagram();
107
318
(-)main/oox/source/drawingml/chart/datasourcecontext.cxx (+8 lines)
Lines 71-76 Link Here
71
                    return 0;
71
                    return 0;
72
                case C_TOKEN( pt ):
72
                case C_TOKEN( pt ):
73
                    mnPtIndex = rAttribs.getInteger( XML_idx, -1 );
73
                    mnPtIndex = rAttribs.getInteger( XML_idx, -1 );
74
					// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
75
					{
76
						OUString str = rAttribs.getString( XML_formatCode, OUString());
77
						if (mnPtIndex >= 0)
78
						{
79
							mrModel.maCellFormatCode[ mnPtIndex ] <<= str;
80
						}					
81
					}
74
                    return this;
82
                    return this;
75
            }
83
            }
76
        break;
84
        break;
(-)main/oox/source/drawingml/chart/datasourceconverter.cxx (+8 lines)
Lines 26-31 Link Here
26
#include <com/sun/star/chart2/XChartDocument.hpp>
26
#include <com/sun/star/chart2/XChartDocument.hpp>
27
#include "oox/drawingml/chart/chartconverter.hxx"
27
#include "oox/drawingml/chart/chartconverter.hxx"
28
#include "oox/drawingml/chart/datasourcemodel.hxx"
28
#include "oox/drawingml/chart/datasourcemodel.hxx"
29
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
30
#include "oox/ppt/pptchartconverter.hxx"
29
31
30
namespace oox {
32
namespace oox {
31
namespace drawingml {
33
namespace drawingml {
Lines 51-56 Link Here
51
53
52
Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUString& rRole )
54
Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUString& rRole )
53
{
55
{
56
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
57
	::oox::ppt::PptChartConverter *pptConvert = dynamic_cast< ::oox::ppt::PptChartConverter* > (&getChartConverter());
58
	if (pptConvert != NULL)
59
	{
60
		pptConvert->SetRole(rRole);
61
	}
54
    // create data sequence from data source model (virtual call at chart converter)
62
    // create data sequence from data source model (virtual call at chart converter)
55
    Reference< XDataSequence > xDataSeq = getChartConverter().createDataSequence( getChartDocument()->getDataProvider(), mrModel );
63
    Reference< XDataSequence > xDataSeq = getChartConverter().createDataSequence( getChartDocument()->getDataProvider(), mrModel );
56
64
(-)main/oox/source/drawingml/chart/objectformatter.cxx (-3 / +16 lines)
Lines 36-41 Link Here
36
#include "oox/drawingml/theme.hxx"
36
#include "oox/drawingml/theme.hxx"
37
#include "oox/drawingml/chart/chartspacemodel.hxx"
37
#include "oox/drawingml/chart/chartspacemodel.hxx"
38
#include "oox/helper/modelobjecthelper.hxx"
38
#include "oox/helper/modelobjecthelper.hxx"
39
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
40
#include "oox/ppt/pptchartconverter.hxx"
39
41
40
namespace oox {
42
namespace oox {
41
namespace drawingml {
43
namespace drawingml {
Lines 1052-1060 Link Here
1052
1054
1053
    try
1055
    try
1054
    {
1056
    {
1055
        Reference< XNumberFormatsSupplier > xNumFmtsSupp( mrFilter.getModel(), UNO_QUERY_THROW );
1057
		// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
1056
        mxNumFmts = xNumFmtsSupp->getNumberFormats();
1058
		const ::oox::drawingml::chart::ChartConverter &rConverter = (const_cast< XmlFilterBase& >(mrFilter)).getChartConverter();
1057
        mxNumTypes.set( mxNumFmts, UNO_QUERY );
1059
		if (dynamic_cast< const ::oox::ppt::PptChartConverter* >(&rConverter) != NULL)
1060
		{
1061
			Reference< XNumberFormatsSupplier > xNumFmtsSupp( rxChartDoc, UNO_QUERY_THROW );
1062
			mxNumFmts = xNumFmtsSupp->getNumberFormats();
1063
			mxNumTypes.set( mxNumFmts, UNO_QUERY );
1064
		}
1065
		else
1066
		{
1067
			Reference< XNumberFormatsSupplier > xNumFmtsSupp( mrFilter.getModel(), UNO_QUERY_THROW );
1068
			mxNumFmts = xNumFmtsSupp->getNumberFormats();
1069
			mxNumTypes.set( mxNumFmts, UNO_QUERY );
1070
		}
1058
    }
1071
    }
1059
    catch( Exception& )
1072
    catch( Exception& )
1060
    {
1073
    {
(-)main/oox/source/ppt/makefile.mk (+1 lines)
Lines 49-54 Link Here
49
		$(SLO)$/headerfootercontext.obj \
49
		$(SLO)$/headerfootercontext.obj \
50
		$(SLO)$/layoutfragmenthandler.obj\
50
		$(SLO)$/layoutfragmenthandler.obj\
51
		$(SLO)$/pptfilterhelpers.obj\
51
		$(SLO)$/pptfilterhelpers.obj\
52
		$(SLO)$/pptchartconverter.obj\
52
		$(SLO)$/pptimport.obj\
53
		$(SLO)$/pptimport.obj\
53
		$(SLO)$/pptshape.obj \
54
		$(SLO)$/pptshape.obj \
54
		$(SLO)$/pptshapecontext.obj \
55
		$(SLO)$/pptshapecontext.obj \
(-)main/oox/source/ppt/pptchartconverter.cxx (+94 lines)
Line 0 Link Here
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
#include <com/sun/star/chart2/XChartDocument.hpp>
23
#include <com/sun/star/chart2/data/XDataProvider.hpp>
24
#include <com/sun/star/chart/XChartDataArray.hpp>
25
#include "oox/ppt/pptchartconverter.hxx"
26
27
using ::com::sun::star::uno::Exception;
28
using ::com::sun::star::uno::UNO_QUERY_THROW;
29
using ::com::sun::star::chart::XChartDataArray;
30
31
namespace oox { namespace ppt {
32
33
// ============================================================================
34
35
PptChartConverter::PptChartConverter( XmlFilterBase& mFilterBase ) :
36
    mrFilterBase( mFilterBase ), mnDataIndex(0), mnLabelIndex(0)
37
{
38
}
39
40
PptChartConverter::~PptChartConverter()
41
{
42
}
43
44
void PptChartConverter::Reset()
45
{
46
	mnDataIndex = 0;
47
	mnLabelIndex = 0;
48
}
49
50
Reference< XDataSequence > PptChartConverter::createDataSequence(
51
    const Reference< XDataProvider >& rxDataProvider, const DataSequenceModel&)
52
{
53
    Reference< XDataSequence > xDataSeq; 
54
    if( rxDataProvider.is() )
55
    {
56
        Reference< XChartDataArray > xDataArray( rxDataProvider, UNO_QUERY_THROW );
57
        if( ! xDataArray.is())
58
            return xDataSeq;
59
60
		try
61
		{
62
			OUString aResult;
63
64
			if (mrRole == OUString::createFromAscii("categories"))
65
			{
66
				aResult = OUString::createFromAscii("categories");
67
			}
68
			else if (mrRole == OUString::createFromAscii("values-y") || mrRole == OUString::createFromAscii("values-x") || mrRole == OUString::createFromAscii("values-size"))
69
			{
70
				aResult = OUString::valueOf(mnDataIndex);
71
				mnDataIndex++;
72
			}
73
			else if (mrRole == OUString::createFromAscii("label"))
74
			{
75
				aResult = OUString::createFromAscii("label ") + OUString::valueOf(mnLabelIndex);
76
				mnLabelIndex++;
77
			}
78
			// create the data sequence
79
			xDataSeq = rxDataProvider->createDataSequenceByRangeRepresentation( aResult );
80
		}
81
		catch( Exception& )
82
		{
83
			OSL_ENSURE( false, "PptChartConverter::createDataSequence - cannot create data sequence" );
84
		}
85
86
    } 
87
    return xDataSeq;
88
}
89
90
// ============================================================================
91
92
} // namespace ppt
93
} // namespace oox
94
(-)main/oox/source/ppt/pptimport.cxx (-1 / +4 lines)
Lines 27-32 Link Here
27
#include "oox/drawingml/table/tablestylelistfragmenthandler.hxx"
27
#include "oox/drawingml/table/tablestylelistfragmenthandler.hxx"
28
#include "oox/helper/graphichelper.hxx"
28
#include "oox/helper/graphichelper.hxx"
29
#include "oox/ole/vbaproject.hxx"
29
#include "oox/ole/vbaproject.hxx"
30
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
31
#include "oox/ppt/pptchartconverter.hxx"
30
32
31
using ::rtl::OUString;
33
using ::rtl::OUString;
32
using namespace ::com::sun::star;
34
using namespace ::com::sun::star;
Lines 56-62 Link Here
56
58
57
PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
59
PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
58
    XmlFilterBase( rxContext ),
60
    XmlFilterBase( rxContext ),
59
    mxChartConv( new ::oox::drawingml::chart::ChartConverter )
61
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file 
62
    mxChartConv( new PptChartConverter(*this) )
60
{
63
{
61
}
64
}
62
65
(-)main/oox/source/ppt/pptshape.cxx (-1 / +3 lines)
Lines 77-83 Link Here
77
            Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
77
            Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
78
			sal_Bool bClearText = sal_False;
78
			sal_Bool bClearText = sal_False;
79
79
80
			if ( sServiceName != OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) )
80
// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
81
			if ( sServiceName != OUString::createFromAscii( "com.sun.star.drawing.GraphicObjectShape" ) 
82
				&& sServiceName != OUString::createFromAscii( "com.sun.star.drawing.OLE2Shape"))
81
			{
83
			{
82
				switch( mnSubType )
84
				switch( mnSubType )
83
				{
85
				{
(-)main/svl/source/numbers/numfmuno.cxx (-1 / +6 lines)
Lines 491-497 Link Here
491
		{
491
		{
492
			//!	irgendwas muss hier noch passieren...
492
			//!	irgendwas muss hier noch passieren...
493
		}
493
		}
494
		nRet = pFormatter->GetEntryKey( aFormat, eLang );
494
		// Bug 120805 [From Symphony] As a user, I want to see Chart Data cache can be imported correctly from .pptx file
495
		short rType;
496
		sal_Bool rNewInserted;
497
		xub_StrLen rCheckPos;
498
		nRet = pFormatter->GetIndexPuttingAndConverting(aFormStr, eLang,
499
			LANGUAGE_SYSTEM, rType, rNewInserted, rCheckPos);
495
	}
500
	}
496
	else
501
	else
497
		throw uno::RuntimeException();
502
		throw uno::RuntimeException();

Return to issue 120805