[PATCH] new BITxxx_functions

Wolfgang Pechlaner libo at pechlaner.at
Sat Sep 3 16:19:54 PDT 2011


---
 formula/inc/formula/compiler.hrc               |   10 +++++--
 formula/inc/formula/opcode.hxx                 |    6 ++++
 formula/source/core/resource/core_resource.src |   32 ++++++++++++++++++++++-
 3 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc
index e071b3a..5b770f2 100755
--- a/formula/inc/formula/compiler.hrc
+++ b/formula/inc/formula/compiler.hrc
@@ -392,9 +392,13 @@
 #define SC_OPCODE_NUMBERVALUE       392
 #define SC_OPCODE_CHISQ_DIST        393
 #define SC_OPCODE_CHISQ_INV         394
-#define SC_OPCODE_STOP_2_PAR        395
-
-#define SC_OPCODE_LAST_OPCODE_ID    394      /* last OpCode */
+#define SC_OPCODE_BITAND            395
+#define SC_OPCODE_BITOR             396
+#define SC_OPCODE_BITXOR            397
+#define SC_OPCODE_BITRSHIFT         398
+#define SC_OPCODE_BITLSHIFT         399
+#define SC_OPCODE_STOP_2_PAR        400
+#define SC_OPCODE_LAST_OPCODE_ID    399     /* last OpCode */
 
 /*** Interna ***/
 #define SC_OPCODE_INTERNAL_BEGIN   9999
diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx
index 068e99d..c6b92d1 100644
--- a/formula/inc/formula/opcode.hxx
+++ b/formula/inc/formula/opcode.hxx
@@ -389,6 +389,12 @@ enum OpCodeEnum
         ocGetPivotData      = SC_OPCODE_GET_PIVOT_DATA,
         ocEuroConvert       = SC_OPCODE_EUROCONVERT,
         ocNumberValue		= SC_OPCODE_NUMBERVALUE,
+    // logical functions
+        ocBitAnd            = SC_OPCODE_BITAND,
+        ocBitOr             = SC_OPCODE_BITOR,
+        ocBitXor            = SC_OPCODE_BITXOR,
+        ocBitRshift         = SC_OPCODE_BITRSHIFT,
+        ocBitLshift         = SC_OPCODE_BITLSHIFT,
     // internal stuff
         ocInternalBegin		= SC_OPCODE_INTERNAL_BEGIN,
         ocTTT				= SC_OPCODE_TTT,
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index 1724ea4..9b03294 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -344,7 +344,11 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_GAMMA { Text = "GAMMA" ; };
     String SC_OPCODE_CHISQ_DIST { Text = "CHISQDIST" ; };
     String SC_OPCODE_CHISQ_INV { Text = "CHISQINV" ;};
-
+    String SC_OPCODE_BITAND        { Text = "BITAND" ;};
+    String SC_OPCODE_BITOR         { Text = "BITOR" ;};
+    String SC_OPCODE_BITXOR        { Text = "BITXOR" ;};
+    String SC_OPCODE_BITRSHIFT     { Text = "BITRSHIFT" ;};
+    String SC_OPCODE_BITLSHIFT     { Text = "BITLSHIFT" ;};
     /* BEGIN defined ERROR.TYPE() values. */
     String SC_OPCODE_ERROR_NULL    { Text = "#NULL!"  ; };
     String SC_OPCODE_ERROR_DIVZERO { Text = "#DIV/0!" ; };
@@ -672,7 +676,11 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_GAMMA { Text = "GAMMA" ; };
     String SC_OPCODE_CHISQ_DIST { Text = "CHISQDIST" ; };
     String SC_OPCODE_CHISQ_INV { Text = "CHISQINV" ;};
-
+    String SC_OPCODE_BITAND    { Text = "BITAND" ;};
+    String SC_OPCODE_BITOR    { Text = "BITOR" ;};
+    String SC_OPCODE_BITXOR    { Text = "BITXOR" ;};
+    String SC_OPCODE_BITRSHIFT    { Text = "BITRSHIFT" ;};
+    String SC_OPCODE_BITLSHIFT    { Text = "BITLSHIFT" ;};
     /* BEGIN defined ERROR.TYPE() values. */
     String SC_OPCODE_ERROR_NULL    { Text = "#NULL!"  ; };
     String SC_OPCODE_ERROR_DIVZERO { Text = "#DIV/0!" ; };
@@ -1860,6 +1868,26 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "CHISQINV" ;
     };
+    String SC_OPCODE_BITAND
+    {
+        Text [ en-US ] = "BITAND" ;
+    };
+    String SC_OPCODE_BITOR
+    {
+        Text [ en-US ] = "BITOR" ;
+    };
+    String SC_OPCODE_BITXOR
+    {
+        Text [ en-US ] = "BITXOR" ;
+    };
+    String SC_OPCODE_BITRSHIFT
+    {
+        Text [ en-US ] = "BITRSHIFT" ;
+    };
+    String SC_OPCODE_BITLSHIFT
+    {
+        Text [ en-US ] = "BITLSHIFT" ;
+    };
     /* BEGIN defined ERROR.TYPE() values. */
     /* ERROR.TYPE( #NULL! ) == 1 */
     String SC_OPCODE_ERROR_NULL
-- 
1.7.3.4


--------------050009030706080009000901--


More information about the LibreOffice mailing list