Apache OpenOffice (AOO) Bugzilla – Issue 95450
Import of XLS with omitted parameters in function ADDRESS is broken
Last modified: 2013-08-07 15:14:39 UTC
if I insert this formula on "foglio1" I obtain an error: =INDIRIZZO(1;1;;;"Foglio2") but If I explict the default values it works correctly. Compatibility issue: in M$/Excel 97 it works without the defaults. Translation note: "INDIRIZZO" is the Italian translation of "ADDRESS"
In MS Excel =ADDRESS(1;1;;1;"Sheet1") is a valid formula. The third parameter defaults to 1. However, when importing an XLS file or when entering this formula in OOo Calc 3.0 this results in an error value. Importing the same XLS file in OOo 2.4.1 worked fine. --> regression Not duplicate but connatural are issue 95381 and issue 95742.
Consider support of omitted parameters in ADDRESS.
Created attachment 59231 [details] patch 1.
I simplified that by using the method GetDoubleWithDefault(), the resulting patch is: Index: interpr1.cxx =================================================================== --- interpr1.cxx (revision 265913) +++ interpr1.cxx (working copy) @@ -6146,7 +6146,7 @@ void ScInterpreter::ScAddressFunc() USHORT nFlags = SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE; // default if( nParamCount >= 3 ) { - USHORT n = (USHORT) ::rtl::math::approxFloor(GetDouble()); + USHORT n = (USHORT) ::rtl::math::approxFloor( GetDoubleWithDefault( 1.0)); switch ( n ) { default : However, the missing parameter needs to be supported in export to ODF11/PODF file format as well (RewriteMissingToPof, ScMissingContext, AddMissing), but the source changed significantly with CWSs odff05 and frmdlg that got integrated to m39, which isn't ready yet. Adding that to a CWS based on m38 would clash upon integration and would had to be rewritten, so we'll have to wait for m39 getting ready.
Created attachment 59371 [details] Excel test case file
In cws calcperf03: revision 266841 formula/source/core/api/token.cxx sc/source/core/tool/interpr1.cxx Of course both, ODF11/PODF and ODF12/ODFF, file formats need the missing parameter replacement to be written so older releases can read it correctly.
Reassigning to QA for verification.
Reassigning I said..
verified in internal build cws_calcperf03
Issue 95450 has been fixed in master version OOo-dev 3.1 .0 (OOO310m9 Build:9396) for Windows XP and can be closed.
The Issue checked and closed by HitekSchool interns, Group 1 - as part of an Issue Hunting Party.