chart2/qa/extras/chart2export.cxx | 17 +++ chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx |binary offapi/com/sun/star/sheet/FormulaParser.idl | 10 ++ oox/source/export/chartexport.cxx | 2 oox/source/token/properties.txt | 1 sc/inc/compiler.hxx | 3 sc/inc/tokenuno.hxx | 1 sc/inc/unonames.hxx | 1 sc/qa/uitest/chart/tdf64086.py | 31 +++++++ sc/qa/uitest/data/tdf64086.xlsx |binary sc/source/core/tool/compiler.cxx | 27 +++++- sc/source/core/tool/reftokenhelper.cxx | 20 ++++ sc/source/ui/unoobj/chart2uno.cxx | 79 +++++++++++++++--- sc/source/ui/unoobj/tokenuno.cxx | 15 ++- 14 files changed, 192 insertions(+), 15 deletions(-)
New commits: commit 464a95c90f7b00c9edbd906b335fa7dfaee73e50 Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Tue Jul 13 18:03:28 2021 +0200 Commit: Balazs Varga <varga.bala...@nisz.hu> CommitDate: Thu Oct 21 10:05:34 2021 +0200 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 <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123896 Tested-by: Balazs Varga <varga.bala...@nisz.hu> Reviewed-by: Balazs Varga <varga.bala...@nisz.hu> diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index d0cd3be67d66..f6416c385ced 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -186,6 +186,7 @@ public: void testTdf138181(); void testCustomShapeText(); void testuserShapesXLSX(); + void testNameRangeXLSX(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -334,6 +335,7 @@ public: CPPUNIT_TEST(testTdf138181); CPPUNIT_TEST(testCustomShapeText); CPPUNIT_TEST(testuserShapesXLSX); + CPPUNIT_TEST(testNameRangeXLSX); CPPUNIT_TEST_SUITE_END(); @@ -3086,6 +3088,21 @@ void Chart2ExportTest::testuserShapesXLSX() CPPUNIT_ASSERT(!xRange->getString().isEmpty()); } +void Chart2ExportTest::testNameRangeXLSX() +{ + load(u"/chart2/qa/extras/data/xlsx/", "chart_with_name_range.xlsx"); + xmlDocUniquePtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + // test the syntax of local range name on the the local sheet. + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:cat/c:strRef/c:f", + "Sheet1!local_name_range"); + // test the syntax of a global range name. + assertXPathContent(pXmlDoc, + "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:ser/c:val/c:numRef/c:f", + "[0]!series1"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx new file mode 100644 index 000000000000..2f2b814011ff Binary files /dev/null and b/chart2/qa/extras/data/xlsx/chart_with_name_range.xlsx differ diff --git a/offapi/com/sun/star/sheet/FormulaParser.idl b/offapi/com/sun/star/sheet/FormulaParser.idl index 2c1145ec1369..fb9085130341 100644 --- a/offapi/com/sun/star/sheet/FormulaParser.idl +++ b/offapi/com/sun/star/sheet/FormulaParser.idl @@ -81,6 +81,16 @@ service FormulaParser */ [property] sequence< ExternalLinkInfo > ExternalLinks; + + /** specifies that use special ooxml chart syntax in case of OOXML reference + convention, when parsing a formula string. + + <p>Special syntax like: [0]!GlobalNamedRange, LocalSheet!LocalNamedRange</p> + + @since LibreOffice 7.3 + */ + [property] boolean RefConventionChartOOXML; + }; diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index be49cfb8f26f..727fe1659378 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -712,6 +712,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 d50cd4bb124d..aaf3df4b3fb3 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -405,6 +405,7 @@ RangeYMaximum RangeYMinimum ReadOnly RefAngle +RefConventionChartOOXML RefR RefX RefY diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index b051f3ad4b4e..f8080eaf5a3a 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -294,6 +294,8 @@ private: ExtendedErrorDetection meExtendedErrorDetection; bool mbCloseBrackets; // whether to close open brackets automatically, default TRUE bool mbRewind; // whether symbol is to be rewound to some step during lexical analysis + bool mbRefConventionChartOOXML; // whether to use special ooxml chart syntax in case of OOXML reference convention, + // when parsing a formula string. [0]!GlobalNamedRange, LocalSheet!LocalNamedRange std::vector<sal_uInt16> maExternalFiles; std::vector<OUString> maTabNames; /// sheet names mangled for the current grammar for output @@ -409,6 +411,7 @@ public: */ void SetAutoCorrection( bool bVal ); void SetCloseBrackets( bool bVal ) { mbCloseBrackets = bVal; } + void SetRefConventionChartOOXML( bool bVal ) { mbRefConventionChartOOXML = bVal; } void SetRefConvention( const Convention *pConvP ); void SetRefConvention( const formula::FormulaGrammar::AddressConvention eConv ); diff --git a/sc/inc/tokenuno.hxx b/sc/inc/tokenuno.hxx index 1c8def78720e..dde92ab266fd 100644 --- a/sc/inc/tokenuno.hxx +++ b/sc/inc/tokenuno.hxx @@ -63,6 +63,7 @@ private: bool mbEnglish; bool mbIgnoreSpaces; bool mbCompileFAP; + bool mbRefConventionChartOOXML; void SetCompilerFlags( ScCompiler& rCompiler ) const; diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 9a71377ff116..60bdd90fa70d 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -671,6 +671,7 @@ #define SC_UNO_OPCODEMAP "OpCodeMap" #define SC_UNO_EXTERNALLINKS "ExternalLinks" #define SC_UNO_COMPILEFAP "CompileFAP" +#define SC_UNO_REF_CONV_CHARTOOXML "RefConventionChartOOXML" // Chart2 #define SC_UNONAME_ROLE "Role" diff --git a/sc/qa/uitest/chart/tdf64086.py b/sc/qa/uitest/chart/tdf64086.py new file mode 100644 index 000000000000..238a936a9caa --- /dev/null +++ b/sc/qa/uitest/chart/tdf64086.py @@ -0,0 +1,31 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_url_for_data_file + +class NamedRangesChart(UITestCase): + + def test_chart_series_ranges_with_named_ranges_as_datasource(self): + with self.ui_test.load_file(get_url_for_data_file("tdf64086.xlsx")) as calc_doc: + + xChart = calc_doc.Sheets[0].Charts[0] + xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries + + self.assertEqual(3, len(xDataSeries)) + + test_range1 = calc_doc.Sheets[0].NamedRanges.getByName("Local_sheet_name") + self.assertEqual(xDataSeries[0].DataSequences[0].Values.SourceRangeRepresentation, test_range1.Name) + + test_range2 = calc_doc.NamedRanges.getByName("global_name") + self.assertEqual(xDataSeries[1].DataSequences[0].Values.SourceRangeRepresentation, test_range2.Name) + + test_range3 = calc_doc.Sheets[1].NamedRanges.getByName("other_sheet_name") + test_range3_Name = calc_doc.Sheets[1].Name + '.' + test_range3.Name + self.assertEqual(xDataSeries[2].DataSequences[0].Values.SourceRangeRepresentation, test_range3_Name) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/tdf64086.xlsx b/sc/qa/uitest/data/tdf64086.xlsx new file mode 100644 index 000000000000..4cbd5ce8dbd1 Binary files /dev/null and b/sc/qa/uitest/data/tdf64086.xlsx differ diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 7dd0ca5374a7..d1dd29dd65b9 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1849,6 +1849,7 @@ ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, meExtendedErrorDetection(EXTENDED_ERROR_DETECTION_NONE), mbCloseBrackets(true), mbRewind(false), + mbRefConventionChartOOXML(false), maTabNames(rCxt.getTabNames()) { SetGrammar(rCxt.getGrammar()); @@ -1872,7 +1873,8 @@ ScCompiler::ScCompiler( ScDocument& rDocument, const ScAddress& rPos, ScTokenArr pConv( GetRefConvention( FormulaGrammar::CONV_OOO ) ), meExtendedErrorDetection( EXTENDED_ERROR_DETECTION_NONE ), mbCloseBrackets( true ), - mbRewind( false ) + mbRewind( false ), + mbRefConventionChartOOXML( false ) { SetGrammar( (eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? rDocument.GetGrammar() : @@ -1896,6 +1898,7 @@ ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, meExtendedErrorDetection(EXTENDED_ERROR_DETECTION_NONE), mbCloseBrackets(true), mbRewind(false), + mbRefConventionChartOOXML(false), maTabNames(rCxt.getTabNames()) { SetGrammar(rCxt.getGrammar()); @@ -1919,7 +1922,8 @@ ScCompiler::ScCompiler( ScDocument& rDocument, const ScAddress& rPos, pConv( GetRefConvention( FormulaGrammar::CONV_OOO ) ), meExtendedErrorDetection( EXTENDED_ERROR_DETECTION_NONE ), mbCloseBrackets( true ), - mbRewind( false ) + mbRewind( false ), + mbRefConventionChartOOXML( false ) { SetGrammar( (eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? rDocument.GetGrammar() : @@ -2232,6 +2236,18 @@ Label_MaskStateMachine: if (c == '[' && FormulaGrammar::isExcelSyntax( meGrammar) && eLastOp != ocDBArea && maTableRefs.empty()) { + // [0]!Global_Range_Name, is a special case in OOXML + // syntax, where the '0' is referencing to self and we + // do not need it, so we should skip it, in order to + // later it will be more recognisable for IsNamedRange. + if (FormulaGrammar::isRefConventionOOXML(meGrammar) && + pSrc[0] == '0' && pSrc[1] == ']' && pSrc[2] == '!') + { + pSrc += 3; + c = *pSrc; + continue; + } + nMask &= ~ScCharFlags::Char; goto Label_MaskStateMachine; } @@ -5276,7 +5292,7 @@ void ScCompiler::CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaTo if (pData) { SCTAB nTab = _pTokenP->GetSheet(); - if (nTab >= 0 && nTab != aPos.Tab()) + if (nTab >= 0 && (nTab != aPos.Tab() || mbRefConventionChartOOXML)) { // Sheet-local on other sheet. OUString aName; @@ -5289,6 +5305,11 @@ void ScCompiler::CreateStringFromIndex( OUStringBuffer& rBuffer, const FormulaTo aBuffer.append(ScCompiler::GetNativeSymbol(ocErrName)); aBuffer.append( pConv->getSpecialSymbol( ScCompiler::Convention::SHEET_SEPARATOR)); } + else if (mbRefConventionChartOOXML) + { + aBuffer.append("[0]"); + aBuffer.append(pConv->getSpecialSymbol(ScCompiler::Convention::SHEET_SEPARATOR)); + } aBuffer.append(pData->GetName()); } } diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index 58d9353222dc..7d49a60f3e97 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -108,6 +108,16 @@ void ScRefTokenHelper::compileRangeRepresentation( if (p->GetString().isEmpty()) bFailure = true; break; + case svIndex: + { + if (p->GetOpCode() == ocName) + { + ScRangeData* pNameRange = rDoc.FindRangeNameBySheetAndIndex(p->GetSheet(), p->GetIndex()); + if (!pNameRange->HasReferences()) + bFailure = true; + } + } + break; default: bFailure = true; break; @@ -150,6 +160,16 @@ bool ScRefTokenHelper::getRangeFromToken( rRange = rRefData.toAbs(*pDoc, rPos); return true; } + case svIndex: + { + if (pToken->GetOpCode() == ocName) + { + ScRangeData* pNameRange = pDoc->FindRangeNameBySheetAndIndex(pToken->GetSheet(), pToken->GetIndex()); + if (pNameRange->IsReference(rRange, rPos)) + return true; + } + return false; + } default: ; // do nothing } diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 004729176c2e..adc2dd85a1ad 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -874,9 +874,21 @@ public: ScTokenRef aStart, aEnd; bool bValidToken = splitRangeToken(*mpDoc, rToken, aStart, aEnd); + // Check there is a valid reference in named range + if (!bValidToken && rToken->GetType() == svIndex && rToken->GetOpCode() == ocName) + { + ScRangeData* pNameRange = mpDoc->FindRangeNameBySheetAndIndex(rToken->GetSheet(), rToken->GetIndex()); + if (pNameRange->HasReferences()) + { + const ScTokenRef aTempToken = pNameRange->GetCode()->FirstToken(); + bValidToken = splitRangeToken(*mpDoc, aTempToken, aStart, aEnd); + } + } + OSL_ENSURE(bValidToken, "invalid token"); if (!bValidToken) return; + ScCompiler aCompiler(*mpDoc, ScAddress(0,0,0), FormulaGrammar::GRAM_ENGLISH); { OUString aStr; @@ -1592,7 +1604,7 @@ class RangeAnalyzer { public: RangeAnalyzer(); - void initRangeAnalyzer( const vector<ScTokenRef>& rTokens ); + void initRangeAnalyzer( const ScDocument* pDoc, const vector<ScTokenRef>& rTokens ); void analyzeRange( sal_Int32& rnDataInRows, sal_Int32& rnDataInCols, bool& rbRowSourceAmbiguous ) const; bool inSameSingleRow( const RangeAnalyzer& rOther ); @@ -1620,7 +1632,7 @@ RangeAnalyzer::RangeAnalyzer() { } -void RangeAnalyzer::initRangeAnalyzer( const vector<ScTokenRef>& rTokens ) +void RangeAnalyzer::initRangeAnalyzer( const ScDocument* pDoc, const vector<ScTokenRef>& rTokens ) { mnRowCount=0; mnColumnCount=0; @@ -1674,6 +1686,28 @@ void RangeAnalyzer::initRangeAnalyzer( const vector<ScTokenRef>& rTokens ) mbAmbiguous=true; } } + else if (eVar == svIndex && aRefToken->GetOpCode() == ocName) + { + ScRangeData* pNameRange = pDoc->FindRangeNameBySheetAndIndex(aRefToken->GetSheet(), aRefToken->GetIndex()); + ScRange aRange; + if (pNameRange->IsReference(aRange)) + { + mnColumnCount = std::max<SCCOL>(mnColumnCount, static_cast<SCCOL>(abs(aRange.aEnd.Col() - aRange.aStart.Col()) + 1)); + mnRowCount = std::max<SCROW>(mnRowCount, static_cast<SCROW>(abs(aRange.aEnd.Row() - aRange.aStart.Row()) + 1)); + if (mnStartColumn == -1) + { + mnStartColumn = aRange.aStart.Col(); + mnStartRow = aRange.aStart.Row(); + } + else + { + if (mnStartColumn != aRange.aStart.Col() && mnStartRow != aRange.aStart.Row()) + mbAmbiguous = true; + } + } + else + mbAmbiguous = true; + } else mbAmbiguous=true; } @@ -1776,10 +1810,22 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); ScRefTokenHelper::compileRangeRepresentation( aTokens, xLabel->getSourceRangeRepresentation(), *m_pDocument, cSep, m_pDocument->GetGrammar(), true); - aLabel.initRangeAnalyzer(aTokens); + aLabel.initRangeAnalyzer(m_pDocument, aTokens); for (const auto& rxToken : aTokens) { - ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); + if (rxToken->GetType() == svIndex && rxToken->GetOpCode() == ocName) + { + ScRangeData* pNameRange = m_pDocument->FindRangeNameBySheetAndIndex(rxToken->GetSheet(), rxToken->GetIndex()); + if (pNameRange->HasReferences()) + { + const ScTokenRef aTempToken = pNameRange->GetCode()->FirstToken(); + ScRefTokenHelper::join(m_pDocument, aAllTokens, aTempToken, ScAddress()); + } + else + ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); + } + else + ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); if(!bThisIsCategories) ScRefTokenHelper::join(m_pDocument, aAllSeriesLabelTokens, rxToken, ScAddress()); } @@ -1794,10 +1840,22 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); ScRefTokenHelper::compileRangeRepresentation( aTokens, xValues->getSourceRangeRepresentation(), *m_pDocument, cSep, m_pDocument->GetGrammar(), true); - aValues.initRangeAnalyzer(aTokens); + aValues.initRangeAnalyzer(m_pDocument, aTokens); for (const auto& rxToken : aTokens) { - ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); + if (rxToken->GetType() == svIndex && rxToken->GetOpCode() == ocName) + { + ScRangeData* pNameRange = m_pDocument->FindRangeNameBySheetAndIndex(rxToken->GetSheet(), rxToken->GetIndex()); + if (pNameRange->HasReferences()) + { + const ScTokenRef aTempToken = pNameRange->GetCode()->FirstToken(); + ScRefTokenHelper::join(m_pDocument, aAllTokens, aTempToken, ScAddress()); + } + else + ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); + } + else + ScRefTokenHelper::join(m_pDocument, aAllTokens, rxToken, ScAddress()); if(bThisIsCategories) ScRefTokenHelper::join(m_pDocument, aAllCategoriesValuesTokens, rxToken, ScAddress()); } @@ -1884,13 +1942,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum RangeAnalyzer aTop,aLeft; if( eRowSource==chart::ChartDataRowSource_COLUMNS ) { - aTop.initRangeAnalyzer(aAllSeriesLabelTokens); - aLeft.initRangeAnalyzer(aAllCategoriesValuesTokens); + aTop.initRangeAnalyzer(m_pDocument, aAllSeriesLabelTokens); + aLeft.initRangeAnalyzer(m_pDocument, aAllCategoriesValuesTokens); } else { - aTop.initRangeAnalyzer(aAllCategoriesValuesTokens); - aLeft.initRangeAnalyzer(aAllSeriesLabelTokens); + aTop.initRangeAnalyzer(m_pDocument, aAllCategoriesValuesTokens); + aLeft.initRangeAnalyzer(m_pDocument, aAllSeriesLabelTokens); } lcl_addUpperLeftCornerIfMissing(m_pDocument, aAllTokens, aTop.getRowCount(), aLeft.getColumnCount());//e.g. #i91212# } @@ -2126,6 +2184,7 @@ ScChart2DataProvider::createDataSequenceByFormulaTokens( } } break; + case svIndex: case svString: case svSingleRef: case svDoubleRef: diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 3de405b605b2..f5696572561b 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -66,7 +66,8 @@ ScFormulaParserObj::ScFormulaParserObj(ScDocShell* pDocSh) : mnConv( sheet::AddressConvention::UNSPECIFIED ), mbEnglish( false ), mbIgnoreSpaces( true ), - mbCompileFAP( false ) + mbCompileFAP( false ), + mbRefConventionChartOOXML( false ) { mpDocShell->GetDocument().AddUnoObject(*this); } @@ -119,7 +120,8 @@ void ScFormulaParserObj::SetCompilerFlags( ScCompiler& rCompiler ) const rCompiler.EnableJumpCommandReorder(!mbCompileFAP); rCompiler.EnableStopOnError(!mbCompileFAP); - rCompiler.SetExternalLinks( maExternalLinks); + rCompiler.SetExternalLinks(maExternalLinks); + rCompiler.SetRefConventionChartOOXML(mbRefConventionChartOOXML); } uno::Sequence<sheet::FormulaToken> SAL_CALL ScFormulaParserObj::parseFormula( @@ -226,6 +228,11 @@ void SAL_CALL ScFormulaParserObj::setPropertyValue( if (!(aValue >>= maExternalLinks)) throw lang::IllegalArgumentException(); } + else if ( aPropertyName == SC_UNO_REF_CONV_CHARTOOXML ) + { + if (!(aValue >>= mbRefConventionChartOOXML)) + throw lang::IllegalArgumentException(); + } else throw beans::UnknownPropertyException(aPropertyName); } @@ -258,6 +265,10 @@ uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const OUString& aPropert { aRet <<= maExternalLinks; } + else if ( aPropertyName == SC_UNO_REF_CONV_CHARTOOXML ) + { + aRet <<= mbRefConventionChartOOXML; + } else throw beans::UnknownPropertyException(aPropertyName); return aRet;