[Libreoffice-commits] core.git: 4 commits - include/oox oox/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sat Apr 5 16:48:22 PDT 2014
include/oox/drawingml/chart/seriesmodel.hxx | 20 ----
include/oox/drawingml/chart/typegroupconverter.hxx | 17 ---
include/oox/drawingml/fillproperties.hxx | 12 --
include/oox/drawingml/lineproperties.hxx | 6 -
include/oox/drawingml/shape.hxx | 6 -
include/oox/export/chartexport.hxx | 2
oox/source/drawingml/chart/seriesconverter.cxx | 27 ------
oox/source/drawingml/chart/typegroupcontext.cxx | 22 -----
oox/source/drawingml/chart/typegroupconverter.cxx | 6 +
oox/source/export/chartexport.cxx | 92 +++++++++++----------
10 files changed, 63 insertions(+), 147 deletions(-)
New commits:
commit 953cef76ac6f760728a5b2296704d32af2b81ba5
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 01:38:41 2014 +0200
export data point symbol color
Change-Id: I0dcbf616b8ab3c8cea4437d399fa4b5ec33e475a
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index a19c3a0..822eb90 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3000,6 +3000,9 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
break;
}
+ if( aSymbol.Style == chart2::SymbolStyle_AUTO )
+ pSymbolType = "auto";
+
if( pSymbolType )
{
pFS->singleElement( FSNS( XML_c, XML_symbol ),
@@ -3016,6 +3019,11 @@ void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
XML_val, I32S(nSize),
FSEND );
+ pFS->startElement( FSNS( XML_c, XML_spPr ),
+ FSEND );
+ WriteSolidFill(aSymbol.FillColor);
+ pFS->endElement( FSNS( XML_c, XML_spPr ) );
+
pFS->endElement( FSNS( XML_c, XML_marker ) );
}
commit 3f50246f6af1d26353377ff5cb2cc5a381c7d426
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 01:38:13 2014 +0200
import data point symbol color
Change-Id: I27ebd67a535f8617a6f535414ee8426fae6614b9
diff --git a/include/oox/drawingml/chart/seriesmodel.hxx b/include/oox/drawingml/chart/seriesmodel.hxx
index e6e8a01..b9c2c3c 100644
--- a/include/oox/drawingml/chart/seriesmodel.hxx
+++ b/include/oox/drawingml/chart/seriesmodel.hxx
@@ -27,8 +27,6 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
struct DataLabelModelBase
{
typedef ModelRef< Shape > ShapeRef;
@@ -51,8 +49,6 @@ struct DataLabelModelBase
~DataLabelModelBase();
};
-
-
struct DataLabelModel : public DataLabelModelBase
{
typedef ModelRef< LayoutModel > LayoutRef;
@@ -66,8 +62,6 @@ struct DataLabelModel : public DataLabelModelBase
~DataLabelModel();
};
-
-
struct DataLabelsModel : public DataLabelModelBase
{
typedef ModelVector< DataLabelModel > DataLabelVector;
@@ -81,8 +75,6 @@ struct DataLabelsModel : public DataLabelModelBase
~DataLabelsModel();
};
-
-
struct PictureOptionsModel
{
double mfStackUnit; /// Bitmap stacking unit.
@@ -95,8 +87,6 @@ struct PictureOptionsModel
~PictureOptionsModel();
};
-
-
struct ErrorBarModel
{
enum SourceType
@@ -120,8 +110,6 @@ struct ErrorBarModel
~ErrorBarModel();
};
-
-
struct TrendlineLabelModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -139,8 +127,6 @@ struct TrendlineLabelModel
~TrendlineLabelModel();
};
-
-
struct TrendlineModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -162,8 +148,6 @@ struct TrendlineModel
~TrendlineModel();
};
-
-
struct DataPointModel
{
typedef ModelRef< Shape > ShapeRef;
@@ -183,8 +167,6 @@ struct DataPointModel
~DataPointModel();
};
-
-
struct SeriesModel
{
enum SourceType
@@ -226,8 +208,6 @@ struct SeriesModel
~SeriesModel();
};
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/chart/typegroupconverter.hxx b/include/oox/drawingml/chart/typegroupconverter.hxx
index e61f81f..16c8271 100644
--- a/include/oox/drawingml/chart/typegroupconverter.hxx
+++ b/include/oox/drawingml/chart/typegroupconverter.hxx
@@ -153,7 +153,8 @@ public:
sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint );
/** Sets the passed OOXML marker style at the passed property set. */
- void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize ) const;
+ void convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
+ ModelRef< Shape > xShapeProps ) const;
/** Sets the passed OOXML line smoothing at the passed property set. */
void convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const;
/** Sets the passed OOXML bar 3D geometry at the passed property set. */
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index b33aabe..0b2b20a 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -481,7 +481,8 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
// data point marker
if( mrModel.monMarkerSymbol.differsFrom( rSeries.mnMarkerSymbol ) || mrModel.monMarkerSize.differsFrom( rSeries.mnMarkerSize ) )
- rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ), mrModel.monMarkerSize.get( rSeries.mnMarkerSize ) );
+ rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ),
+ mrModel.monMarkerSize.get( rSeries.mnMarkerSize ), mrModel.mxMarkerProp );
// data point pie explosion
if( mrModel.monExplosion.differsFrom( rSeries.mnExplosion ) )
@@ -578,7 +579,7 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve
}
// data point markers
- rTypeGroup.convertMarker( aSeriesProp, mrModel.mnMarkerSymbol, mrModel.mnMarkerSize );
+ rTypeGroup.convertMarker( aSeriesProp, mrModel.mnMarkerSymbol, mrModel.mnMarkerSize, mrModel.mxMarkerProp );
#if OOX_CHART_SMOOTHED_PER_SERIES
// #i66858# smoothed series lines
rTypeGroup.convertLineSmooth( aSeriesProp, mrModel.mbSmooth );
diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx
index 7804650..a57c218 100644
--- a/oox/source/drawingml/chart/typegroupconverter.cxx
+++ b/oox/source/drawingml/chart/typegroupconverter.cxx
@@ -452,7 +452,8 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
}
}
-void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize ) const
+void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize,
+ ModelRef< Shape > xShapeProps ) const
{
if( !isSeriesFrameFormat() )
{
@@ -480,6 +481,9 @@ void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSym
sal_Int32 nSize = static_cast< sal_Int32 >( nOoxSize * (2540.0 / 72.0) + 0.5 );
aSymbol.Size.Width = aSymbol.Size.Height = nSize;
+ Color aFillColor = xShapeProps->getFillProperties().maFillColor;
+ aSymbol.FillColor = aFillColor.getColor(getFilter().getGraphicHelper());
+
// set the property
rPropSet.setProperty( PROP_Symbol, aSymbol );
}
commit 08906623da9f8c0749f12276832c95d229d9436c
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 00:58:22 2014 +0200
remove whitespace
Change-Id: I69454c3d9bddfe01da2622117a16bbb37797062a
diff --git a/include/oox/drawingml/chart/typegroupconverter.hxx b/include/oox/drawingml/chart/typegroupconverter.hxx
index 2219e88..e61f81f 100644
--- a/include/oox/drawingml/chart/typegroupconverter.hxx
+++ b/include/oox/drawingml/chart/typegroupconverter.hxx
@@ -34,8 +34,6 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
/** Enumerates different chart types. */
enum TypeId
{
@@ -55,8 +53,6 @@ enum TypeId
TYPEID_UNKNOWN /// Default for unknown chart types.
};
-
-
/** Enumerates different categories of similar chart types. */
enum TypeCategory
{
@@ -68,8 +64,6 @@ enum TypeCategory
TYPECATEGORY_SURFACE /// Surface charts.
};
-
-
/** Enumerates modes for varying point colors in a series. */
enum VarPointMode
{
@@ -78,8 +72,6 @@ enum VarPointMode
VARPOINTMODE_MULTI /// Supported for multiple series in a chart type group.
};
-
-
/** Contains info for a chart type related to the OpenOffice.org chart module. */
struct TypeGroupInfo
{
@@ -101,8 +93,6 @@ struct TypeGroupInfo
bool mbPictureOptions; /// True = bitmaps support options from c:pictureOptions.
};
-
-
struct UpDownBarsModel;
class UpDownBarsConverter : public ConverterBase< UpDownBarsModel >
@@ -116,8 +106,6 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& rxChartType );
};
-
-
struct TypeGroupModel;
struct View3DModel;
@@ -187,8 +175,6 @@ private:
bool mb3dChart; /// True = type is a 3D chart type.
};
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/fillproperties.hxx b/include/oox/drawingml/fillproperties.hxx
index f588033..447cba2 100644
--- a/include/oox/drawingml/fillproperties.hxx
+++ b/include/oox/drawingml/fillproperties.hxx
@@ -38,8 +38,6 @@ namespace drawingml {
class ShapePropertyMap;
-
-
struct GradientFillProperties
{
typedef ::std::map< double, Color > GradientStopMap;
@@ -57,8 +55,6 @@ struct GradientFillProperties
void assignUsed( const GradientFillProperties& rSourceProps );
};
-
-
struct PatternFillProperties
{
Color maPattFgColor; /// Pattern foreground color.
@@ -69,8 +65,6 @@ struct PatternFillProperties
void assignUsed( const PatternFillProperties& rSourceProps );
};
-
-
struct BlipFillProperties
{
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
@@ -99,8 +93,6 @@ struct BlipFillProperties
void assignUsed( const BlipFillProperties& rSourceProps );
};
-
-
struct OOX_DLLPUBLIC FillProperties
{
OptValue< sal_Int32 > moFillType; /// Fill type (OOXML token).
@@ -126,8 +118,6 @@ struct OOX_DLLPUBLIC FillProperties
bool bFlipV = false ) const;
};
-
-
struct GraphicProperties
{
BlipFillProperties maBlipProps; /// Properties for the graphic.
@@ -143,8 +133,6 @@ struct GraphicProperties
sal_Int32 nPhClr = API_RGB_TRANSPARENT ) const;
};
-
-
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/lineproperties.hxx b/include/oox/drawingml/lineproperties.hxx
index 5e0c062..c38c7e1 100644
--- a/include/oox/drawingml/lineproperties.hxx
+++ b/include/oox/drawingml/lineproperties.hxx
@@ -27,8 +27,6 @@
namespace oox {
namespace drawingml {
-
-
struct LineArrowProperties
{
OptValue< sal_Int32 > moArrowType;
@@ -39,8 +37,6 @@ struct LineArrowProperties
void assignUsed( const LineArrowProperties& rSourceProps );
};
-
-
struct OOX_DLLPUBLIC LineProperties
{
typedef ::std::pair< sal_Int32, sal_Int32 > DashStop;
@@ -73,8 +69,6 @@ struct OOX_DLLPUBLIC LineProperties
sal_Int32 getLineWidth() const;
};
-
-
} // namespace drawingml
} // namespace oox
diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 5b5966b..a7232fa 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -54,8 +54,6 @@ struct ShapeStyleRef
typedef ::std::map< sal_Int32, ShapeStyleRef > ShapeStyleRefMap;
-
-
/** Additional information for a chart embedded in a drawing shape. */
struct ChartShapeInfo
{
@@ -65,8 +63,6 @@ struct ChartShapeInfo
explicit ChartShapeInfo( bool bEmbedShapes ) : mbEmbedShapes( bEmbedShapes ) {}
};
-
-
class OOX_DLLPUBLIC Shape
: public boost::enable_shared_from_this< Shape >
{
@@ -287,8 +283,6 @@ private:
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maDiagramDoms;
};
-
-
} }
#endif // INCLUDED_OOX_DRAWINGML_SHAPE_HXX
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index 240255c..b33aabe 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -39,15 +39,11 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::chart2;
using namespace ::com::sun::star::chart2::data;
using namespace ::com::sun::star::uno;
-
-
namespace {
/** nastied-up sgn function - employs some gratuity around 0 - values
@@ -168,8 +164,6 @@ void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatt
} // namespace
-
-
DataLabelConverter::DataLabelConverter( const ConverterRoot& rParent, DataLabelModel& rModel ) :
ConverterBase< DataLabelModel >( rParent, rModel )
{
@@ -213,8 +207,6 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
DataLabelsConverter::DataLabelsConverter( const ConverterRoot& rParent, DataLabelsModel& rModel ) :
ConverterBase< DataLabelsModel >( rParent, rModel )
{
@@ -244,8 +236,6 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
}
}
-
-
ErrorBarConverter::ErrorBarConverter( const ConverterRoot& rParent, ErrorBarModel& rModel ) :
ConverterBase< ErrorBarModel >( rParent, rModel )
{
@@ -346,8 +336,6 @@ void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxData
}
}
-// private --------------------------------------------------------------------
-
Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence( ErrorBarModel::SourceType eSourceType )
{
OUString aRole;
@@ -372,8 +360,6 @@ Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence(
return lclCreateLabeledDataSequence( *this, mrModel.maSources.get( eSourceType ).get(), aRole );
}
-
-
TrendlineLabelConverter::TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel ) :
ConverterBase< TrendlineLabelModel >( rParent, rModel )
{
@@ -389,8 +375,6 @@ void TrendlineLabelConverter::convertFromModel( PropertySet& rPropSet )
getFormatter().convertFormatting( rPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_TRENDLINELABEL );
}
-
-
TrendlineConverter::TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel ) :
ConverterBase< TrendlineModel >( rParent, rModel )
{
@@ -479,8 +463,6 @@ void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
DataPointConverter::DataPointConverter( const ConverterRoot& rParent, DataPointModel& rModel ) :
ConverterBase< DataPointModel >( rParent, rModel )
{
@@ -519,8 +501,6 @@ void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDat
}
}
-
-
SeriesConverter::SeriesConverter( const ConverterRoot& rParent, SeriesModel& rModel ) :
ConverterBase< SeriesModel >( rParent, rModel )
{
@@ -683,8 +663,6 @@ Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence(
return lclCreateLabeledDataSequence( *this, pValues, rRole, pTitle );
}
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index 22107e9..b39dfb0 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -26,13 +26,9 @@ namespace oox {
namespace drawingml {
namespace chart {
-
-
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextHandlerRef;
-
-
UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) :
ContextBase< UpDownBarsModel >( rParent, rModel )
{
@@ -62,8 +58,6 @@ ContextHandlerRef UpDownBarsContext::onCreateContext( sal_Int32 nElement, const
return 0;
}
-
-
AreaTypeGroupContext::AreaTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -100,8 +94,6 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-
-
BarTypeGroupContext::BarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -151,8 +143,6 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-
-
BubbleTypeGroupContext::BubbleTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -195,8 +185,6 @@ ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, c
return 0;
}
-
-
LineTypeGroupContext::LineTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -246,8 +234,6 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
return 0;
}
-
-
PieTypeGroupContext::PieTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -296,8 +282,6 @@ ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, cons
return 0;
}
-
-
RadarTypeGroupContext::RadarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -329,8 +313,6 @@ ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, co
return 0;
}
-
-
ScatterTypeGroupContext::ScatterTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -362,8 +344,6 @@ ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-
-
SurfaceTypeGroupContext::SurfaceTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -390,8 +370,6 @@ ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement,
return 0;
}
-
-
} // namespace chart
} // namespace drawingml
} // namespace oox
commit 4074f6f92d64fab4cbeae1e19e1abebae6646b78
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Apr 6 00:36:01 2014 +0200
improve chart series symbol export
Using the chart2 service allows us to export series symbols instead of
the diagram settings.
Change-Id: Ic46f067b60c972af35c0628b3ec4f7851580d725
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 54e2802..4252135 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -162,7 +162,7 @@ private:
sal_Int32 nSeriesLength );
void exportGrouping( bool isBar = false );
void exportTrendlines( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > xSeries );
- void exportMarker();
+ void exportMarker( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > xSeries );
void exportSmooth();
void exportFirstSliceAng();
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 73ebb8e..a19c3a0 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -55,6 +55,7 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataReceiver.hpp>
@@ -1657,6 +1658,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
Reference< chart2::data::XDataSource > xSource( aSeriesSeq[nSeriesIdx], uno::UNO_QUERY );
if( xSource.is())
{
+ Reference< chart2::XDataSeries > xDataSeries( xSource, uno::UNO_QUERY );
Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt(
xSource->getDataSequences());
// search for main sequence and create a series element
@@ -1727,7 +1729,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
{
case chart::TYPEID_LINE:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
case chart::TYPEID_PIE:
@@ -1745,12 +1747,12 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
}
case chart::TYPEID_SCATTER:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
case chart::TYPEID_RADARLINE:
{
- exportMarker( );
+ exportMarker(xDataSeries);
break;
}
}
@@ -2947,48 +2949,55 @@ void ChartExport::exportTrendlines( Reference< chart2::XDataSeries > xSeries )
}
}
-void ChartExport::exportMarker()
+void ChartExport::exportMarker(Reference< chart2::XDataSeries > xSeries)
{
+ Reference< XPropertySet > xPropSet( xSeries, uno::UNO_QUERY );
+ chart2::Symbol aSymbol;
+ if( GetProperty( xPropSet, "Symbol" ) )
+ mAny >>= aSymbol;
+
+ if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_AUTO)
+ return;
+
FSHelperPtr pFS = GetFS();
pFS->startElement( FSNS( XML_c, XML_marker ),
FSEND );
- Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY );
- sal_Int32 nSymbolType = ::com::sun::star::chart::ChartSymbolType::NONE;
- if( GetProperty( xPropSet, "SymbolType" ) )
- mAny >>= nSymbolType;
+ sal_Int32 nSymbol = aSymbol.StandardSymbol;
// TODO: more properties support for marker
const char* pSymbolType = NULL;
- switch( nSymbolType )
+ switch( nSymbol )
{
- case cssc::ChartSymbolType::NONE:
- pSymbolType = "none";
- break;
- case cssc::ChartSymbolType::SYMBOL0:
+ case 0:
pSymbolType = "square";
break;
- case cssc::ChartSymbolType::SYMBOL1:
+ case 1:
pSymbolType = "diamond";
break;
- // map all triangle variants to the OOXML version
- case cssc::ChartSymbolType::SYMBOL2:
- case cssc::ChartSymbolType::SYMBOL3:
- case cssc::ChartSymbolType::SYMBOL4:
- case cssc::ChartSymbolType::SYMBOL5:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
pSymbolType = "triangle";
break;
- case cssc::ChartSymbolType::SYMBOL6:
- pSymbolType = "plus";
+ case 8:
+ pSymbolType = "circle";
break;
- case cssc::ChartSymbolType::SYMBOL7:
- pSymbolType = "plus";
+ case 9:
+ pSymbolType = "star";
+ break;
+ case 10:
+ pSymbolType = "X";
break;
- case cssc::ChartSymbolType::AUTO:
+ case 11:
+ pSymbolType = "plus";
break;
- case cssc::ChartSymbolType::BITMAPURL:
+ case 13:
+ pSymbolType = "dash";
break;
default:
- SAL_WARN("oox", "unknown data series symbol");
+ pSymbolType = "square";
+ break;
}
if( pSymbolType )
@@ -2997,21 +3006,16 @@ void ChartExport::exportMarker()
XML_val, pSymbolType,
FSEND );
}
- if( nSymbolType != cssc::ChartSymbolType::NONE )
- {
- awt::Size aSymbolSize;
- if( GetProperty( xPropSet, "SymbolSize" ) )
- {
- mAny >>= aSymbolSize;;
- sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
- nSize = nSize/250.0*7.0; // just guessed based on some test cases
- nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
- pFS->singleElement( FSNS( XML_c, XML_size),
- XML_val, I32S(nSize),
- FSEND );
- }
- }
+ awt::Size aSymbolSize = aSymbol.Size;
+ sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
+
+ nSize = nSize/250.0*7.0; // just guessed based on some test cases
+ nSize = std::min<sal_Int32>( 72, std::max<sal_Int32>( 2, nSize ) );
+ pFS->singleElement( FSNS( XML_c, XML_size),
+ XML_val, I32S(nSize),
+ FSEND );
+
pFS->endElement( FSNS( XML_c, XML_marker ) );
}
More information about the Libreoffice-commits
mailing list