Apache OpenOffice (AOO) Bugzilla – Issue 30172
ODFF: INDIRECT function additionally should interpret the exclamation mark as sheet-cell separator.
Last modified: 2013-08-07 15:14:39 UTC
Calc's INDIRECT function additionally should interpret the exclamation mark as sheet-cell separator. This would improve the functionality of imported Excel documents.
Accepted.
enhanced summary and set keywords according to RFE process
Or should be enough to automatically translate =INDIRECT("xxxx!a1") into =INDIRECT(SUBSTITUTE("xxxx!a1"; "!"; ".")) when importing excel document.
Not quite. We'll have to take into account that the sheet name may contain an exclamation mark as well, or the reference string may actually consist of an external reference and file name containing exclamation marks. Only the last exclamation mark right before a cell address or range name can be converted.
Allow me to propose a workaround using a name reference(Ctrl+F3) shSep =MID(ADDRESS(1;1;1;"Foo");4;1) =INDIRECT("xxxx"&shSep&"a1") Now your formula works in both applications. Same is possible with pattern matching: anyChar =IF(shSep=".";".*";"*") =FIND("F"&anyChar;A1) Notice that regular expressions are turned off when you open xls. Tools>Options>Calc>Calculation:"Allow Regexes in Formulae"
*** Issue 76526 has been marked as a duplicate of this issue. ***
There are XL compatible versions in mainline now, from the R1C1 work (although they do not handle the .de style ZnSn localization). They'll be generally enabled as part of the OpenFormula work rather than the current INDIRECT_XL approach used in oo-build. Unfortunately none of this will help with the differences in allowable sheetnames which may cause a sheet to be renamed on import.
Hi, Eike I have seen this issue several days, but I can not find out a clear clue. I feel a little confuzed. can you point me a way to do this? Yue
@lvyue: I'd try to use a ScAddress::Convention of ScAddress::CONV_XL_A1 if the attempts to parse with ScAddress::CONV_OOO failed. This could be done nicely in a loop, I guess. Note that the ScAddress::CONV_XL_R1C1 case (2nd parameter not present or not True) should not be touched by this.
Created attachment 56019 [details] patch 1.
Hi, Eike Thanks for your comments. :) I thought the question too complex, I thought I should convert the string to the format Calc uses("TabName.ColRow") before the program goes into ScInterpreter::ScIndirect, like other formula. And, check this patch please. :)
In cws odff05: sc/source/core/tool/interpr1.cxx 1.60.54.4 @lvyue: The final solution looks a little bit different from the approach the patch took, since XL_A1 style should only be tried if OOO_A1 failed, not if XL_R1C1 was requested by the second parameter. See revision checked in.
Reassigning to QA for verification.
Created attachment 58884 [details] Testdocuments for Test Case Specification
Created attachment 58885 [details] TestCaseSpecification
verified in internal build cws_odff05
Verified in DEV300_m39 .deb version - Closing - Sophie