summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2021-07-13 18:03:28 +0200
committerLászló Németh <nemeth@numbertext.org>2021-08-09 19:32:36 +0200
commit233286df08aeedb4e228fd523365b94543b16fca (patch)
treee51f69397b8aa152c9cc72810163f760bd798415 /oox
parente8d8dad6bba2bd0a4307ee3c1fc40f117680c1f3 (diff)
tdf#64086 tdf#143623 tdf#66250 XLSX: fix named ranges in charts
tdf#64086: fix broken XLSX import of named ranges in charts Do not create inner data table in Calc for charts, if the data source contains named ranges. Use the named ranges (local sheet names and global names) to find the data source of charts, so it will be updated correctly if we modify the values in cells. Second part: tdf#143623: chart OOXML, offapi: export the named ranges in charts with the proper special (non-ooxml-standard) Excel syntax. We need to add "[0]" characters before a global named range for proper refreshing of chart data. Also we have to add the sheet name to the local named ranges even if it's on the same sheet, but only in case of charts. Because of this, add property RefConventionChartOOXML to com::sun::star::sheet::FormulaParser, which specifies that use special OOXML chart syntax in case of OOXML reference convention, when parsing a formula string. Third part: tdf#66250 ODF chart: export the reference of named ranges in case of charts, if the named range contains a valid reference. Note: maybe export the name of named ranges would be a nicer solution in the future. Follow-up of commit 3c766512984feff739377d0f0af46558ee7139fd "Related: tdf#64086 Add FormulaGrammar::isRefConventionOOXML()". Thanks to Eike Rathke for his help. Change-Id: I10d8563fb436092e833682f331c25b0c0829ef86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118862 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx2
-rw-r--r--oox/source/token/properties.txt1
2 files changed, 3 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 2a0d335ca86b..dfebc8bf061a 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -710,6 +710,8 @@ OUString ChartExport::parseFormula( const OUString& rRange )
if( xParserProps.is() )
{
xParserProps->setPropertyValue("FormulaConvention", uno::makeAny(css::sheet::AddressConvention::XL_OOX) );
+ // For referencing named ranges correctly with special excel chart syntax.
+ xParserProps->setPropertyValue("RefConventionChartOOXML", uno::makeAny(true) );
}
aResult = xParser->printFormula( aTokens, CellAddress( 0, 0, 0 ) );
}
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index b35a5bc3cd4a..808df85533ff 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -411,6 +411,7 @@ RangeYMaximum
RangeYMinimum
ReadOnly
RefAngle
+RefConventionChartOOXML
RefR
RefX
RefY