diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-07-20 22:07:53 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-07-21 18:20:20 +0000 |
commit | abe178814489286aa45dc0799df50e650a78bc9d (patch) | |
tree | 00fb989b569055bc1b638f1c60b526cde6bef34e /sc | |
parent | 6e7f44a50d8b0b4f14771b55ec00f608331cd8aa (diff) |
tdf#92256: Introducing CONV_A1_XL_A1 address pseudoconvention
a special case for INDIRECT function interpretation. Does what
OOo used to do, interprets formula using CONV_OOO first, failing
that, tries CONV_XL_A1
Change-Id: I4281ab2bb7164607206c0b8e51f7e63a1fc2db9a
Reviewed-on: https://gerrit.libreoffice.org/17255
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/optdlg/calcoptionsdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/confuno.cxx | 2 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/formulacalculationoptions.ui | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index b464da4e8716..31e98b1561fd 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7036,12 +7036,18 @@ void ScInterpreter::ScIndirect() // Overwrite the config and try Excel R1C1. eConv = FormulaGrammar::CONV_XL_R1C1; } - const ScAddress::Details aDetails( eConv, aPos ); + + bool bTryXlA1 = (eConv == FormulaGrammar::CONV_A1_XL_A1); + + const ScAddress::Details aDetails( bTryXlA1 ? FormulaGrammar::CONV_OOO : eConv, aPos ); + const ScAddress::Details aDetailsXlA1( FormulaGrammar::CONV_XL_A1, aPos ); SCTAB nTab = aPos.Tab(); OUString sRefStr = GetString().getString(); ScRefAddress aRefAd, aRefAd2; ScAddress::ExternalInfo aExtInfo; - if (ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo)) + if ( ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) || + ( bTryXlA1 && ConvertDoubleRef(pDok, sRefStr, nTab, aRefAd, + aRefAd2, aDetailsXlA1, &aExtInfo) ) ) { if (aExtInfo.mbExternal) { @@ -7053,7 +7059,9 @@ void ScInterpreter::ScIndirect() else PushDoubleRef( aRefAd, aRefAd2); } - else if (ConvertSingleRef(pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo)) + else if ( ConvertSingleRef(pDok, sRefStr, nTab, aRefAd, aDetails, &aExtInfo) || + ( bTryXlA1 && ConvertSingleRef (pDok, sRefStr, nTab, aRefAd, + aDetailsXlA1, &aExtInfo) ) ) { if (aExtInfo.mbExternal) { diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index d49fb65ceee8..6f2de0bf8b92 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -46,6 +46,8 @@ formula::FormulaGrammar::AddressConvention toAddressConvention(sal_Int32 nPos) return formula::FormulaGrammar::CONV_XL_A1; case 3: return formula::FormulaGrammar::CONV_XL_R1C1; + case 4: + return formula::FormulaGrammar::CONV_A1_XL_A1; case 0: default: ; @@ -64,6 +66,8 @@ sal_Int32 toSelectedItem( formula::FormulaGrammar::AddressConvention eConv ) return 2; case formula::FormulaGrammar::CONV_XL_R1C1: return 3; + case formula::FormulaGrammar::CONV_A1_XL_A1: + return 4; default: ; } diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 82f250200dab..5d0385e2fbea 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -311,6 +311,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( case 0: // CONV_OOO case 2: // CONV_XL_A1 case 3: // CONV_XL_R1C1 + case 7: // CONV_A1_XL_A1 aCalcConfig.meStringRefAddressSyntax = static_cast<formula::FormulaGrammar::AddressConvention>( nUno ); break; default: @@ -467,6 +468,7 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr case formula::FormulaGrammar::CONV_OOO: case formula::FormulaGrammar::CONV_XL_A1: case formula::FormulaGrammar::CONV_XL_R1C1: + case formula::FormulaGrammar::CONV_A1_XL_A1: aRet <<= static_cast<sal_Int16>( aConv ); break; diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui index 20cfab0c7554..59641e639197 100644 --- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui +++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui @@ -86,6 +86,7 @@ <item id="1">Calc A1</item> <item id="2">Excel A1</item> <item id="3">Excel R1C1</item> + <item id="4">Calc A1 | Excel A1</item> </items> </object> <packing> |