From bf033461c5cb0053253f410da7f17dd2e12771c3 Mon Sep 17 00:00:00 2001 From: EricSeynaeve Date: Thu, 28 Feb 2013 23:07:09 +0100 Subject: fdo#61135 stepped lines graph: handle ods files The boilerplate code for drawing the 4 types of stepped is in place (as described in ODF1.3, https://tools.oasis-open.org/issues/browse/OFFICE-3662). We can also read the current attribute values used in Gnumeric. These values are converted to ODF1.3 during save. Change-Id: I0f04a779de4b65326ed7ce6de56191f11b51c596 --- xmloff/inc/xmloff/xmltoken.hxx | 8 ++++++++ xmloff/source/chart/PropertyMap.hxx | 18 ++++++++++++++---- xmloff/source/core/xmltoken.cxx | 10 ++++++++++ xmloff/source/transform/StyleOASISTContext.cxx | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) (limited to 'xmloff') diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 605256f9229e..8ca24b48a4a9 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -2555,6 +2555,14 @@ namespace xmloff { namespace token { XML_INTERPOLATION, XML_CUBIC_SPLINE, XML_B_SPLINE, + XML_STEP_START, + XML_STEP_END, + XML_STEP_CENTER_X, + XML_STEP_CENTER_Y, + XML_GNM_STEP_START, + XML_GNM_STEP_END, + XML_GNM_STEP_CENTER_X, + XML_GNM_STEP_CENTER_Y, XML_N_DB_OASIS, XML_SHOW_FILTER_BUTTON, diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index e8298a6fd70d..023947194930 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -290,10 +290,20 @@ SvXMLEnumMapEntry aXMLChartInterpolationTypeEnumMap[] = { // this is neither an enum nor a constants group, but just a // documented long property - { ::xmloff::token::XML_NONE, 0 }, - { ::xmloff::token::XML_CUBIC_SPLINE, 1 }, - { ::xmloff::token::XML_B_SPLINE, 2 }, - { ::xmloff::token::XML_TOKEN_INVALID,0 } + { ::xmloff::token::XML_NONE, 0 }, + { ::xmloff::token::XML_CUBIC_SPLINE, 1 }, + { ::xmloff::token::XML_B_SPLINE, 2 }, + { ::xmloff::token::XML_STEP_START, 3 }, + { ::xmloff::token::XML_STEP_END, 4 }, + { ::xmloff::token::XML_STEP_CENTER_X, 5 }, + { ::xmloff::token::XML_STEP_CENTER_Y, 6 }, + // the GNM values should only be used for reading Gnumeric ods files + // they should never be used for writing ods file + { ::xmloff::token::XML_GNM_STEP_START, 7 }, + { ::xmloff::token::XML_GNM_STEP_END, 8 }, + { ::xmloff::token::XML_GNM_STEP_CENTER_X, 9 }, + { ::xmloff::token::XML_GNM_STEP_CENTER_Y, 10 }, + { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; SvXMLEnumMapEntry aXMLChartDataLabelPlacementEnumMap[] = diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 46e3a4f46083..b195b94c41ad 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -2556,6 +2556,16 @@ namespace xmloff { namespace token { TOKEN( "interpolation", XML_INTERPOLATION ), TOKEN( "cubic-spline", XML_CUBIC_SPLINE ), TOKEN( "b-spline", XML_B_SPLINE ), + TOKEN( "step-start", XML_STEP_START ), + TOKEN( "step-end", XML_STEP_END ), + TOKEN( "step-center-x", XML_STEP_CENTER_X ), + TOKEN( "step-center-y", XML_STEP_CENTER_Y ), + // the gnm: values should only used for reading Gnumeric ods file + // these values should never be written + TOKEN( "gnm:step-start", XML_GNM_STEP_START ), + TOKEN( "gnm:step-end", XML_GNM_STEP_END ), + TOKEN( "gnm:step-center-x", XML_GNM_STEP_CENTER_X ), + TOKEN( "gnm:step-center-y", XML_GNM_STEP_CENTER_Y ), TOKEN( "urn:oasis:names:tc:opendocument:xmlns:database:1.0", XML_N_DB_OASIS ), TOKEN( "show-filter-button", XML_SHOW_FILTER_BUTTON ), diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx index cd76458ad584..fb05750b6e72 100644 --- a/xmloff/source/transform/StyleOASISTContext.cxx +++ b/xmloff/source/transform/StyleOASISTContext.cxx @@ -315,7 +315,7 @@ void XMLPropertiesTContext_Impl::StartElement( break; case XML_OPTACTION_INTERPOLATION: { - // 0: none + // 0: none (default) sal_Int32 nSplineType = 0; if( IsXMLToken( rAttrValue, XML_CUBIC_SPLINE )) nSplineType = 1; -- cgit v1.2.3