summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-11-23 20:30:49 +0100
committerTomaž Vajngerl <quikee@gmail.com>2013-11-24 19:43:17 +0100
commitc86aed38b67ee5d1b842a7765e363015aea22fcc (patch)
tree8410c6e71639daad42d78d626899b6ab5967ac18 /oox
parent2b243ba51e786b0993e66232144fd6a6ee9ef724 (diff)
Support regression curve name in OOXML (import & export).
Change-Id: I847e0df4f160e4b5078961a0e77c1e1e3fff9bd4
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/chart/seriesconverter.cxx2
-rw-r--r--oox/source/export/chartexport.cxx28
-rw-r--r--oox/source/token/properties.txt1
3 files changed, 20 insertions, 11 deletions
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 1b56fef15dd4..5c85d99f46e7 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -433,6 +433,8 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat
Reference< XRegressionCurve > xRegCurve( createInstance( aServiceName ), UNO_QUERY_THROW );
PropertySet aPropSet( xRegCurve );
+ // Name
+ aPropSet.setProperty( PROP_CurveName, mrModel.maName );
aPropSet.setProperty( PROP_PolynomialDegree, mrModel.mnOrder );
aPropSet.setProperty( PROP_MovingAveragePeriod, mrModel.mnPeriod );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index fb8f2a944142..9c004e041461 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1540,8 +1540,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
if( eChartType != chart::TYPEID_SCATTER && eChartType != chart::TYPEID_BAR )
exportDataLabels( uno::Reference< beans::XPropertySet >( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
- if( eChartType == chart::TYPEID_SCATTER )
- exportTrendlines( aSeriesSeq[nSeriesIdx] );
+ exportTrendlines( aSeriesSeq[nSeriesIdx] );
//export error bars here
Reference< XPropertySet > xSeriesPropSet( xSource, uno::UNO_QUERY );
@@ -2523,14 +2522,22 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
if (!xRegCurve.is())
continue;
+ Reference< XPropertySet > xProperties( xRegCurve , uno::UNO_QUERY );
+
pFS->startElement( FSNS( XML_c, XML_trendline ), FSEND );
- Reference< XPropertySet > xProperties( xRegCurve , uno::UNO_QUERY );
+ OUString aName;
+ xProperties->getPropertyValue("CurveName") >>= aName;
+ if(!aName.isEmpty())
+ {
+ pFS->startElement( FSNS( XML_c, XML_name), FSEND);
+ pFS->writeEscaped(aName);
+ pFS->endElement( FSNS( XML_c, XML_name) );
+ }
exportShapeProps( xProperties );
OUString aService;
-
Reference< lang::XServiceName > xServiceName( xProperties, UNO_QUERY );
if( !xServiceName.is() )
continue;
@@ -2593,8 +2600,8 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
double aExtrapolateForward = 0.0;
double aExtrapolateBackward = 0.0;
- xProperties->getPropertyValue( "ExtrapolateForward") >>= aExtrapolateForward;
- xProperties->getPropertyValue( "ExtrapolateBackward") >>= aExtrapolateBackward;
+ xProperties->getPropertyValue("ExtrapolateForward") >>= aExtrapolateForward;
+ xProperties->getPropertyValue("ExtrapolateBackward") >>= aExtrapolateBackward;
pFS->singleElement( FSNS( XML_c, XML_forward ),
XML_val, OString::number(aExtrapolateForward).getStr(),
@@ -2605,29 +2612,28 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
FSEND );
sal_Bool aForceIntercept = false;
- xProperties->getPropertyValue( "ForceIntercept") >>= aForceIntercept;
+ xProperties->getPropertyValue("ForceIntercept") >>= aForceIntercept;
if (aForceIntercept)
{
double aInterceptValue = 0.0;
- xProperties->getPropertyValue( "InterceptValue") >>= aInterceptValue;
+ xProperties->getPropertyValue("InterceptValue") >>= aInterceptValue;
pFS->singleElement( FSNS( XML_c, XML_intercept ),
XML_val, OString::number(aInterceptValue).getStr(),
FSEND );
}
-
// Equation properties
Reference< XPropertySet > xEquationProperties( xRegCurve->getEquationProperties() );
// Show Equation
sal_Bool aShowEquation = false;
- xEquationProperties->getPropertyValue( "ShowEquation" ) >>= aShowEquation;
+ xEquationProperties->getPropertyValue("ShowEquation") >>= aShowEquation;
// Show R^2
sal_Bool aShowCorrelationCoefficient = false;
- xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient" ) >>= aShowCorrelationCoefficient;
+ xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= aShowCorrelationCoefficient;
pFS->singleElement( FSNS( XML_c, XML_dispRSqr ),
XML_val, aShowCorrelationCoefficient ? "1" : "0",
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index d89ae44a3792..b0001e3160de 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -109,6 +109,7 @@ CrossoverValue
CursorPositionX
CursorPositionY
CurveStyle
+CurveName
CustomShapeGeometry
D3DSceneAmbientColor
D3DSceneLightColor2