summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/formula/grammar.hxx6
-rw-r--r--sc/source/core/tool/interpr1.cxx14
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx4
-rw-r--r--sc/source/ui/unoobj/confuno.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/formulacalculationoptions.ui1
5 files changed, 23 insertions, 4 deletions
diff --git a/include/formula/grammar.hxx b/include/formula/grammar.hxx
index 4f6a2bcdf2c3..618db98c1143 100644
--- a/include/formula/grammar.hxx
+++ b/include/formula/grammar.hxx
@@ -43,7 +43,11 @@ public:
CONV_LOTUS_A1, /* external? 3d? A1.B2 <placeholder/> */
- CONV_LAST /* for loops, must always be last */
+ CONV_LAST, /* for loops, must always be last */
+
+ // not a real address convention, a special case for INDIRECT function interpretation
+ // only -> try using CONV_OOO, failing that CONV_XL_A1
+ CONV_A1_XL_A1
};
//! CONV_UNSPECIFIED is a negative value!
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>