diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-07-24 14:46:26 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-25 00:56:52 +0000 |
commit | fe88fe6f828597fe2645a20c1a07716216a810c3 (patch) | |
tree | 6c14dd59730a6a2f3747754f160b783fcd782422 | |
parent | 11e6683be17aa1210dc78190f5a16d30390e013b (diff) |
tdf#92256: Make OOXML filter CONV_A1_XL_A1 aware too
+ don't write string ref syntax if it hasn't been read or explicitly
changed
Change-Id: Id3788a71a4a3d0672283a4770c7d7a9608beb06f
Reviewed-on: https://gerrit.libreoffice.org/17326
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | oox/source/token/tokens.txt | 1 | ||||
-rw-r--r-- | sc/source/filter/excel/excdoc.cxx | 11 | ||||
-rw-r--r-- | sc/source/filter/excel/xeextlst.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/oox/extlstcontext.cxx | 11 |
4 files changed, 19 insertions, 8 deletions
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt index 1ed16812f77d..c5843faffdd8 100644 --- a/oox/source/token/tokens.txt +++ b/oox/source/token/tokens.txt @@ -70,6 +70,7 @@ Broadcaster Button CF CalcA1 +CalcA1ExcelA1 Camera Cancel Caption diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index de983b4f97e6..a591402a6ad2 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -881,10 +881,15 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm ) if (rCaches.HasCaches()) rCaches.SaveXml(rStrm); - XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) ); const ScCalcConfig& rCalcConfig = GetDoc().GetCalcConfig(); - xExtLst->AddRecord( XclExpExtRef( new XclExpExtCalcPr( GetRoot(), rCalcConfig.meStringRefAddressSyntax )) ); - xExtLst->SaveXml(rStrm); + + // don't write if it hasn't been read or explicitly changed + if ( rCalcConfig.mbHasStringRefSyntax ) + { + XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) ); + xExtLst->AddRecord( XclExpExtRef( new XclExpExtCalcPr( GetRoot(), rCalcConfig.meStringRefAddressSyntax )) ); + xExtLst->SaveXml(rStrm); + } rWorkbook->endElement( XML_workbook ); rWorkbook.reset(); diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index 6982ec3687b7..b6c781891dda 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -378,12 +378,14 @@ XclExpExtCalcPr::XclExpExtCalcPr( const XclExpRoot& rRoot, formula::FormulaGramm case formula::FormulaGrammar::CONV_XL_R1C1: maSyntax = OString("ExcelR1C1"); break; + case formula::FormulaGrammar::CONV_A1_XL_A1: + maSyntax = OString("CalcA1ExcelA1"); + break; case formula::FormulaGrammar::CONV_UNSPECIFIED: case formula::FormulaGrammar::CONV_ODF: case formula::FormulaGrammar::CONV_XL_OOX: case formula::FormulaGrammar::CONV_LOTUS_A1: case formula::FormulaGrammar::CONV_LAST: - case formula::FormulaGrammar::CONV_A1_XL_A1: maSyntax = OString("Unspecified"); break; } diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 81590b42e314..f0980d54ffb5 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -265,16 +265,19 @@ ContextHandlerRef ExtGlobalWorkbookContext::onCreateContext( sal_Int32 nElement, switch( nToken ) { case XML_CalcA1: - aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_OOO; + aCalcConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_OOO ); break; case XML_ExcelA1: - aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_A1; + aCalcConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_XL_A1 ); break; case XML_ExcelR1C1: - aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_R1C1; + aCalcConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_XL_R1C1 ); + break; + case XML_CalcA1ExcelA1: + aCalcConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_A1_XL_A1 ); break; default: - aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_UNSPECIFIED; + aCalcConfig.SetStringRefSyntax( formula::FormulaGrammar::CONV_UNSPECIFIED ); break; } pDoc->SetCalcConfig(aCalcConfig); |