diff options
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 17 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index fc080cc0f8bf..2573a39f1d7c 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -797,6 +797,16 @@ void WorkbookHelper::finalizeWorkbookImport() sheets. Automatic numbering is set by passing the value 0. */ PropertySet aDefPageStyle( getStyleObject( "Default", true ) ); aDefPageStyle.setProperty< sal_Int16 >( PROP_FirstPageNumber, 0 ); + + // Has any string ref syntax been imported? + // If not, we need to take action + ScCalcConfig aCalcConfig = getScDocument().GetCalcConfig(); + + if ( !aCalcConfig.mbHasStringRefSyntax ) + { + aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_A1_XL_A1; + getScDocument().SetCalcConfig(aCalcConfig); + } } // document model ------------------------------------------------------------- diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 226a27cb4681..d1bb29982160 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -3180,6 +3180,22 @@ void ScXMLImport::SetSheetNamedRanges() } } +void ScXMLImport::SetStringRefSyntaxIfMissing() +{ + if (!pDoc) + return; + + ScCalcConfig aCalcConfig = pDoc->GetCalcConfig(); + + // Has any string ref syntax been imported? + // If not, we need to take action + if ( !aCalcConfig.mbHasStringRefSyntax ) + { + aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_A1_XL_A1; + pDoc->SetCalcConfig(aCalcConfig); + } +} + void SAL_CALL ScXMLImport::endDocument() throw(::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException, @@ -3226,6 +3242,7 @@ void SAL_CALL ScXMLImport::endDocument() SetLabelRanges(); SetNamedRanges(); SetSheetNamedRanges(); + SetStringRefSyntaxIfMissing(); if (mpPivotSources) // Process pivot table sources after the named ranges have been set. mpPivotSources->process(); diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index c26a71016a81..97291ae9503e 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -1219,6 +1219,7 @@ public: void SetSheetNamedRanges(); void SetLabelRanges(); void AddDefaultNote( const com::sun::star::table::CellAddress& aCell ); + void SetStringRefSyntaxIfMissing(); /** Extracts the formula string, the formula grammar namespace URL, and a grammar enum value from the passed formula attribute value. |