Skip to content

Commit 9c35a59

Browse files
author
Xisco Fauli
committed
tdf#150867: Add support for VSTACK function
Change-Id: I76e3267f45a0d035f6a79af934b9ce2c606b4b89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181120 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins
1 parent 094e26c commit 9c35a59

File tree

18 files changed

+5418
-17
lines changed

18 files changed

+5418
-17
lines changed

formula/inc/core_resource.hrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ const std::pair<const char *, int> RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF[] =
286286
{ "COM.MICROSOFT.DROP" , SC_OPCODE_DROP },
287287
{ "COM.MICROSOFT.EXPAND" , SC_OPCODE_EXPAND },
288288
{ "COM.MICROSOFT.HSTACK" , SC_OPCODE_HSTACK },
289+
{ "COM.MICROSOFT.VSTACK" , SC_OPCODE_VSTACK },
289290
{ "COM.MICROSOFT.TAKE" , SC_OPCODE_TAKE },
290291
{ "COM.MICROSOFT.TOCOL" , SC_OPCODE_TOCOL },
291292
{ "COM.MICROSOFT.TOROW" , SC_OPCODE_TOROW },
@@ -753,6 +754,7 @@ const std::pair<const char *, int> RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML[] =
753754
{ "_xlfn.DROP" , SC_OPCODE_DROP },
754755
{ "_xlfn.EXPAND" , SC_OPCODE_EXPAND },
755756
{ "_xlfn.HSTACK" , SC_OPCODE_HSTACK },
757+
{ "_xlfn.VSTACK" , SC_OPCODE_VSTACK },
756758
{ "_xlfn.TAKE" , SC_OPCODE_TAKE },
757759
{ "_xlfn.TOCOL" , SC_OPCODE_TOCOL },
758760
{ "_xlfn.TOROW" , SC_OPCODE_TOROW },
@@ -1223,6 +1225,7 @@ const std::pair<const char *, int> RID_STRLIST_FUNCTION_NAMES_ENGLISH_PODF[] =
12231225
{ "DROP" , SC_OPCODE_DROP },
12241226
{ "EXPAND" , SC_OPCODE_EXPAND },
12251227
{ "HSTACK" , SC_OPCODE_HSTACK },
1228+
{ "VSTACK" , SC_OPCODE_VSTACK },
12261229
{ "TAKE" , SC_OPCODE_TAKE },
12271230
{ "TOCOL" , SC_OPCODE_TOCOL },
12281231
{ "TOROW" , SC_OPCODE_TOROW },
@@ -1693,6 +1696,7 @@ const std::pair<const char *, int> RID_STRLIST_FUNCTION_NAMES_ENGLISH_API[] =
16931696
{ "DROP" , SC_OPCODE_DROP },
16941697
{ "EXPAND" , SC_OPCODE_EXPAND },
16951698
{ "HSTACK" , SC_OPCODE_HSTACK },
1699+
{ "VSTACK" , SC_OPCODE_VSTACK },
16961700
{ "TAKE" , SC_OPCODE_TAKE },
16971701
{ "TOCOL" , SC_OPCODE_TOCOL },
16981702
{ "TOROW" , SC_OPCODE_TOROW },
@@ -2161,6 +2165,7 @@ const std::pair<const char *, int> RID_STRLIST_FUNCTION_NAMES_ENGLISH[] =
21612165
{ "DROP" , SC_OPCODE_DROP },
21622166
{ "EXPAND" , SC_OPCODE_EXPAND },
21632167
{ "HSTACK" , SC_OPCODE_HSTACK },
2168+
{ "VSTACK" , SC_OPCODE_VSTACK },
21642169
{ "TAKE" , SC_OPCODE_TAKE },
21652170
{ "TOCOL" , SC_OPCODE_TOCOL },
21662171
{ "TOROW" , SC_OPCODE_TOROW },
@@ -2610,6 +2615,7 @@ const std::pair<TranslateId, int> RID_STRLIST_FUNCTION_NAMES[] =
26102615
{ NC_("RID_STRLIST_FUNCTION_NAMES", "DROP") , SC_OPCODE_DROP },
26112616
{ NC_("RID_STRLIST_FUNCTION_NAMES", "EXPAND") , SC_OPCODE_EXPAND },
26122617
{ NC_("RID_STRLIST_FUNCTION_NAMES", "HSTACK") , SC_OPCODE_HSTACK },
2618+
{ NC_("RID_STRLIST_FUNCTION_NAMES", "VSTACK") , SC_OPCODE_VSTACK },
26132619
{ NC_("RID_STRLIST_FUNCTION_NAMES", "TAKE") , SC_OPCODE_TAKE },
26142620
{ NC_("RID_STRLIST_FUNCTION_NAMES", "TOCOL") , SC_OPCODE_TOCOL },
26152621
{ NC_("RID_STRLIST_FUNCTION_NAMES", "TOROW") , SC_OPCODE_TOROW },

formula/source/core/api/FormulaCompiler.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ bool FormulaCompiler::IsMatrixFunction( OpCode eOpCode )
12841284
case ocDrop :
12851285
case ocExpand :
12861286
case ocHStack :
1287+
case ocVStack :
12871288
case ocTake :
12881289
case ocToCol :
12891290
case ocToRow :

include/formula/compiler.hxx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,14 @@
522522
#define SC_OPCODE_DROP 507
523523
#define SC_OPCODE_EXPAND 508
524524
#define SC_OPCODE_HSTACK 509
525-
#define SC_OPCODE_TAKE 510
526-
#define SC_OPCODE_TOCOL 511
527-
#define SC_OPCODE_TOROW 512
528-
#define SC_OPCODE_UNIQUE 513
529-
#define SC_OPCODE_WRAPCOLS 514
530-
#define SC_OPCODE_WRAPROWS 515
531-
#define SC_OPCODE_STOP_2_PAR 516 /* last function with two or more parameters' OpCode + 1 */
525+
#define SC_OPCODE_VSTACK 510
526+
#define SC_OPCODE_TAKE 511
527+
#define SC_OPCODE_TOCOL 512
528+
#define SC_OPCODE_TOROW 513
529+
#define SC_OPCODE_UNIQUE 514
530+
#define SC_OPCODE_WRAPCOLS 515
531+
#define SC_OPCODE_WRAPROWS 516
532+
#define SC_OPCODE_STOP_2_PAR 517 /* last function with two or more parameters' OpCode + 1 */
532533

533534
#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */
534535
#define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */

include/formula/opcode.hxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ enum OpCode : sal_uInt16
518518
ocDrop = SC_OPCODE_DROP,
519519
ocExpand = SC_OPCODE_EXPAND,
520520
ocHStack = SC_OPCODE_HSTACK,
521+
ocVStack = SC_OPCODE_VSTACK,
521522
ocTake = SC_OPCODE_TAKE,
522523
ocToCol = SC_OPCODE_TOCOL,
523524
ocToRow = SC_OPCODE_TOROW,
@@ -1013,6 +1014,7 @@ inline std::string OpCodeEnumToString(OpCode eCode)
10131014
case ocDrop: return "Drop";
10141015
case ocExpand: return "Expand";
10151016
case ocHStack: return "HStack";
1017+
case ocVStack: return "VStack";
10161018
case ocTake: return "Take";
10171019
case ocToCol: return "ToCol";
10181020
case ocToRow: return "ToRow";

sc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocume
6060
* DROP
6161
* EXPAND
6262
* HSTACK
63+
* VSTACK
6364
* TAKE
6465
* TOCOL
6566
* TOROW

sc/inc/helpids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ inline constexpr OUString HID_FUNC_CHOOSEROWS_MS = u"SC_HID_FUNC_CHOOSEROWS_MS"_
605605
inline constexpr OUString HID_FUNC_DROP_MS = u"SC_HID_FUNC_DROP_MS"_ustr;
606606
inline constexpr OUString HID_FUNC_EXPAND_MS = u"SC_HID_FUNC_EXPAND_MS"_ustr;
607607
inline constexpr OUString HID_FUNC_HSTACK_MS = u"SC_HID_FUNC_HSTACK_MS"_ustr;
608+
inline constexpr OUString HID_FUNC_VSTACK_MS = u"SC_HID_FUNC_VSTACK_MS"_ustr;
608609
inline constexpr OUString HID_FUNC_TAKE_MS = u"SC_HID_FUNC_TAKE_MS"_ustr;
609610
inline constexpr OUString HID_FUNC_TOCOL_MS = u"SC_HID_FUNC_TOCOL_MS"_ustr;
610611
inline constexpr OUString HID_FUNC_TOROW_MS = u"SC_HID_FUNC_TOROW_MS"_ustr;

sc/inc/scfuncs.hrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,16 @@ const TranslateId SC_OPCODE_HSTACK_ARY[] =
43114311
NC_("SC_OPCODE_HSTACK", "Array 2, Array 3,... The following arrays to append. if an array has fewer rows, #N/A error will be returned in the additional rows."),
43124312
};
43134313

4314+
// -=*# Resource for function VSTACK #*=-
4315+
const TranslateId SC_OPCODE_VSTACK_ARY[] =
4316+
{
4317+
NC_("SC_OPCODE_VSTACK", "Appends arrays vertically to create a larger array"),
4318+
NC_("SC_OPCODE_VSTACK", "Array"),
4319+
NC_("SC_OPCODE_VSTACK", "The first array to append."),
4320+
NC_("SC_OPCODE_VSTACK", "Array 2"),
4321+
NC_("SC_OPCODE_VSTACK", "Array 2, Array 3,... The following arrays to append. if an array has fewer columns, #N/A error will be returned in the additional columns."),
4322+
};
4323+
43144324
// -=*# Resource for function TAKE #*=-
43154325
const TranslateId SC_OPCODE_TAKE_ARY[] =
43164326
{

sc/qa/extras/scfunctionlistobj.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class ScFunctionListObj : public UnoApiTest,
7777
ScFunctionListObj::ScFunctionListObj()
7878
: UnoApiTest(u"/sc/qa/extras/testdocuments"_ustr)
7979
, XElementAccess(cppu::UnoType<uno::Sequence<beans::PropertyValue>>::get())
80-
, XIndexAccess(414)
80+
, XIndexAccess(415)
8181
, XNameAccess(u"IF"_ustr)
8282
, XServiceInfo(u"stardiv.StarCalc.ScFunctionListObj"_ustr,
8383
u"com.sun.star.sheet.FunctionDescriptions"_ustr)

0 commit comments

Comments
 (0)