summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-07-26 14:44:38 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-07-30 21:46:53 +0000
commitde58ba7b1ccb90633ca3e78187997f17b2a64d9e (patch)
treec7adbd4aff06273586a8b59781ffb9d81d8e5724
parentbnc#885825: OOXML import and export of data label borders. (diff)
downloadcore-de58ba7b1ccb90633ca3e78187997f17b2a64d9e.tar.gz
core-de58ba7b1ccb90633ca3e78187997f17b2a64d9e.zip
bnc#885825: Handle ODF import and export of data label border properties.
Change-Id: Ic8c7bc873768008537cd52a3fd4b11031b403139 (cherry picked from commit 6c2c974dd3f0b21a23bc3bc5560487d28bbe0fad) Reviewed-on: https://gerrit.libreoffice.org/10563 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx35
-rw-r--r--include/xmloff/xmltoken.hxx4
-rw-r--r--xmloff/source/chart/PropertyMap.hxx7
-rw-r--r--xmloff/source/chart/PropertyMaps.cxx21
-rw-r--r--xmloff/source/core/xmltoken.cxx4
5 files changed, 70 insertions, 1 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index f3c150ed55eb..1dc0cc944251 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -80,7 +80,11 @@ enum
PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
//other series properties
PROP_SERIES_ATTACHED_AXIS,
- PROP_SERIES_DATAPOINT_TEXT_ROTATION
+ PROP_SERIES_DATAPOINT_TEXT_ROTATION,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS
};
void lcl_AddPropertiesToVector_PointProperties(
@@ -142,6 +146,35 @@ void lcl_AddPropertiesToVector_PointProperties(
cppu::UnoType<sal_Int32>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LABEL_BORDER_STYLE,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_STYLE,
+ cppu::UnoType<drawing::LineStyle>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LABEL_BORDER_WIDTH,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_WIDTH,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LABEL_BORDER_COLOR,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_COLOR,
+ cppu::UnoType<sal_Int32>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID // "maybe auto"
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( CHART_UNONAME_LABEL_BORDER_TRANS,
+ PROP_SERIES_DATAPOINT_LABEL_BORDER_TRANS,
+ cppu::UnoType<sal_Int16>::get(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
}
void lcl_AddPropertiesToVector_SeriesOnly(
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 9e206d855bd1..e03dcfdbdeec 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -1067,6 +1067,10 @@ namespace xmloff { namespace token {
XML_LABEL_RANGE,
XML_LABEL_RANGES,
XML_LABEL_STRING,
+ XML_LABEL_STROKE,
+ XML_LABEL_STROKE_COLOR,
+ XML_LABEL_STROKE_OPACITY,
+ XML_LABEL_STROKE_WIDTH,
XML_LAMBDA,
XML_LANDSCAPE,
XML_LANGUAGE,
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index c6b63e57ede2..a876c2b51c7a 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -53,6 +53,8 @@
#define XML_SCH_TYPE_AXIS_POSITION_VALUE ( XML_SCH_TYPES_START + 14 )
#define XML_SCH_TYPE_AXIS_LABEL_POSITION ( XML_SCH_TYPES_START + 15 )
#define XML_SCH_TYPE_TICK_MARK_POSITION ( XML_SCH_TYPES_START + 16 )
+#define XML_SCH_TYPE_LABEL_BORDER_STYLE ( XML_SCH_TYPES_START + 17 )
+#define XML_SCH_TYPE_LABEL_BORDER_OPACITY ( XML_SCH_TYPES_START + 18 )
// context ids
#define XML_SCH_CONTEXT_USER_SYMBOL ( XML_SCH_CTF_START + 0 )
@@ -146,6 +148,11 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
// OpenGL 3D chart flags
MAP_ENTRY_ODF_EXT( "RoundedEdge", LO_EXT, XML_ROUNDED_EDGE, XML_TYPE_BOOL),
+ MAP_ENTRY_ODF_EXT( "LabelBorderColor", LO_EXT, XML_LABEL_STROKE_COLOR, XML_TYPE_COLOR ),
+ MAP_ENTRY_ODF_EXT( "LabelBorderStyle", LO_EXT, XML_LABEL_STROKE, XML_SCH_TYPE_LABEL_BORDER_STYLE ),
+ MAP_ENTRY_ODF_EXT( "LabelBorderTransparency", LO_EXT, XML_LABEL_STROKE_OPACITY, XML_SCH_TYPE_LABEL_BORDER_OPACITY ),
+ MAP_ENTRY_ODF_EXT( "LabelBorderWidth", LO_EXT, XML_LABEL_STROKE_WIDTH, XML_TYPE_MEASURE ),
+
MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ),
// spline settings
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index 564241479bb5..4cb8fa0fac0d 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -34,6 +34,7 @@
#include "XMLTextOrientationHdl.hxx"
#include "XMLSymbolTypePropertyHdl.hxx"
#include "XMLAxisPositionPropertyHdl.hxx"
+#include "../draw/propimp0.hxx"
#include <xmloff/EnumPropertyHdl.hxx>
#include <xmloff/XMLConstantsPropertyHandler.hxx>
@@ -66,6 +67,18 @@
using namespace com::sun::star;
using namespace ::xmloff::token;
+namespace {
+
+SvXMLEnumMapEntry const aLineStyleMap[] =
+{
+ { XML_NONE, drawing::LineStyle_NONE },
+ { XML_SOLID, drawing::LineStyle_SOLID },
+ { XML_DASH, drawing::LineStyle_DASH },
+ { XML_TOKEN_INVALID, 0 }
+};
+
+}
+
// the following class implementations are in this file:
// * XMLChartPropHdlFactory
@@ -154,6 +167,14 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32
pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap,
::cppu::UnoType<sal_Int32>::get() );
break;
+ case XML_SCH_TYPE_LABEL_BORDER_STYLE:
+ pHdl = new XMLEnumPropertyHdl(aLineStyleMap, cppu::UnoType<drawing::LineStyle>::get());
+ break;
+ case XML_SCH_TYPE_LABEL_BORDER_OPACITY:
+ pHdl = new XMLOpacityPropertyHdl(NULL);
+ break;
+ default:
+ ;
}
if( pHdl )
PutHdlCache( nType, pHdl );
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 09027cdac1e7..6c4c09840b99 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1072,6 +1072,10 @@ namespace xmloff { namespace token {
TOKEN( "label-range", XML_LABEL_RANGE ),
TOKEN( "label-ranges", XML_LABEL_RANGES ),
TOKEN( "label-string", XML_LABEL_STRING ),
+ TOKEN( "label-stroke", XML_LABEL_STROKE ),
+ TOKEN( "label-stroke-color", XML_LABEL_STROKE_COLOR ),
+ TOKEN( "label-stroke-opacity", XML_LABEL_STROKE_OPACITY ),
+ TOKEN( "label-stroke-width", XML_LABEL_STROKE_WIDTH ),
TOKEN( "lambda", XML_LAMBDA ),
TOKEN( "landscape", XML_LANDSCAPE ),
TOKEN( "language", XML_LANGUAGE ),