sc/inc/scfuncs.hrc                   |   12 ++++--------
 sc/source/core/data/funcdesc.cxx     |    4 ++--
 sc/source/core/tool/parclass.cxx     |    4 ++--
 sc/source/filter/excel/xlformula.cxx |    4 ++--
 sc/source/filter/oox/formulabase.cxx |    4 ++--
 5 files changed, 12 insertions(+), 16 deletions(-)

New commits:
commit 7a2fec66b5f2c527b79db312135e3691bb8b56ac
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Feb 11 16:44:36 2025 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Feb 11 20:57:44 2025 +0100

    tdf#165119: fix number of parameters in CHOOSECOLS/CHOOSEROWS
    
    Change-Id: I39fee81e0fc8aaa33265a3539bd4e6dff5d9d2e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181439
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/inc/scfuncs.hrc b/sc/inc/scfuncs.hrc
index ab93fde00834..8f9e795955b7 100644
--- a/sc/inc/scfuncs.hrc
+++ b/sc/inc/scfuncs.hrc
@@ -4257,10 +4257,8 @@ const TranslateId SC_OPCODE_CHOOSECOLS_ARY[] =
     NC_("SC_OPCODE_CHOOSECOLS", "Returns the specified columns from an 
array."),
     NC_("SC_OPCODE_CHOOSECOLS", "Array"),
     NC_("SC_OPCODE_CHOOSECOLS", "The array containing the columns to be 
returned in the new array."),
-    NC_("SC_OPCODE_CHOOSECOLS", "Column 1"),
-    NC_("SC_OPCODE_CHOOSECOLS", "The number of the first column to be 
returned."),
-    NC_("SC_OPCODE_CHOOSECOLS", "Column 2"),
-    NC_("SC_OPCODE_CHOOSECOLS", "Column 2, Column 3,... The list of column 
numbers to be returned.")
+    NC_("SC_OPCODE_CHOOSECOLS", "Column "),
+    NC_("SC_OPCODE_CHOOSECOLS", "Column 1, Column 2,... The list of column 
numbers to be returned.")
 };
 
 // -=*# Resource for function CHOOSEROWS #*=-
@@ -4269,10 +4267,8 @@ const TranslateId SC_OPCODE_CHOOSEROWS_ARY[] =
     NC_("SC_OPCODE_CHOOSEROWS", "Returns the specified rows from an array."),
     NC_("SC_OPCODE_CHOOSEROWS", "Array"),
     NC_("SC_OPCODE_CHOOSEROWS", "The array containing the rows to be returned 
in the new array."),
-    NC_("SC_OPCODE_CHOOSEROWS", "Row 1"),
-    NC_("SC_OPCODE_CHOOSEROWS", "The number of the first row to be returned."),
-    NC_("SC_OPCODE_CHOOSEROWS", "Row 2"),
-    NC_("SC_OPCODE_CHOOSEROWS", "Row 2, Row 3,... The list of row numbers to 
be returned.")
+    NC_("SC_OPCODE_CHOOSEROWS", "Row "),
+    NC_("SC_OPCODE_CHOOSEROWS", "Row 1, Row 2,... The list of row numbers to 
be returned.")
 };
 
 // -=*# Resource for function DROP #*=-
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index a916d380f651..a8eec7591813 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -793,8 +793,8 @@ ScFunctionList::ScFunctionList( bool bEnglishFunctionNames )
         { SC_OPCODE_SORTBY, ENTRY(SC_OPCODE_SORTBY_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_SORTBY_MS, PAIRED_VAR_ARGS + 1, { 0, 0, 1 }, 0 
},
         { SC_OPCODE_MAT_SEQUENCE, ENTRY(SC_OPCODE_MAT_SEQUENCE_ARY), 0, 
ID_FUNCTION_GRP_MATRIX, HID_FUNC_MSEQUENCE_MS, 4, { 0, 1, 1, 1 }, 0 },
         { SC_OPCODE_RANDARRAY, ENTRY(SC_OPCODE_RANDARRAY_ARY), 0, 
ID_FUNCTION_GRP_MATH, HID_FUNC_RANDARRAY_MS, 5, { 1, 1, 1, 1, 1 }, 0 },
-        { SC_OPCODE_CHOOSECOLS, ENTRY(SC_OPCODE_CHOOSECOLS_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_CHOOSECOLS_MS, VAR_ARGS + 2, { 0, 0, 1 }, 0 },
-        { SC_OPCODE_CHOOSEROWS, ENTRY(SC_OPCODE_CHOOSEROWS_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_CHOOSEROWS_MS, VAR_ARGS + 2, { 0, 0, 1 }, 0 },
+        { SC_OPCODE_CHOOSECOLS, ENTRY(SC_OPCODE_CHOOSECOLS_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_CHOOSECOLS_MS, VAR_ARGS + 1, { 0, 0 }, 0 },
+        { SC_OPCODE_CHOOSEROWS, ENTRY(SC_OPCODE_CHOOSEROWS_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_CHOOSEROWS_MS, VAR_ARGS + 1, { 0, 0 }, 0 },
         { SC_OPCODE_DROP, ENTRY(SC_OPCODE_DROP_ARY), 0, ID_FUNCTION_GRP_TABLE, 
HID_FUNC_DROP_MS, 3, { 0, 0, 1 }, 0 },
         { SC_OPCODE_EXPAND, ENTRY(SC_OPCODE_EXPAND_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_EXPAND_MS, 4, { 0, 0, 1, 1 }, 0 },
         { SC_OPCODE_HSTACK, ENTRY(SC_OPCODE_HSTACK_ARY), 0, 
ID_FUNCTION_GRP_TABLE, HID_FUNC_HSTACK_MS, VAR_ARGS + 1, { 0, 1 }, 0 },
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index e556817fec9d..204c9a943f7d 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -57,8 +57,8 @@ const ScParameterClassification::RawData 
ScParameterClassification::pRawData[] =
     { ocIfError,         {{ Array, Reference                                   
  }, 0, Value }},
     { ocIfNA,            {{ Array, Reference                                   
  }, 0, Value }},
     { ocChoose,          {{ Array, Reference                                   
  }, 1, Value }},
-    { ocChooseCols,      {{ ReferenceOrRefArray, ReferenceOrRefArray, 
ReferenceOrRefArray, }, 2, ForceArrayReturn }},
-    { ocChooseRows,      {{ ReferenceOrRefArray, ReferenceOrRefArray, 
ReferenceOrRefArray, }, 2, ForceArrayReturn }},
+    { ocChooseCols,      {{ ReferenceOrRefArray, ReferenceOrRefArray           
  }, 1, ForceArrayReturn }},
+    { ocChooseRows,      {{ ReferenceOrRefArray, ReferenceOrRefArray           
  }, 1, ForceArrayReturn }},
     { ocLet,             {{ Value, ReferenceOrRefArray, ReferenceOrRefArray, 
}, 2, ForceArrayReturn } },
     // Other specials.
     { ocArrayClose,      {{ Bounds                                             
  }, 0, Bounds }},
diff --git a/sc/source/filter/excel/xlformula.cxx 
b/sc/source/filter/excel/xlformula.cxx
index 871f48c2080e..cbb211b19cd0 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -619,8 +619,8 @@ const XclFunctionInfo saFuncTable_2021[] =
  */
 const XclFunctionInfo saFuncTable_2024[] =
 {
-    EXC_FUNCENTRY_V_VR(  ocChooseCols, 2,  MX, 0,  "CHOOSECOLS" ),
-    EXC_FUNCENTRY_V_VR(  ocChooseRows, 2,  MX, 0,  "CHOOSEROWS" ),
+    EXC_FUNCENTRY_V_VR(  ocChooseCols, 1,  MX, 0,  "CHOOSECOLS" ),
+    EXC_FUNCENTRY_V_VR(  ocChooseRows, 1,  MX, 0,  "CHOOSEROWS" ),
     EXC_FUNCENTRY_V_VR(  ocDrop,       1,  3,  0,  "DROP" ),
     EXC_FUNCENTRY_V_VR(  ocExpand,     2,  4,  0,  "EXPAND" ),
     EXC_FUNCENTRY_V_VR(  ocHStack,     1,  MX, 0,  "HSTACK" ),
diff --git a/sc/source/filter/oox/formulabase.cxx 
b/sc/source/filter/oox/formulabase.cxx
index 72934ef1cdce..d722b75a9837 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -894,8 +894,8 @@ const FunctionData saFuncTable2021[] =
 /* FIXME: BIFF?? function identifiers available? Where to obtain? */
 const FunctionData saFuncTable2024[] =
 {
-    { "COM.MICROSOFT.CHOOSECOLS",          "CHOOSECOLS",          NOID,   
NOID,   2,  MX, A, { VO }, FuncFlags::MACROCALL_NEW },
-    { "COM.MICROSOFT.CHOOSEROWS",          "CHOOSEROWS",          NOID,   
NOID,   2,  MX, A, { VO }, FuncFlags::MACROCALL_NEW },
+    { "COM.MICROSOFT.CHOOSECOLS",          "CHOOSECOLS",          NOID,   
NOID,   1,  MX, A, { VO }, FuncFlags::MACROCALL_NEW },
+    { "COM.MICROSOFT.CHOOSEROWS",          "CHOOSEROWS",          NOID,   
NOID,   1,  MX, A, { VO }, FuncFlags::MACROCALL_NEW },
     { "COM.MICROSOFT.DROP",                "DROP",                NOID,   
NOID,   1,  3,  A, { VO }, FuncFlags::MACROCALL_NEW },
     { "COM.MICROSOFT.EXPAND",              "EXPAND",              NOID,   
NOID,   2,  4,  A, { VO }, FuncFlags::MACROCALL_NEW },
     { "COM.MICROSOFT.HSTACK",              "HSTACK",              NOID,   
NOID,   1,  MX, A, { VO }, FuncFlags::MACROCALL_NEW },

Reply via email to