summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2014-09-04 22:20:01 +0200
committerEike Rathke <erack@redhat.com>2014-09-05 10:52:33 -0500
commit10817252c56f48b0026158fc37a55005098a9d78 (patch)
treedc2c28db58e553677c7486d01c91f45872a08450
parent71d25406d9039633fea0bc07132ed180d8f661e6 (diff)
fdo#83481 Correct syntax for external references with all formula syntax
Reviewed-on: https://gerrit.libreoffice.org/11286 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 645bccf7a5b91d794d387286deca583ea41f3516) Signed-off-by: Eike Rathke <erack@redhat.com> parseExternalDocName() also for ConventionXL_A1::parseAnyToken(), fdo#83481 to make 645bccf7a5b91d794d387286deca583ea41f3516 actually work for both, ExcelA1 and ExcelR1C1 address conventions. (cherry picked from commit 5cb685d9e248f810e00a0a8617ebb04dcb7a5334) Change-Id: I99ea9f026b95d36f6335414c46f332f5ba7cf235 Reviewed-on: https://gerrit.libreoffice.org/11300 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx19
2 files changed, 18 insertions, 3 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index bfd8802edef7..13639ccc8716 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -1241,6 +1241,8 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
sal_Int32 nSrcPos,
const CharClass* pCharClass) const SAL_OVERRIDE
{
+ ConventionXL::parseExternalDocName(rFormula, nSrcPos);
+
ParseResult aRet;
if ( lcl_isValidQuotedText(rFormula, nSrcPos, aRet) )
return aRet;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9e3bd5a23dd9..aa1c955fbede 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2868,9 +2868,22 @@ void ScInputHandler::SetReference( const ScRange& rRef, ScDocument* pDoc )
// #i75893# convert escaped URL of the document to something user friendly
OUString aFileName = pObjSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
- aRefStr = "\'";
- aRefStr += aFileName;
- aRefStr += "'#";
+ switch(aAddrDetails.eConv)
+ {
+ case formula::FormulaGrammar::CONV_XL_A1 :
+ case formula::FormulaGrammar::CONV_XL_OOX :
+ case formula::FormulaGrammar::CONV_XL_R1C1 :
+ aRefStr = "[\'";
+ aRefStr += aFileName;
+ aRefStr += "']";
+ break;
+ case formula::FormulaGrammar::CONV_OOO :
+ default:
+ aRefStr = "\'";
+ aRefStr += aFileName;
+ aRefStr += "'#";
+ break;
+ }
aRefStr += aTmp;
}
else