[Libreoffice-commits] core.git: 40 commits - chart2/qa include/oox oox/inc oox/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Apr 20 21:49:12 PDT 2015
chart2/qa/extras/chart2export.cxx | 46 +++++-
chart2/qa/extras/chart2import.cxx | 132 ++++++++++++++++++++
chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx |binary
chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx |binary
chart2/qa/extras/data/xlsx/chart_title.xlsx |binary
chart2/qa/extras/data/xlsx/smoothed_series.xlsx |binary
chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx |binary
chart2/qa/extras/data/xlsx/trendline.xlsx |binary
chart2/qa/extras/data/xlsx/trendline2007.xlsx |binary
chart2/qa/extras/data/xlsx/vary_color.xlsx |binary
chart2/qa/extras/data/xlsx/vary_color2007.xlsx |binary
include/oox/drawingml/chart/modelbase.hxx | 4
oox/inc/drawingml/chart/axismodel.hxx | 2
oox/inc/drawingml/chart/seriesmodel.hxx | 16 +-
oox/inc/drawingml/chart/titlemodel.hxx | 10 -
oox/inc/drawingml/chart/typegroupmodel.hxx | 2
oox/source/drawingml/chart/axiscontext.cxx | 4
oox/source/drawingml/chart/axismodel.cxx | 4
oox/source/drawingml/chart/chartspacefragment.cxx | 5
oox/source/drawingml/chart/plotareacontext.cxx | 28 ++--
oox/source/drawingml/chart/plotareaconverter.cxx | 14 +-
oox/source/drawingml/chart/seriescontext.cxx | 119 ++++++++----------
oox/source/drawingml/chart/seriesconverter.cxx | 8 -
oox/source/drawingml/chart/seriesmodel.cxx | 42 +++---
oox/source/drawingml/chart/titlecontext.cxx | 3
oox/source/drawingml/chart/titlemodel.cxx | 4
oox/source/drawingml/chart/typegroupcontext.cxx | 75 +++++------
oox/source/drawingml/chart/typegroupmodel.cxx | 14 +-
oox/source/export/chartexport.cxx | 80 ++++++++----
29 files changed, 404 insertions(+), 208 deletions(-)
New commits:
commit 3d54555a1e7d79f00a8ba309cf821f0e5f48be21
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 21 03:27:05 2015 +0200
fix AxisModel MSO2007 vs OOXMl default values
Change-Id: Ie4265bf5ef02126d88d7521f86b0b922f77817a8
diff --git a/oox/inc/drawingml/chart/axismodel.hxx b/oox/inc/drawingml/chart/axismodel.hxx
index 57ecbf4..949f284 100644
--- a/oox/inc/drawingml/chart/axismodel.hxx
+++ b/oox/inc/drawingml/chart/axismodel.hxx
@@ -87,7 +87,7 @@ struct AxisModel
bool mbDeleted; /// True = axis has been deleted manually.
bool mbNoMultiLevel; /// True = no multi-level categories supported.
- explicit AxisModel( sal_Int32 nTypeId );
+ explicit AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc );
~AxisModel();
};
diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx
index 295b25f..95c2f37 100644
--- a/oox/source/drawingml/chart/axiscontext.cxx
+++ b/oox/source/drawingml/chart/axiscontext.cxx
@@ -86,6 +86,7 @@ AxisContextBase::~AxisContextBase()
ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( catAx ):
@@ -107,8 +108,7 @@ ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const At
mrModel.mofCrossesAt = rAttribs.getDouble( XML_val, 0.0 );
return 0;
case C_TOKEN( delete ):
- // default is 'false', not 'true' as specified
- mrModel.mbDeleted = rAttribs.getBool( XML_val, false );
+ mrModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( majorGridlines ):
return new ShapePrWrapperContext( *this, mrModel.mxMajorGridLines.create() );
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index d4163bc..7541a4e 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -32,7 +32,7 @@ AxisDispUnitsModel::~AxisDispUnitsModel()
{
}
-AxisModel::AxisModel( sal_Int32 nTypeId ) :
+AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
mnAxisId( -1 ),
mnAxisPos( XML_TOKEN_INVALID ),
mnCrossAxisId( -1 ),
@@ -50,7 +50,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId ) :
mnTickMarkSkip( 0 ),
mnTypeId( nTypeId ),
mbAuto( false ),
- mbDeleted( false ),
+ mbDeleted( !bMSO2007Doc ),
mbNoMultiLevel( false )
{
}
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index f50deb1..2c9fb12 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -179,13 +179,13 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( catAx ):
- return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
+ return new CatAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
case C_TOKEN( dateAx ):
- return new DateAxisContext( *this, mrModel.maAxes.create( nElement ) );
+ return new DateAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
case C_TOKEN( serAx ):
- return new SerAxisContext( *this, mrModel.maAxes.create( nElement ) );
+ return new SerAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
case C_TOKEN( valAx ):
- return new ValAxisContext( *this, mrModel.maAxes.create( nElement ) );
+ return new ValAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
case C_TOKEN( layout ):
return new LayoutContext( *this, mrModel.mxLayout.create() );
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index f8ea9fe..54771b8 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -99,11 +99,11 @@ AxesSetConverter::~AxesSetConverter()
{
}
-ModelRef< AxisModel > lclGetOrCreateAxis( const AxesSetModel::AxisMap& rFromAxes, sal_Int32 nAxisIdx, sal_Int32 nDefTypeId )
+ModelRef< AxisModel > lclGetOrCreateAxis( const AxesSetModel::AxisMap& rFromAxes, sal_Int32 nAxisIdx, sal_Int32 nDefTypeId, bool bMSO2007Doc )
{
ModelRef< AxisModel > xAxis = rFromAxes.get( nAxisIdx );
if( !xAxis )
- xAxis.create( nDefTypeId ).mbDeleted = true; // missing axis is invisible
+ xAxis.create( nDefTypeId, bMSO2007Doc ).mbDeleted = true; // missing axis is invisible
return xAxis;
}
@@ -159,9 +159,10 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
to the data provider attached to the chart document. */
if( xCoordSystem.is() )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
// convert all axes (create missing axis models)
- ModelRef< AxisModel > xXAxis = lclGetOrCreateAxis( mrModel.maAxes, API_X_AXIS, rFirstTypeGroup.getTypeInfo().mbCategoryAxis ? C_TOKEN( catAx ) : C_TOKEN( valAx ) );
- ModelRef< AxisModel > xYAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Y_AXIS, C_TOKEN( valAx ) );
+ ModelRef< AxisModel > xXAxis = lclGetOrCreateAxis( mrModel.maAxes, API_X_AXIS, rFirstTypeGroup.getTypeInfo().mbCategoryAxis ? C_TOKEN( catAx ) : C_TOKEN( valAx ), bMSO2007Doc );
+ ModelRef< AxisModel > xYAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Y_AXIS, C_TOKEN( valAx ), bMSO2007Doc );
AxisConverter aXAxisConv( *this, *xXAxis );
aXAxisConv.convertFromModel( xCoordSystem, aTypeGroups, xYAxis.get(), nAxesSetIdx, API_X_AXIS );
@@ -170,7 +171,7 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
if( rFirstTypeGroup.isDeep3dChart() )
{
- ModelRef< AxisModel > xZAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Z_AXIS, C_TOKEN( serAx ) );
+ ModelRef< AxisModel > xZAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Z_AXIS, C_TOKEN( serAx ), bMSO2007Doc );
AxisConverter aZAxisConv( *this, *xZAxis );
aZAxisConv.convertFromModel( xCoordSystem, aTypeGroups, 0, nAxesSetIdx, API_Z_AXIS );
}
commit c93a4d3d602e4126c2a086e44733a33862dd57a1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 20:59:28 2015 +0200
use b as prefix for boolean values
Change-Id: Id06b8347d965c1388adad6df9c1c0ad3e8213986
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 3fa9ba1..445c341 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3058,19 +3058,19 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
Reference< XPropertySet > xEquationProperties( xRegCurve->getEquationProperties() );
// Show Equation
- bool aShowEquation = false;
- xEquationProperties->getPropertyValue("ShowEquation") >>= aShowEquation;
+ bool bShowEquation = false;
+ xEquationProperties->getPropertyValue("ShowEquation") >>= bShowEquation;
// Show R^2
- bool aShowCorrelationCoefficient = false;
- xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= aShowCorrelationCoefficient;
+ bool bShowCorrelationCoefficient = false;
+ xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient;
pFS->singleElement( FSNS( XML_c, XML_dispRSqr ),
- XML_val, aShowCorrelationCoefficient ? "1" : "0",
+ XML_val, bShowCorrelationCoefficient ? "1" : "0",
FSEND );
pFS->singleElement( FSNS( XML_c, XML_dispEq ),
- XML_val, aShowEquation ? "1" : "0",
+ XML_val, bShowEquation ? "1" : "0",
FSEND );
pFS->endElement( FSNS( XML_c, XML_trendline ) );
commit eeaa87c1d92c959fb4e57fa2967587b7f416470d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 10:55:41 2015 +0200
don't create random data series, related bnc#839727
Change-Id: I70d68f68d77af63990477a36ebe9699d0e5eccb6
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index f2f6934..ba65b1f 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -265,7 +265,6 @@ Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem()
Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
{
- bool bMSO2007Doc = getFilter().isMSO2007Document();
sal_Int32 nMaxValues = 0;
Reference< XLabeledDataSequence > xLabeledSeq;
/* Find first existing category sequence. The bahaviour of Excel 2007 is
commit 4c3cfe60ac05d5404e3f2a92fff7af2d2f38628a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 06:21:17 2015 +0200
MSO 2007 vs OOXML default values
includes:
fix data label delete element handling
According to the xsd:
<xsd:choice>
<xsd:element name="delete" type="CT_Boolean" minOccurs="1" maxOccurs="1"/>
<xsd:group ref="Group_DLbl" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
which is just insane. Therefore as soon as we hit a non-delete element
we assume that the entry is not deleted.
Change-Id: Ifa8a59fef200250b931dcb1559d4866cb26bd98f
diff --git a/oox/inc/drawingml/chart/seriesmodel.hxx b/oox/inc/drawingml/chart/seriesmodel.hxx
index 9e4fd77..d2fa53a 100644
--- a/oox/inc/drawingml/chart/seriesmodel.hxx
+++ b/oox/inc/drawingml/chart/seriesmodel.hxx
@@ -45,7 +45,7 @@ struct DataLabelModelBase
OptValue< bool > mobShowVal; /// True = show data point value.
bool mbDeleted; /// True = data label(s) deleted.
- explicit DataLabelModelBase();
+ explicit DataLabelModelBase(bool bMSO2007Doc);
~DataLabelModelBase();
};
@@ -58,7 +58,7 @@ struct DataLabelModel : public DataLabelModelBase
TextRef mxText; /// Manual or linked text for this data point label.
sal_Int32 mnIndex; /// Data point index for this data label.
- explicit DataLabelModel();
+ explicit DataLabelModel(bool bMSO2007Doc);
~DataLabelModel();
};
@@ -71,7 +71,7 @@ struct DataLabelsModel : public DataLabelModelBase
ShapeRef mxLeaderLines; /// Formatting of connector lines between data points and labels.
bool mbShowLeaderLines; /// True = show connector lines between data points and labels.
- explicit DataLabelsModel();
+ explicit DataLabelsModel(bool bMSO2007Doc);
~DataLabelsModel();
};
@@ -83,7 +83,7 @@ struct PictureOptionsModel
bool mbApplyToSides; /// True = draw picture at left/right side of 3D data points.
bool mbApplyToEnd; /// True = draw picture at top/bottom side of 3D data points.
- explicit PictureOptionsModel();
+ explicit PictureOptionsModel(bool bMSO2007Doc);
~PictureOptionsModel();
};
@@ -144,7 +144,7 @@ struct TrendlineModel
bool mbDispEquation; /// True = show equation of the trendline.
bool mbDispRSquared; /// True = show R-squared of the trendline.
- explicit TrendlineModel();
+ explicit TrendlineModel(bool bMSO2007Doc);
~TrendlineModel();
};
@@ -163,7 +163,7 @@ struct DataPointModel
sal_Int32 mnIndex; /// Unique data point index.
bool mbInvertNeg; /// True = invert negative data points (not derived from series!).
- explicit DataPointModel();
+ explicit DataPointModel(bool bMSO2007Doc);
~DataPointModel();
};
@@ -204,7 +204,7 @@ struct SeriesModel
bool mbInvertNeg; /// True = invert negative data points.
bool mbSmooth; /// True = smooth series line.
- explicit SeriesModel();
+ explicit SeriesModel(bool bMSO2007Doc);
~SeriesModel();
};
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index acbe4f1..f50deb1 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -87,6 +87,7 @@ WallFloorContext::~WallFloorContext()
ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( backWall ):
@@ -95,7 +96,7 @@ ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const A
switch( nElement )
{
case C_TOKEN( pictureOptions ):
- return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
+ return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
case C_TOKEN( spPr ):
return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
}
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index bc054ce..f8ea9fe 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -272,6 +272,7 @@ WallFloorConverter::~WallFloorConverter()
void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagram, ObjectType eObjType )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( rxDiagram.is() )
{
PropertySet aPropSet;
@@ -282,7 +283,7 @@ void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
default: OSL_FAIL( "WallFloorConverter::convertFromModel - invalid object type" );
}
if( aPropSet.is() )
- getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(), eObjType );
+ getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), eObjType );
}
}
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index aa179fb..dc8d10f 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -97,6 +97,7 @@ DataLabelContext::~DataLabelContext()
ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ mrModel.mbDeleted = false;
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( idx ):
@@ -127,11 +128,12 @@ DataLabelsContext::~DataLabelsContext()
ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ mrModel.mbDeleted = false;
bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( dLbl ):
- return new DataLabelContext( *this, mrModel.maPointLabels.create() );
+ return new DataLabelContext( *this, mrModel.maPointLabels.create(bMSO2007Doc) );
case C_TOKEN( leaderLines ):
return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
case C_TOKEN( showLeaderLines ):
@@ -333,7 +335,7 @@ ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( marker ):
return this;
case C_TOKEN( pictureOptions ):
- return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
+ return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
case C_TOKEN( spPr ):
return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
}
@@ -413,6 +415,7 @@ AreaSeriesContext::~AreaSeriesContext()
ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
@@ -423,11 +426,11 @@ ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( trendline ):
- return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
case C_TOKEN( val ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
}
@@ -456,21 +459,21 @@ ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( cat ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( invertIfNegative ):
mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( pictureOptions ):
- return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
+ return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) );
case C_TOKEN( shape ):
mrModel.monShape = rAttribs.getToken( bMSO2007Doc ? XML_val : XML_box );
return 0;
case C_TOKEN( trendline ):
- return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
case C_TOKEN( val ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
}
@@ -502,16 +505,16 @@ ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, cons
case C_TOKEN( bubbleSize ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( invertIfNegative ):
mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( trendline ):
- return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
case C_TOKEN( xVal ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( yVal ):
@@ -542,9 +545,9 @@ ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( cat ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( marker ):
@@ -553,7 +556,7 @@ ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const
mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( trendline ):
- return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
case C_TOKEN( val ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
}
@@ -573,6 +576,7 @@ PieSeriesContext::~PieSeriesContext()
ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
@@ -581,9 +585,9 @@ ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( cat ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( explosion ):
mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
return 0;
@@ -615,9 +619,9 @@ ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( cat ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
@@ -649,9 +653,9 @@ ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, con
switch( nElement )
{
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dPt ):
- return new DataPointContext( *this, mrModel.maPoints.create() );
+ return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) );
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( marker ):
@@ -660,7 +664,7 @@ ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, con
mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( trendline ):
- return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) );
case C_TOKEN( xVal ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( yVal ):
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index b5ccede..38c265a 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -510,6 +510,7 @@ DataPointConverter::~DataPointConverter()
void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries,
const TypeGroupConverter& rTypeGroup, const SeriesModel& rSeries )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
try
{
PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) );
@@ -527,7 +528,7 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
if( mrModel.mxShapeProp.is() )
{
if( rTypeGroup.getTypeInfo().mbPictureOptions )
- getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(), rTypeGroup.getSeriesObjectType(), rSeries.mnIndex );
+ getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), rTypeGroup.getSeriesObjectType(), rSeries.mnIndex );
else
getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, rTypeGroup.getSeriesObjectType(), rSeries.mnIndex );
}
@@ -631,8 +632,9 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
// series formatting
ObjectFormatter& rFormatter = getFormatter();
ObjectType eObjType = rTypeGroup.getSeriesObjectType();
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( rTypeInfo.mbPictureOptions )
- rFormatter.convertFrameFormatting( aSeriesProp, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(), eObjType, mrModel.mnIndex );
+ rFormatter.convertFrameFormatting( aSeriesProp, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), eObjType, mrModel.mnIndex );
else
rFormatter.convertFrameFormatting( aSeriesProp, mrModel.mxShapeProp, eObjType, mrModel.mnIndex );
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 79ec3cf..f6a4140 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -24,8 +24,8 @@ namespace oox {
namespace drawingml {
namespace chart {
-DataLabelModelBase::DataLabelModelBase() :
- mbDeleted( false )
+DataLabelModelBase::DataLabelModelBase(bool bMSO2007Doc) :
+ mbDeleted( !bMSO2007Doc )
{
}
@@ -33,7 +33,8 @@ DataLabelModelBase::~DataLabelModelBase()
{
}
-DataLabelModel::DataLabelModel() :
+DataLabelModel::DataLabelModel(bool bMSO2007Doc) :
+ DataLabelModelBase(bMSO2007Doc),
mnIndex( -1 )
{
}
@@ -42,8 +43,9 @@ DataLabelModel::~DataLabelModel()
{
}
-DataLabelsModel::DataLabelsModel() :
- mbShowLeaderLines( false )
+DataLabelsModel::DataLabelsModel(bool bMSO2007Doc) :
+ DataLabelModelBase(bMSO2007Doc),
+ mbShowLeaderLines( !bMSO2007Doc )
{
}
@@ -51,12 +53,12 @@ DataLabelsModel::~DataLabelsModel()
{
}
-PictureOptionsModel::PictureOptionsModel() :
+PictureOptionsModel::PictureOptionsModel(bool bMSO2007Doc) :
mfStackUnit( 1.0 ),
mnPictureFormat( XML_stretch ),
- mbApplyToFront( false ),
- mbApplyToSides( false ),
- mbApplyToEnd( false )
+ mbApplyToFront( !bMSO2007Doc ),
+ mbApplyToSides( !bMSO2007Doc ),
+ mbApplyToEnd( !bMSO2007Doc )
{
}
@@ -85,12 +87,12 @@ TrendlineLabelModel::~TrendlineLabelModel()
{
}
-TrendlineModel::TrendlineModel() :
+TrendlineModel::TrendlineModel(bool bMSO2007Doc) :
mnOrder( 2 ),
mnPeriod( 2 ),
mnTypeId( XML_linear ),
- mbDispEquation( false ),
- mbDispRSquared( false )
+ mbDispEquation( !bMSO2007Doc ),
+ mbDispRSquared( !bMSO2007Doc )
{
}
@@ -98,9 +100,9 @@ TrendlineModel::~TrendlineModel()
{
}
-DataPointModel::DataPointModel() :
+DataPointModel::DataPointModel(bool bMSO2007Doc) :
mnIndex( -1 ),
- mbInvertNeg( false )
+ mbInvertNeg( !bMSO2007Doc )
{
}
@@ -108,15 +110,15 @@ DataPointModel::~DataPointModel()
{
}
-SeriesModel::SeriesModel() :
+SeriesModel::SeriesModel(bool bMSO2007Doc) :
mnExplosion( 0 ),
mnIndex( -1 ),
mnMarkerSize( 5 ),
mnMarkerSymbol( XML_auto ),
mnOrder( -1 ),
- mbBubble3d( false ),
- mbInvertNeg( false ),
- mbSmooth( false )
+ mbBubble3d( !bMSO2007Doc ),
+ mbInvertNeg( !bMSO2007Doc ),
+ mbSmooth( !bMSO2007Doc )
{
}
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index b3fa86a..b55ad96 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -76,7 +76,7 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dropLines ):
return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() );
case C_TOKEN( gapDepth ):
@@ -86,7 +86,7 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con
mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard );
return 0;
case C_TOKEN( ser ):
- return new AreaSeriesContext( *this, mrModel.maSeries.create() );
+ return new AreaSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( varyColors ):
mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -115,7 +115,7 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
mrModel.mnBarDir = rAttribs.getToken( XML_val, XML_col );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( gapDepth ):
mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 );
return 0;
@@ -130,7 +130,7 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
mrModel.mnOverlap = rAttribs.getInteger( XML_val, 0 );
return 0;
case C_TOKEN( ser ):
- return new BarSeriesContext( *this, mrModel.maSeries.create() );
+ return new BarSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( serLines ):
return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() );
case C_TOKEN( shape ):
@@ -167,9 +167,9 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
mrModel.mnBubbleScale = rAttribs.getInteger( XML_val, 100 );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( ser ):
- return new BubbleSeriesContext( *this, mrModel.maSeries.create() );
+ return new BubbleSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( showNegBubbles ):
mrModel.mbShowNegBubbles = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -201,7 +201,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( dropLines ):
return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() );
case C_TOKEN( gapDepth ):
@@ -216,7 +216,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
mrModel.mbShowMarker = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( ser ):
- return new LineSeriesContext( *this, mrModel.maSeries.create() );
+ return new LineSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( smooth ):
mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -244,7 +244,7 @@ ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( firstSliceAng ):
mrModel.mnFirstAngle = rAttribs.getInteger( XML_val, 0 );
return 0;
@@ -261,7 +261,7 @@ ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
mrModel.mnSecondPieSize = rAttribs.getInteger( XML_val, 75 );
return 0;
case C_TOKEN( ser ):
- return new PieSeriesContext( *this, mrModel.maSeries.create() );
+ return new PieSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( serLines ):
return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() );
case C_TOKEN( splitPos ):
@@ -295,12 +295,12 @@ ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, co
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( radarStyle ):
mrModel.mnRadarStyle = rAttribs.getToken( XML_val, XML_standard );
return 0;
case C_TOKEN( ser ):
- return new RadarSeriesContext( *this, mrModel.maSeries.create() );
+ return new RadarSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( varyColors ):
mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -326,12 +326,12 @@ ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement,
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( dLbls ):
- return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) );
case C_TOKEN( scatterStyle ):
mrModel.mnScatterStyle = rAttribs.getInteger( XML_val, XML_marker );
return 0;
case C_TOKEN( ser ):
- return new ScatterSeriesContext( *this, mrModel.maSeries.create() );
+ return new ScatterSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( varyColors ):
mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -357,7 +357,7 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( ser ):
- return new SurfaceSeriesContext( *this, mrModel.maSeries.create() );
+ return new SurfaceSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) );
case C_TOKEN( wireframe ):
mrModel.mbWireframe = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index ba65b1f..f2f6934 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -265,6 +265,7 @@ Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem()
Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence()
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
sal_Int32 nMaxValues = 0;
Reference< XLabeledDataSequence > xLabeledSeq;
/* Find first existing category sequence. The bahaviour of Excel 2007 is
commit 5fa0adf25cfcb71129e05e7218cde46874306c15
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:26:31 2015 +0200
remove whitespace
Change-Id: Ie630331957a6ff9514af7d00529ed875f94ddf26
diff --git a/oox/inc/drawingml/chart/titlemodel.hxx b/oox/inc/drawingml/chart/titlemodel.hxx
index a78c4ff..dad4914 100644
--- a/oox/inc/drawingml/chart/titlemodel.hxx
+++ b/oox/inc/drawingml/chart/titlemodel.hxx
@@ -27,8 +27,6 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
struct TextModel
{
typedef ModelRef< DataSequenceModel > DataSequenceRef;
@@ -41,8 +39,6 @@ struct TextModel
~TextModel();
};
-
-
struct TitleModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -60,8 +56,6 @@ struct TitleModel
~TitleModel();
};
-
-
struct LegendModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -78,8 +72,6 @@ struct LegendModel
~LegendModel();
};
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
commit 007eadfaa0efae0d8baa51b56295b5adc6564b50
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:25:55 2015 +0200
fix wireframe MSO 2007 vs OOXML
Change-Id: I6bea0db361174ad93f182e0dd6ce37ae1c4ca8ec
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 43ba686..b3fa86a 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -350,6 +350,7 @@ SurfaceTypeGroupContext::~SurfaceTypeGroupContext()
ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -358,8 +359,7 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
case C_TOKEN( ser ):
return new SurfaceSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( wireframe ):
- // default is 'false', not 'true' as specified
- mrModel.mbWireframe = rAttribs.getBool( XML_val, false );
+ mrModel.mbWireframe = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
commit df6eaac55e6a8b2bec3f3897e87b9a58efe36bc6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:24:04 2015 +0200
fix smooth MSO 2007 vs OOXML
Change-Id: I7dcb7a1a462cff40696bc3be860d8b02df8624b8
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 0bf3669..43ba686 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -218,9 +218,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( ser ):
return new LineSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( smooth ):
- // TODO: OOXML_spec
- // MSO 2007 writes false by default and not true
- mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
+ mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( upDownBars ):
return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() );
commit 2e4b736b8a245a03ff20dbc3b0c9cf3be2d1ae01
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:23:27 2015 +0200
fix marker MSO 2007 vs OOXML
Change-Id: I7dc2b5b99fa10f13b2dc345850af80689db6480d
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index f644c7c..0bf3669 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -213,8 +213,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( hiLowLines ):
return new ShapePrWrapperContext( *this, mrModel.mxHiLowLines.create() );
case C_TOKEN( marker ):
- // default is 'false', not 'true' as specified
- mrModel.mbShowMarker = rAttribs.getBool( XML_val, false );
+ mrModel.mbShowMarker = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( ser ):
return new LineSeriesContext( *this, mrModel.maSeries.create() );
commit 090960a1eb8bff1cf74f041690cd7258070ba312
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:22:42 2015 +0200
fix showNegBubbles MSO 2007 vs OOXML
Change-Id: Ia5606fc9ab1131d3c0577d25101643f37f91dc85
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 63546f9..f644c7c 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -171,8 +171,7 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
case C_TOKEN( ser ):
return new BubbleSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( showNegBubbles ):
- // default is 'false', not 'true' as specified
- mrModel.mbShowNegBubbles = rAttribs.getBool( XML_val, false );
+ mrModel.mbShowNegBubbles = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( sizeRepresents ):
mrModel.mnSizeRepresents = rAttribs.getToken( XML_val, XML_area );
commit 1478d2c37e57db1ee869f8ca5573b7dc7c7d6a51
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 21 03:25:03 2015 +0200
fix TypeGroup MSO 2007 vs OOXML default values
Change-Id: I0d01e5b8d5f284ee3049debaf9fba0012dae005d
diff --git a/include/oox/drawingml/chart/modelbase.hxx b/include/oox/drawingml/chart/modelbase.hxx
index 6819e51..0d01fc4 100644
--- a/include/oox/drawingml/chart/modelbase.hxx
+++ b/include/oox/drawingml/chart/modelbase.hxx
@@ -43,6 +43,8 @@ public:
ModelType& create() { this->reset( new ModelType ); return **this; }
template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; }
+ template< typename Param1Type, typename Param2Type >
+ ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { this->reset( new ModelType( rParam1, rParam2 ) ); return **this; }
ModelType& getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
template< typename Param1Type >
@@ -62,6 +64,8 @@ public:
ModelType& create() { return append( new ModelType ); }
template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { return append( new ModelType( rParam1 ) ); }
+ template< typename Param1Type, typename Param2Type >
+ ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { return append( new ModelType( rParam1, rParam2 ) ); }
private:
ModelType& append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; }
diff --git a/oox/inc/drawingml/chart/typegroupmodel.hxx b/oox/inc/drawingml/chart/typegroupmodel.hxx
index 72d5586..ea40faa 100644
--- a/oox/inc/drawingml/chart/typegroupmodel.hxx
+++ b/oox/inc/drawingml/chart/typegroupmodel.hxx
@@ -77,7 +77,7 @@ struct TypeGroupModel
bool mbVaryColors; /// True = different automatic colors for each point.
bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart.
- explicit TypeGroupModel( sal_Int32 nTypeId );
+ explicit TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc );
~TypeGroupModel();
};
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 53cb1ae..acbe4f1 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -146,6 +146,7 @@ PlotAreaContext::~PlotAreaContext()
ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( plotArea ):
@@ -153,28 +154,28 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
{
case C_TOKEN( area3DChart ):
case C_TOKEN( areaChart ):
- return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( bar3DChart ):
case C_TOKEN( barChart ):
- return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( bubbleChart ):
- return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( line3DChart ):
case C_TOKEN( lineChart ):
case C_TOKEN( stockChart ):
- return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( doughnutChart ):
case C_TOKEN( ofPieChart ):
case C_TOKEN( pie3DChart ):
case C_TOKEN( pieChart ):
- return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( radarChart ):
- return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( scatterChart ):
- return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( surface3DChart ):
case C_TOKEN( surfaceChart ):
- return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( catAx ):
return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index ae3f447..63546f9 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -227,7 +227,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( upDownBars ):
return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() );
case C_TOKEN( varyColors ):
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, bMSO2007Doc );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index f27f6da..e8b3d11 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -33,7 +33,7 @@ UpDownBarsModel::~UpDownBarsModel()
{
}
-TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
+TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
mfSplitPos( 0.0 ),
mnBarDir( XML_col ),
mnBubbleScale( 100 ),
@@ -51,12 +51,12 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
mnSizeRepresents( XML_area ),
mnSplitType( XML_auto ),
mnTypeId( nTypeId ),
- mbBubble3d( false ),
- mbShowMarker( false ),
- mbShowNegBubbles( false ),
- mbSmooth( false ),
- mbVaryColors( false ),
- mbWireframe( false )
+ mbBubble3d( !bMSO2007Doc ),
+ mbShowMarker( !bMSO2007Doc ),
+ mbShowNegBubbles( !bMSO2007Doc ),
+ mbSmooth( !bMSO2007Doc ),
+ mbVaryColors( !bMSO2007Doc ),
+ mbWireframe( !bMSO2007Doc )
{
}
commit 0791b8f1d35f2795ff87e21d04395b3ec8bd831d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 21 03:22:57 2015 +0200
add test case for VaryColor default values
Change-Id: Iaf8012d573044dad21d1008e3a6d583625e6f386
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 534f982..71588c1 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -76,6 +76,8 @@ public:
void testSmoothDefaultValue2013XLSX();
void testTrendlineDefaultValue2007XLSX();
void testTrendlineDefaultValue2013XLSX();
+ void testVaryColorDefaultValues2007XLSX();
+ void testVaryColorDefaultValues2013XLSX();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -115,6 +117,8 @@ public:
CPPUNIT_TEST(testSmoothDefaultValue2013XLSX);
CPPUNIT_TEST(testTrendlineDefaultValue2007XLSX);
CPPUNIT_TEST(testTrendlineDefaultValue2013XLSX);
+ CPPUNIT_TEST(testVaryColorDefaultValues2007XLSX);
+ CPPUNIT_TEST(testVaryColorDefaultValues2013XLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -910,6 +914,36 @@ void Chart2ImportTest::testTrendlineDefaultValue2013XLSX()
CPPUNIT_ASSERT(bShowCorrelation);
}
+void Chart2ImportTest::testVaryColorDefaultValues2007XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "vary_color2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint");
+ bool bVaryColor = true;
+ CPPUNIT_ASSERT(aAny >>= bVaryColor);
+ CPPUNIT_ASSERT(!bVaryColor);
+}
+
+void Chart2ImportTest::testVaryColorDefaultValues2013XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "vary_color.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<beans::XPropertySet> xPropSet(xDataSeries, uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue("VaryColorsByPoint");
+ bool bVaryColor = false;
+ CPPUNIT_ASSERT(aAny >>= bVaryColor);
+ CPPUNIT_ASSERT(bVaryColor);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/vary_color.xlsx b/chart2/qa/extras/data/xlsx/vary_color.xlsx
new file mode 100644
index 0000000..980cdda
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/vary_color.xlsx differ
diff --git a/chart2/qa/extras/data/xlsx/vary_color2007.xlsx b/chart2/qa/extras/data/xlsx/vary_color2007.xlsx
new file mode 100644
index 0000000..657c217
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/vary_color2007.xlsx differ
commit e001998cb11ce865f2ea8925a058245a04d9e701
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 21 03:26:24 2015 +0200
not every PieChart uses VaryColorsByPoint
Change-Id: Ia2d30c185ecf45335c0ec00ad24bb9c117bb8aef
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index d116359..b5ccede 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -638,7 +638,7 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
// set the (unused) property default value used by the Chart2 templates (true for pie/doughnut charts)
bool bIsPie = rTypeInfo.meTypeCategory == TYPECATEGORY_PIE;
- aSeriesProp.setProperty( PROP_VaryColorsByPoint, bIsPie );
+ aSeriesProp.setProperty( PROP_VaryColorsByPoint, bVaryColorsByPoint );
// own area formatting for every data point (TODO: varying line color not supported)
// #i91271# always set area formatting for every point in pie/doughnut charts to override their automatic point formatting
commit 7438087a1db55aba395b241df24b4908c9491a32
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:21:17 2015 +0200
fix varyColor MSO 2007 vs OOXML
Change-Id: If1b7c2d57b46b124707120a1d1906bd0653c735e
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index e86e54a..ae3f447 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -69,6 +69,7 @@ AreaTypeGroupContext::~AreaTypeGroupContext()
ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -87,8 +88,7 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( ser ):
return new AreaSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
@@ -105,6 +105,7 @@ BarTypeGroupContext::~BarTypeGroupContext()
ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -136,8 +137,7 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
mrModel.mnShape = rAttribs.getToken( XML_val, XML_box );
return 0;
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
@@ -154,6 +154,7 @@ BubbleTypeGroupContext::~BubbleTypeGroupContext()
ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -177,8 +178,7 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
mrModel.mnSizeRepresents = rAttribs.getToken( XML_val, XML_area );
return 0;
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
@@ -195,6 +195,7 @@ LineTypeGroupContext::~LineTypeGroupContext()
ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -226,8 +227,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( upDownBars ):
return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() );
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, bMSO2007Doc );
return 0;
}
return 0;
@@ -244,6 +244,7 @@ PieTypeGroupContext::~PieTypeGroupContext()
ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( dLbls ):
@@ -274,8 +275,7 @@ ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
mrModel.mnSplitType = rAttribs.getToken( XML_val, XML_auto );
return 0;
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
@@ -292,6 +292,7 @@ RadarTypeGroupContext::~RadarTypeGroupContext()
ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -305,8 +306,7 @@ ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, co
case C_TOKEN( ser ):
return new RadarSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
@@ -323,6 +323,7 @@ ScatterTypeGroupContext::~ScatterTypeGroupContext()
ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( axId ):
@@ -336,8 +337,7 @@ ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement,
case C_TOKEN( ser ):
return new ScatterSeriesContext( *this, mrModel.maSeries.create() );
case C_TOKEN( varyColors ):
- // default is 'false', not 'true' as specified
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, false );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
commit 9ded594ec9bf79acfcf0570f873c2c29130eaaf3
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:13:53 2015 +0200
fix shape MSO 2007 vs OOXML
Change-Id: Ia145d6a8fd3af3367a27cbc7618f93546d4007d7
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 431a453..aa179fb 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -467,8 +467,7 @@ ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( pictureOptions ):
return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
case C_TOKEN( shape ):
- // missing attribute does not change shape type to 'box' as specified
- mrModel.monShape = rAttribs.getToken( XML_val );
+ mrModel.monShape = rAttribs.getToken( bMSO2007Doc ? XML_val : XML_box );
return 0;
case C_TOKEN( trendline ):
return new TrendlineContext( *this, mrModel.maTrendlines.create() );
commit 23de8cfe4d8021cc375731b48a055f4111063172
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 21:35:50 2015 +0200
add tests for trendline default values
Change-Id: Id1ff3b7dd10f6d200a0f2cd86ef7f8fa47722344
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 6f5a8f4..534f982 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -12,6 +12,7 @@
#include <com/sun/star/chart2/CurveStyle.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart/XChartData.hpp>
@@ -73,6 +74,8 @@ public:
void testSmoothDefaultValue2007XLSX();
void testSmoothDefaultValue2013XLSX();
+ void testTrendlineDefaultValue2007XLSX();
+ void testTrendlineDefaultValue2013XLSX();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -110,6 +113,8 @@ public:
CPPUNIT_TEST(testDispBlanksAsDefaultValue2013XLSX);
CPPUNIT_TEST(testSmoothDefaultValue2007XLSX);
CPPUNIT_TEST(testSmoothDefaultValue2013XLSX);
+ CPPUNIT_TEST(testTrendlineDefaultValue2007XLSX);
+ CPPUNIT_TEST(testTrendlineDefaultValue2013XLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -853,6 +858,58 @@ void Chart2ImportTest::testSmoothDefaultValue2013XLSX()
CPPUNIT_ASSERT(eCurveStyle != chart2::CurveStyle_LINES);
}
+void Chart2ImportTest::testTrendlineDefaultValue2007XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "trendline2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<chart2::XRegressionCurveContainer> xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW);
+ Sequence< Reference<chart2::XRegressionCurve> > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves();
+ CPPUNIT_ASSERT_EQUAL((sal_Int32) 1, xRegressionCurveSequence.getLength());
+
+ Reference<chart2::XRegressionCurve> xCurve = xRegressionCurveSequence[0];
+
+ Reference<beans::XPropertySet> xPropSet(xCurve->getEquationProperties(), uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue("ShowEquation");
+ bool bShowEquation = true;
+ CPPUNIT_ASSERT(aAny >>= bShowEquation);
+ CPPUNIT_ASSERT(!bShowEquation);
+
+ aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient");
+ bool bShowCorrelation = true;
+ CPPUNIT_ASSERT(aAny >>= bShowCorrelation);
+ CPPUNIT_ASSERT(!bShowCorrelation);
+}
+
+void Chart2ImportTest::testTrendlineDefaultValue2013XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "trendline.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xDataSeries.is());
+ Reference<chart2::XRegressionCurveContainer> xRegressionCurveContainer(xDataSeries, UNO_QUERY_THROW);
+ Sequence< Reference<chart2::XRegressionCurve> > xRegressionCurveSequence = xRegressionCurveContainer->getRegressionCurves();
+ CPPUNIT_ASSERT_EQUAL((sal_Int32) 1, xRegressionCurveSequence.getLength());
+
+ Reference<chart2::XRegressionCurve> xCurve = xRegressionCurveSequence[0];
+
+ Reference<beans::XPropertySet> xPropSet(xCurve->getEquationProperties(), uno::UNO_QUERY_THROW);
+ uno::Any aAny = xPropSet->getPropertyValue("ShowEquation");
+ bool bShowEquation = false;
+ CPPUNIT_ASSERT(aAny >>= bShowEquation);
+ CPPUNIT_ASSERT(bShowEquation);
+
+ aAny = xPropSet->getPropertyValue("ShowCorrelationCoefficient");
+ bool bShowCorrelation = false;
+ CPPUNIT_ASSERT(aAny >>= bShowCorrelation);
+ CPPUNIT_ASSERT(bShowCorrelation);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/trendline.xlsx b/chart2/qa/extras/data/xlsx/trendline.xlsx
new file mode 100644
index 0000000..701fcfd
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/trendline.xlsx differ
diff --git a/chart2/qa/extras/data/xlsx/trendline2007.xlsx b/chart2/qa/extras/data/xlsx/trendline2007.xlsx
new file mode 100644
index 0000000..87d4d5a
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/trendline2007.xlsx differ
commit 4e35dfb3c4d5fb9f92ef741d9232dfe32612c572
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:12:45 2015 +0200
fix dispRSqr MSO 2007 vs OOXML
Change-Id: Ic751eddeeb5690afaf48b47c8bf10592723b0adf
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index db392c6..431a453 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -267,8 +267,7 @@ ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const A
mrModel.mbDispEquation = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( dispRSqr ):
- // default is 'false', not 'true' as specified
- mrModel.mbDispRSquared = rAttribs.getBool( XML_val, false );
+ mrModel.mbDispRSquared = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( forward ):
mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
commit f6000b3aabbc234d46a3dc818d37d4a0b6ac23c6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:11:59 2015 +0200
fix dispEq MSO 2007 vs OOXML
Change-Id: I3637f40cb2c354ead03612f2857e7c2e27ffcd1b
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 2f69812..db392c6 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -205,7 +205,6 @@ ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const At
case C_TOKEN( minus ):
return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
case C_TOKEN( noEndCap ):
- // default is 'false', not 'true' as specified
mrModel.mbNoEndCap = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( plus ):
@@ -258,14 +257,14 @@ TrendlineContext::~TrendlineContext()
ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( backward ):
mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
return 0;
case C_TOKEN( dispEq ):
- // default is 'false', not 'true' as specified
- mrModel.mbDispEquation = rAttribs.getBool( XML_val, false );
+ mrModel.mbDispEquation = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( dispRSqr ):
// default is 'false', not 'true' as specified
commit 5693eb07f645bef934c2e16ba252298d304ff420
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 20:54:20 2015 +0200
fix more mbNoEndCap MSO 2007 vs OOXML places
Change-Id: Ib1002488e880fa1478dceb046cd08b40cdfe7b1e
diff --git a/oox/inc/drawingml/chart/seriesmodel.hxx b/oox/inc/drawingml/chart/seriesmodel.hxx
index e52fa02..9e4fd77 100644
--- a/oox/inc/drawingml/chart/seriesmodel.hxx
+++ b/oox/inc/drawingml/chart/seriesmodel.hxx
@@ -106,7 +106,7 @@ struct ErrorBarModel
sal_Int32 mnValueType; /// Type of the values.
bool mbNoEndCap; /// True = no end cap at error bar lines.
- explicit ErrorBarModel();
+ explicit ErrorBarModel(bool bMSO2007Doc);
~ErrorBarModel();
};
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 6a7ac29..2f69812 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -423,7 +423,7 @@ ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( cat ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
case C_TOKEN( errBars ):
- return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( dLbls ):
return new DataLabelsContext( *this, mrModel.mxLabels.create() );
case C_TOKEN( dPt ):
@@ -462,7 +462,7 @@ ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( dPt ):
return new DataPointContext( *this, mrModel.maPoints.create() );
case C_TOKEN( errBars ):
- return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( invertIfNegative ):
mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -509,7 +509,7 @@ ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, cons
case C_TOKEN( dPt ):
return new DataPointContext( *this, mrModel.maPoints.create() );
case C_TOKEN( errBars ):
- return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( invertIfNegative ):
mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
@@ -549,7 +549,7 @@ ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( dPt ):
return new DataPointContext( *this, mrModel.maPoints.create() );
case C_TOKEN( errBars ):
- return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
@@ -656,7 +656,7 @@ ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( dPt ):
return new DataPointContext( *this, mrModel.maPoints.create() );
case C_TOKEN( errBars ):
- return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) );
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 5507384..79ec3cf 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -64,12 +64,12 @@ PictureOptionsModel::~PictureOptionsModel()
{
}
-ErrorBarModel::ErrorBarModel() :
+ErrorBarModel::ErrorBarModel(bool bMSO2007Doc) :
mfValue( 0.0 ),
mnDirection( XML_y ),
mnTypeId( XML_both ),
mnValueType( XML_fixedVal ),
- mbNoEndCap( false )
+ mbNoEndCap( !bMSO2007Doc )
{
}
commit 935f3b9993bfb76560c07ba0d39df4ce21e58518
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:10:43 2015 +0200
fix noEndCap MSO 2007 vs OOXML
Change-Id: I21084eb053c04cb5be5de586ee506cc6e5d97b04
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index b75f05c..6a7ac29 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -190,6 +190,7 @@ ErrorBarContext::~ErrorBarContext()
ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( errBarType ):
@@ -205,7 +206,7 @@ ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const At
return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
case C_TOKEN( noEndCap ):
// default is 'false', not 'true' as specified
- mrModel.mbNoEndCap = rAttribs.getBool( XML_val, false );
+ mrModel.mbNoEndCap = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( plus ):
return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
commit 2a1b49b4ad569dd2af8f777aae578484f55d4b9a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:09:37 2015 +0200
fix applyToSides MSO 2007 vs OOXML
Change-Id: I3cda1a74695aefa34f2749b29af5409db83f2946
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 6f0fb7b..b75f05c 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -167,8 +167,7 @@ ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, co
mrModel.mbApplyToFront = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( applyToSides ):
- // default is 'false', not 'true' as specified
- mrModel.mbApplyToSides = rAttribs.getBool( XML_val, false );
+ mrModel.mbApplyToSides = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( pictureFormat ):
mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch );
commit 48d7336ff68a46b814586c8e9ce32690b4d1ade9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:08:51 2015 +0200
fix applyToFront MSO 2007 vs OOXML
Change-Id: I7d40663162a907e2bc7280167e311e4d577c3863
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index ba2a81c..6f0fb7b 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -164,8 +164,7 @@ ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, co
mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( applyToFront ):
- // default is 'false', not 'true' as specified
- mrModel.mbApplyToFront = rAttribs.getBool( XML_val, false );
+ mrModel.mbApplyToFront = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( applyToSides ):
// default is 'false', not 'true' as specified
commit f418edfb2302a32ae6fc571b774504055eb2d345
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:08:12 2015 +0200
fix applyToEnd MSO 2007 vs OOXML
Change-Id: Ied92054db1daabf7342cb6455bcf5edfc80bc6a1
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 446bad1..ba2a81c 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -157,11 +157,11 @@ PictureOptionsContext::~PictureOptionsContext()
ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( applyToEnd ):
- // default is 'false', not 'true' as specified
- mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, false );
+ mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( applyToFront ):
// default is 'false', not 'true' as specified
commit 02b2ebd32101abd2c2cd7c13ce80109f7a72a7bd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 20:53:37 2015 +0200
export that we don't support leader lines, related tdf#90749
Change-Id: If4faeb8e9b8344ac8b7bf6057c89ceaa503ebefe
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 58e294c..3fa9ba1 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2797,6 +2797,10 @@ void ChartExport::exportDataLabels(
// Baseline label properties for all labels.
writeLabelProperties(pFS, xPropSet, aParam);
+ pFS->singleElement(FSNS(XML_c, XML_showLeaderLines),
+ XML_val, "0",
+ FSEND);
+
pFS->endElement(FSNS(XML_c, XML_dLbls));
}
commit 3eff437c462808df929ae6fd0034c0989f7fda3d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:07:08 2015 +0200
fix showLeaderLines MSO 2007 vs OOXML
Change-Id: I762383de76ecbabc867ebf3fc9128287421f9c6b
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index a9de7fb..446bad1 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -127,6 +127,7 @@ DataLabelsContext::~DataLabelsContext()
ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
if( isRootElement() ) switch( nElement )
{
case C_TOKEN( dLbl ):
@@ -134,12 +135,10 @@ ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( leaderLines ):
return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
case C_TOKEN( showLeaderLines ):
- // default is 'false', not 'true' as specified
- mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, false );
+ mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
- bool bMSO2007 = getFilter().isMSO2007Document();
- return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 );
+ return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007Doc );
}
void DataLabelsContext::onCharacters( const OUString& rChars )
commit 0c8d6a434fb4015e9fb9a43827453d464eb9f7b5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 19:01:18 2015 +0200
add test for bubble3D export, related tdf#90746
Change-Id: I97df89d60add869ea8277295580f880284f29358
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index b20a422..5a3d42c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -89,6 +89,7 @@ public:
void testDataLabelDefaultValuesXLSX();
void testTitleOverlayXLSX();
void testInvertIfNegativeXLSX();
+ void testBubble3DXLSX();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -142,6 +143,7 @@ public:
CPPUNIT_TEST(testDataLabelDefaultValuesXLSX);
CPPUNIT_TEST(testTitleOverlayXLSX);
CPPUNIT_TEST(testInvertIfNegativeXLSX);
+ CPPUNIT_TEST(testBubble3DXLSX);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -1298,6 +1300,14 @@ void Chart2ExportTest::testInvertIfNegativeXLSX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0");
}
+void Chart2ExportTest::testBubble3DXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "bubble_chart_simple.xlsx");
+ xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:bubbleChart/c:bubble3D", "val", "0");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx b/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx
new file mode 100644
index 0000000..d13fe5e
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/bubble_chart_simple.xlsx differ
commit 1a65d2f85a49b47d163083f7b46f026178aed38a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 18:45:13 2015 +0200
export that we don't support bubble3D, related tdf#90746
Change-Id: Ic3f3f671098a173e05da26c53e3e50fafdf3fd1a
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index eb93497..58e294c 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1433,6 +1433,11 @@ void ChartExport::exportBubbleChart( Reference< chart2::XChartType > xChartType
sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y;
exportSeries( xChartType, nAttachedAxis );
+
+ pFS->singleElement(FSNS(XML_c, XML_bubble3D),
+ XML_val, "0",
+ FSEND);
+
exportAxesId( nAttachedAxis );
pFS->endElement( FSNS( XML_c, XML_bubbleChart ) );
commit 5c0800805dabe0f672b15497fb92e8326f18a0f8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:03:38 2015 +0200
fix bubble3D MSO 2007 vs OOXML
Change-Id: Ide059f320e45080278e0c1723c81b26c0bbad506
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index f9f59c3..a9de7fb 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -502,8 +502,7 @@ ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, cons
switch( nElement )
{
case C_TOKEN( bubble3D ):
- // default is 'false', not 'true' as specified
- mrModel.mbBubble3d = rAttribs.getBool( XML_val, false );
+ mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( bubbleSize ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 2a53692..e86e54a 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -160,8 +160,7 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
return 0;
case C_TOKEN( bubble3D ):
- // default is 'false', not 'true' as specified
- mrModel.mbBubble3d = rAttribs.getBool( XML_val, false );
+ mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( bubbleScale ):
mrModel.mnBubbleScale = rAttribs.getInteger( XML_val, 100 );
commit 0d1f5324a7fb094bdfa71166bf0b55b47511713e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 06:52:23 2015 +0200
add smoothed line default value import test
Change-Id: I67f6c6e433402ba610f39b7fa4ee50a8cb5295fe
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 686f808..6f5a8f4 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -71,6 +71,9 @@ public:
void testDispBlanksAsDefaultValue2007XLSX();
void testDispBlanksAsDefaultValue2013XLSX();
+ void testSmoothDefaultValue2007XLSX();
+ void testSmoothDefaultValue2013XLSX();
+
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
CPPUNIT_TEST(testSteppedLines);
@@ -105,6 +108,8 @@ public:
CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX);
CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX);
CPPUNIT_TEST(testDispBlanksAsDefaultValue2013XLSX);
+ CPPUNIT_TEST(testSmoothDefaultValue2007XLSX);
+ CPPUNIT_TEST(testSmoothDefaultValue2013XLSX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -812,6 +817,42 @@ void Chart2ImportTest::testDispBlanksAsDefaultValue2013XLSX()
CPPUNIT_ASSERT_EQUAL(chart::MissingValueTreatment::USE_ZERO, nMissingValueTreatment);
}
+void Chart2ImportTest::testSmoothDefaultValue2007XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "smoothed_series2007.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY );
+ CPPUNIT_ASSERT(xPropSet.is());
+
+ chart2::CurveStyle eCurveStyle;
+ xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+ CPPUNIT_ASSERT_EQUAL(eCurveStyle, chart2::CurveStyle_LINES);
+}
+
+void Chart2ImportTest::testSmoothDefaultValue2013XLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "smoothed_series.xlsx");
+ Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+ CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY );
+ CPPUNIT_ASSERT(xPropSet.is());
+
+ chart2::CurveStyle eCurveStyle;
+ xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+ CPPUNIT_ASSERT(eCurveStyle != chart2::CurveStyle_LINES);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/smoothed_series.xlsx b/chart2/qa/extras/data/xlsx/smoothed_series.xlsx
new file mode 100644
index 0000000..bab00ce
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/smoothed_series.xlsx differ
diff --git a/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx b/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx
new file mode 100644
index 0000000..3c8f0cc
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/smoothed_series2007.xlsx differ
commit 3df94a9272260cd839f6aec69d9f4914fc1ba565
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 05:02:50 2015 +0200
more smooth MSO 2007 vs OOXML cases
Change-Id: I931eca79499c566e953abeca0b9ba451937e5a33
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 5baa458..f9f59c3 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -556,7 +556,6 @@ ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
- // MSO 2007 writes false by default and not true
mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( trendline ):
@@ -613,6 +612,7 @@ RadarSeriesContext::~RadarSeriesContext()
ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
@@ -627,9 +627,7 @@ ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
- // TODO: OOXML_spec
- // MSO 2007 writes false by default and not true
- mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
+ mrModel.mbSmooth = rAttribs.getBool( XML_val, bMSO2007Doc );
return 0;
case C_TOKEN( val ):
return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
@@ -650,6 +648,7 @@ ScatterSeriesContext::~ScatterSeriesContext()
ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
@@ -664,9 +663,7 @@ ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( marker ):
return this;
case C_TOKEN( smooth ):
- // TODO: OOXML_spec
- // MSO 2007 writes false by default and not true
- mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
+ mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( trendline ):
return new TrendlineContext( *this, mrModel.maTrendlines.create() );
commit 0c8e924a078f7ac70643be3965ff0b3a0eed240a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 07:40:10 2015 +0200
add test case for no invertIfNegative export, related tdf#90733
Change-Id: I9980b280236f858e6c88ef4ef0ba8cb9d2750b0e
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 0d9f7ad..b20a422 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -88,6 +88,7 @@ public:
void testAxisNumberFormatXLSX();
void testDataLabelDefaultValuesXLSX();
void testTitleOverlayXLSX();
+ void testInvertIfNegativeXLSX();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -140,6 +141,7 @@ public:
CPPUNIT_TEST(testAxisNumberFormatXLSX);
CPPUNIT_TEST(testDataLabelDefaultValuesXLSX);
CPPUNIT_TEST(testTitleOverlayXLSX);
+ CPPUNIT_TEST(testInvertIfNegativeXLSX);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -1288,6 +1290,14 @@ void Chart2ExportTest::testTitleOverlayXLSX()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:overlay", "val", "0");
}
+void Chart2ExportTest::testInvertIfNegativeXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "bar_chart_simple.xlsx");
+ xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML");
+ CPPUNIT_ASSERT(pXmlDoc);
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:invertIfNegative", "val", "0");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx b/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx
new file mode 100644
index 0000000..52040bf
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/bar_chart_simple.xlsx differ
commit 1797441c7db545b8f03ed1565d26d296cae5d7ab
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 07:33:20 2015 +0200
we don't support invertIfNegative yet, related tdf#90733
Change-Id: Idfccaaf3443f15699f6fab38bd89f7874698d6c1
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 27e344c..eb93497 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1772,6 +1772,15 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
switch( eChartType )
{
+ case chart::TYPEID_BUBBLE:
+ case chart::TYPEID_HORBAR:
+ case chart::TYPEID_BAR:
+ {
+ pFS->singleElement(FSNS(XML_c, XML_invertIfNegative),
+ XML_val, "0",
+ FSEND);
+ }
+ break;
case chart::TYPEID_LINE:
{
exportMarker(xDataSeries);
commit 684277ba017622f5b2d1396c915c1aa4cfaf98d5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 20 04:59:15 2015 +0200
fix invertIfNegative MSO 2007 vs OOXML
Change-Id: I54a3eed05702bdfe1e1c625df6463399f38e9180
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 6cf23a6..5baa458 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -315,6 +315,7 @@ DataPointContext::~DataPointContext()
ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( dPt ):
@@ -331,8 +332,7 @@ ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const A
mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
return 0;
case C_TOKEN( invertIfNegative ):
- // default is 'false', not 'true' as specified (value not derived from series!)
- mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
+ mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( marker ):
return this;
@@ -451,6 +451,7 @@ BarSeriesContext::~BarSeriesContext()
ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
@@ -465,8 +466,7 @@ ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const A
case C_TOKEN( errBars ):
return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
case C_TOKEN( invertIfNegative ):
- // default is 'false', not 'true' as specified
- mrModel.mbInvertNeg = rAttribs.getBool( XML_val, false );
+ mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( pictureOptions ):
return new PictureOptionsContext( *this, mrModel.mxPicOptions.create() );
@@ -495,6 +495,7 @@ BubbleSeriesContext::~BubbleSeriesContext()
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list