[Libreoffice-commits] core.git: oox/source sc/source
Katarina Behrens
Katarina.Behrens at cib.de
Fri Jul 24 17:57:21 PDT 2015
oox/source/token/tokens.txt | 1 +
sc/source/filter/excel/excdoc.cxx | 11 ++++++++---
sc/source/filter/excel/xeextlst.cxx | 4 +++-
sc/source/filter/oox/extlstcontext.cxx | 11 +++++++----
4 files changed, 19 insertions(+), 8 deletions(-)
New commits:
commit fe88fe6f828597fe2645a20c1a07716216a810c3
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jul 24 14:46:26 2015 +0200
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 at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index 1ed1681..c5843fa 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 de983b4..a591402 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 6982ec3..b6c7818 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 81590b4..f0980d5 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);
More information about the Libreoffice-commits
mailing list