summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-27 12:05:03 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-27 20:41:44 +0200
commit27dde67419e8418a79bab3eab4082c5e341dfd04 (patch)
tree4d5ca48047b9e537c824971c7615ae7a80abf5b3 /sc
parent24c9f6664c41ebe6d58e261eb6a4beece4d85c76 (diff)
first check current document address convention
Might be something else like R1C1 Change-Id: I25419b0d6ce0261b8cb1248671582455331852ac
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 88b2fc6fb9e9..30972e66422e 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -69,25 +69,37 @@
#include <boost/scoped_ptr.hpp>
-/** Try to parse the given range using Calc-style syntax first, then
- Excel-style if that fails. */
static sal_uInt16 lcl_ParseRange(ScRange& rScRange, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
{
- sal_uInt16 nResult = rScRange.Parse(aAddress, pDoc);
+ // start with the address convention set in the document
+ formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
+ sal_uInt16 nResult = rScRange.Parse(aAddress, pDoc, eConv);
if ( (nResult & SCA_VALID) )
return nResult;
+ // try the default calc address convention
+ nResult = rScRange.Parse(aAddress, pDoc);
+ if ( (nResult & SCA_VALID) )
+ return nResult;
+
+ // try excel a1
return rScRange.Parse(aAddress, pDoc, ScAddress::Details(formula::FormulaGrammar::CONV_XL_A1, 0, 0));
}
-/** Try to parse the given address using Calc-style syntax first, then
- Excel-style if that fails. */
static sal_uInt16 lcl_ParseAddress(ScAddress& rScAddress, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
{
- sal_uInt16 nResult = rScAddress.Parse(aAddress, pDoc);
+ // start with the address convention set in the document
+ formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
+ sal_uInt16 nResult = rScAddress.Parse(aAddress, pDoc, eConv);
+ if ( (nResult & SCA_VALID) )
+ return nResult;
+
+ // try the default calc address convention
+ nResult = rScAddress.Parse(aAddress, pDoc);
if ( (nResult & SCA_VALID) )
return nResult;
+ // try excel a1
return rScAddress.Parse(aAddress, pDoc, ScAddress::Details(formula::FormulaGrammar::CONV_XL_A1, 0, 0));
}