summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-11-23 20:30:49 +0100
committerThorsten Behrens <thb@documentfoundation.org>2013-12-03 03:31:20 -0600
commitfc294a5c1ecc9465a3700f2a479be524e9f4f0de (patch)
tree0be684dcb907cae3ad3f02ac6abb9c83085ab53c /oox
parent18aef30e3eef7e2d4027ac4c9e1f5915755d288e (diff)
Support regression curve name in OOXML (import & export).
Change-Id: I847e0df4f160e4b5078961a0e77c1e1e3fff9bd4 Reviewed-on: https://gerrit.libreoffice.org/6875 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Reviewed-by: Thorsten Behrens <thb@documentfoundation.org> Tested-by: Thorsten Behrens <thb@documentfoundation.org>
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 756f2ed8ed8a..659252b82347 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1543,8 +1543,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 );
@@ -2526,14 +2525,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;
@@ -2596,8 +2603,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(),
@@ -2608,29 +2615,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