From 645bccf7a5b91d794d387286deca583ea41f3516 Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Thu, 4 Sep 2014 22:20:01 +0200 Subject: fdo#83481 Correct syntax for external references with all formula syntax Change-Id: I99ea9f026b95d36f6335414c46f332f5ba7cf235 Reviewed-on: https://gerrit.libreoffice.org/11286 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/source/ui/app/inputhdl.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 05e0251457ca..0ee88c5cb07b 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2861,9 +2861,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 -- cgit v1.2.3