summaryrefslogtreecommitdiff
path: root/include/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-04-27 23:12:42 +0200
committerEike Rathke <erack@redhat.com>2020-04-28 11:26:38 +0200
commit716655820d69a0d6aaa2714cb4f12bae1aa2b862 (patch)
treef4241181eefab18c2217d056197f7d93c50ad410 /include/formula
parenta02d059d3ef03246c226fa9fc499920f7bd4ffc8 (diff)
Resolves: tdf#127831 implement RAND.NV() and RANDBETWEEN.NV() non-volatile
Same as RAND() and RANDBETWEEN() but not recalculating on every change, just the normal expression recalculation. Change-Id: I8ba7099125e487a78bd3d91db8b666c2f36b22fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92994 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include/formula')
-rw-r--r--include/formula/compiler.hxx6
-rw-r--r--include/formula/opcode.hxx4
2 files changed, 8 insertions, 2 deletions
diff --git a/include/formula/compiler.hxx b/include/formula/compiler.hxx
index c5e5cfdf0da2..baf3e23f6161 100644
--- a/include/formula/compiler.hxx
+++ b/include/formula/compiler.hxx
@@ -112,7 +112,8 @@
#define SC_OPCODE_GET_ACT_TIME 80
#define SC_OPCODE_NO_VALUE 81
#define SC_OPCODE_CURRENT 82
-#define SC_OPCODE_STOP_NO_PAR 83
+#define SC_OPCODE_RANDOM_NV 83
+#define SC_OPCODE_STOP_NO_PAR 84
/*** Functions with one parameter ***/
#define SC_OPCODE_START_1_PAR 90
@@ -507,7 +508,8 @@
#define SC_OPCODE_SEARCHB 496
#define SC_OPCODE_REGEX 497
#define SC_OPCODE_FOURIER 498
-#define SC_OPCODE_STOP_2_PAR 499 /* last function with two or more parameters' OpCode + 1 */
+#define SC_OPCODE_RANDBETWEEN_NV 499
+#define SC_OPCODE_STOP_2_PAR 500 /* last function with two or more parameters' OpCode + 1 */
#define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */
#define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index b969a0047007..3123e8f3fa38 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -106,6 +106,7 @@ enum OpCode : sal_uInt16
ocGetActTime = SC_OPCODE_GET_ACT_TIME,
ocNotAvail = SC_OPCODE_NO_VALUE,
ocCurrent = SC_OPCODE_CURRENT,
+ ocRandomNV = SC_OPCODE_RANDOM_NV,
// Functions with one parameter
ocNot = SC_OPCODE_NOT,
ocNeg = SC_OPCODE_NEG,
@@ -501,6 +502,7 @@ enum OpCode : sal_uInt16
ocErfc_MS = SC_OPCODE_ERFC_MS,
ocEncodeURL = SC_OPCODE_ENCODEURL,
ocFourier = SC_OPCODE_FOURIER,
+ ocRandbetweenNV = SC_OPCODE_RANDBETWEEN_NV,
// internal stuff
ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN,
ocTTT = SC_OPCODE_TTT,
@@ -586,6 +588,7 @@ inline std::string OpCodeEnumToString(OpCode eCode)
case ocNegSub: return "NegSub";
case ocPi: return "Pi";
case ocRandom: return "Random";
+ case ocRandomNV: return "RandomNV";
case ocTrue: return "True";
case ocFalse: return "False";
case ocGetActDate: return "GetActDate";
@@ -974,6 +977,7 @@ inline std::string OpCodeEnumToString(OpCode eCode)
case ocErfc_MS: return "Erfc_MS";
case ocEncodeURL: return "EncodeURL";
case ocFourier: return "Fourier";
+ case ocRandbetweenNV: return "RandbetweenNV";
case ocTTT: return "TTT";
case ocDebugVar: return "DebugVar";
case ocDataToken1: return "DataToken1";