diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-02-12 13:47:50 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-02-20 11:18:40 +0100 |
commit | 769433ad93040bc81f06672c8a2c01e2b76fece3 (patch) | |
tree | f2f12845bc7486d4d7af0d0303dc201ebd6db4a6 /oox/source | |
parent | c6f5e12ee3f91234b064222272d756670f3bb207 (diff) |
tdf#90749 chart: add leader lines to custom data label positions
also export them as CustomXML extension for MSO interoperability.
Note: pie chart is not yet supported.
See commit 4223ff2be69f03e571464b0b09ad0d278918631b
( tdf#48436 Chart: add CustomLabelPosition UNO API property)
Change-Id: Ia8142408414d4ad8f689d789386db50038ed13f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88531
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 3 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 9 | ||||
-rw-r--r-- | oox/source/token/namespaces-strict.txt | 1 | ||||
-rw-r--r-- | oox/source/token/namespaces.hxx.tail | 1 | ||||
-rw-r--r-- | oox/source/token/namespaces.txt | 1 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 1 | ||||
-rw-r--r-- | oox/source/token/tokens.txt | 1 |
8 files changed, 19 insertions, 0 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 3957f51cca1f..c6e9173ce53f 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -151,6 +151,8 @@ struct NamespaceIds: public rtl::StaticWithInit< NMSP_p15}, {"http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac", NMSP_x12ac}, + {"http://schemas.microsoft.com/office/drawing/2012/chart", + NMSP_c15}, }; } }; diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index c190fa6a1b6d..61ee198d006f 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -340,6 +340,9 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa // Import baseline border properties for these data labels. importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); } + // import leaderline of data labels + if( !mrModel.mbShowLeaderLines ) + aPropSet.setProperty( PROP_ShowLeaderLines, false ); // data point label settings for (auto const& pointLabel : mrModel.maPointLabels) diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index ae33fdcdd222..fbeb2a892672 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3464,6 +3464,15 @@ void ChartExport::exportDataLabels( pFS->singleElement(FSNS(XML_c, XML_showLeaderLines), XML_val, "0"); + // Export leader line + if( eChartType != chart::TYPEID_PIE ) + { + pFS->startElement(FSNS(XML_c, XML_extLst)); + pFS->startElement(FSNS(XML_c, XML_ext), XML_uri, "{CE6537A1-D6FC-4f65-9D91-7224C49458BB}", FSNS(XML_xmlns, XML_c15), GetFB()->getNamespaceURL(OOX_NS(c15)).toUtf8()); + pFS->singleElement(FSNS(XML_c15, XML_showLeaderLines), XML_val, "1"); + pFS->endElement(FSNS(XML_c, XML_ext)); + pFS->endElement(FSNS(XML_c, XML_extLst)); + } pFS->endElement(FSNS(XML_c, XML_dLbls)); } diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt index d6990e5bdf91..9a62a301a513 100644 --- a/oox/source/token/namespaces-strict.txt +++ b/oox/source/token/namespaces-strict.txt @@ -86,6 +86,7 @@ p14 http://schemas.microsoft.com/office/powerpoint/2010/main p15 http://schemas.microsoft.com/office/powerpoint/2012/main x12ac http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac +c15 http://schemas.microsoft.com/office/drawing/2012/chart # extlst namespaces diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail index 991527f1d5d6..fdea5b96f1b4 100644 --- a/oox/source/token/namespaces.hxx.tail +++ b/oox/source/token/namespaces.hxx.tail @@ -43,6 +43,7 @@ inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; } #define PPT_TOKEN( token ) OOX_TOKEN( ppt, token ) #define P14_TOKEN( token ) OOX_TOKEN( p14, token ) #define P15_TOKEN( token ) OOX_TOKEN( p15, token ) +#define C15_TOKEN( token ) OOX_TOKEN( c15, token ) #define PR_TOKEN( token ) OOX_TOKEN( packageRel, token ) #define R_TOKEN( token ) OOX_TOKEN( officeRel, token ) #define VML_TOKEN( token ) OOX_TOKEN( vml, token ) diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt index 604541129469..82bec7274c32 100644 --- a/oox/source/token/namespaces.txt +++ b/oox/source/token/namespaces.txt @@ -86,6 +86,7 @@ p14 http://schemas.microsoft.com/office/powerpoint/2010/main p15 http://schemas.microsoft.com/office/powerpoint/2012/main x12ac http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac +c15 http://schemas.microsoft.com/office/drawing/2012/chart # extlst namespaces diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index de9cd886643a..4fc0c5b47c57 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -464,6 +464,7 @@ ShowFormulas ShowGrid ShowHighLow ShowInputMessage +ShowLeaderLines ShowLegendEntry ShowList ShowNegativeError diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index 3929d8c93808..27396f5b8dfa 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -1022,6 +1022,7 @@ by byPosition byte c +c15 cBhvr cGp cGpRule |