summaryrefslogtreecommitdiff
path: root/formula/inc
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@novell.com>2011-04-28 00:12:58 +0200
committerThorsten Behrens <tbehrens@novell.com>2011-04-28 00:12:58 +0200
commitf51c3f66b1034c9f15171678d1239c25d64341ba (patch)
tree438eb4b3d4da31d276dcb227da6afce76e165f00 /formula/inc
parentb8502c8251b0760f1bf03c968974f1fe3f288ae2 (diff)
parent86e7ed8c72184b7a04b836848743979aa3f5fd3d (diff)
Merge commit 'ooo/DEV300_m106' into integration/dev300_m106
Conflicts: avmedia/source/gstreamer/gstframegrabber.cxx avmedia/source/gstreamer/gstplayer.cxx avmedia/source/gstreamer/gstplayer.hxx basic/inc/basic/sbxdef.hxx basic/source/classes/sbxmod.cxx basic/source/comp/makefile.mk basic/source/comp/sbcomp.cxx basic/source/inc/namecont.hxx basic/source/inc/scriptcont.hxx basic/source/runtime/methods.cxx basic/source/runtime/runtime.cxx basic/source/runtime/stdobj.cxx basic/source/runtime/step1.cxx basic/source/uno/namecont.cxx basic/util/makefile.mk connectivity/source/commontools/predicateinput.cxx connectivity/source/drivers/dbase/DNoException.cxx connectivity/source/drivers/dbase/DTable.cxx connectivity/source/drivers/file/fcomp.cxx connectivity/source/drivers/jdbc/JConnection.cxx connectivity/source/drivers/odbcbase/OResultSet.cxx connectivity/source/drivers/odbcbase/OStatement.cxx connectivity/source/parse/sqlnode.cxx desktop/source/app/app.cxx drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx drawinglayer/source/processor2d/vclprocessor2d.cxx formula/inc/formula/token.hxx formula/source/core/api/token.cxx fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx fpicker/source/win32/filepicker/platform_vista.h framework/source/helper/persistentwindowstate.cxx framework/source/uielement/menubarmanager.cxx oovbaapi/ooo/vba/XFoundFiles.idl oovbaapi/ooo/vba/excel/XApplication.idl oovbaapi/ooo/vba/msforms/XCheckBox.idl oovbaapi/ooo/vba/msforms/XComboBox.idl oovbaapi/ooo/vba/msforms/XControl.idl oovbaapi/ooo/vba/msforms/XGroupBox.idl oovbaapi/ooo/vba/msforms/XLabel.idl oovbaapi/ooo/vba/msforms/XListBox.idl oovbaapi/ooo/vba/msforms/XNewFont.idl oovbaapi/ooo/vba/msforms/XRadioButton.idl oovbaapi/ooo/vba/msforms/XTextBox.idl oovbaapi/ooo/vba/msforms/XToggleButton.idl scripting/source/dlgprov/dlgevtatt.cxx sfx2/source/control/unoctitm.cxx sfx2/source/doc/objstor.cxx sfx2/source/doc/objxtor.cxx svx/inc/svx/svdograf.hxx svx/source/form/fmpage.cxx svx/source/form/fmpgeimp.cxx svx/source/svdraw/svdedtv.cxx svx/source/svdraw/svdfmtf.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdouno.cxx svx/source/xml/xmlgrhlp.cxx uui/source/iahndl-ssl.cxx vbahelper/Library_msforms.mk vbahelper/Library_vbahelper.mk vbahelper/inc/vbahelper/vbahelper.hxx vbahelper/prj/build.lst vbahelper/source/msforms/vbacombobox.cxx vbahelper/source/msforms/vbacontrol.cxx vbahelper/source/msforms/vbacontrols.cxx vbahelper/source/msforms/vbaframe.cxx vbahelper/source/msforms/vbaframe.hxx vbahelper/source/msforms/vbalabel.cxx vbahelper/source/msforms/vbalabel.hxx vbahelper/source/msforms/vbalistbox.cxx vbahelper/source/msforms/vbalistbox.hxx vbahelper/source/msforms/vbamultipage.cxx vbahelper/source/msforms/vbatogglebutton.cxx vbahelper/source/msforms/vbauserform.cxx vbahelper/source/vbahelper/vbacommandbar.cxx vbahelper/source/vbahelper/vbacommandbarcontrol.cxx vbahelper/source/vbahelper/vbacommandbarcontrols.hxx vbahelper/source/vbahelper/vbahelper.cxx vbahelper/source/vbahelper/vbawindowbase.cxx xmloff/source/meta/xmlmetai.cxx xmloff/source/style/PageMasterExportPropMapper.cxx xmloff/source/style/PageMasterStyleMap.cxx xmloff/source/text/txtexppr.cxx xmloff/source/text/txtprmap.cxx
Diffstat (limited to 'formula/inc')
-rwxr-xr-xformula/inc/formula/compiler.hrc126
-rw-r--r--formula/inc/formula/opcode.hxx4
-rw-r--r--formula/inc/formula/token.hxx20
-rw-r--r--formula/inc/formula/tokenarray.hxx4
4 files changed, 93 insertions, 61 deletions
diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc
index e4dc05aca4e9..5c58d9d3e068 100755
--- a/formula/inc/formula/compiler.hrc
+++ b/formula/inc/formula/compiler.hrc
@@ -130,67 +130,71 @@
#define SC_OPCODE_ARC_COS_HYP 95
#define SC_OPCODE_ARC_TAN_HYP 96
#define SC_OPCODE_ARC_COT_HYP 97
-#define SC_OPCODE_EXP 98
-#define SC_OPCODE_LN 99
-#define SC_OPCODE_SQRT 100
-#define SC_OPCODE_FACT 101
-#define SC_OPCODE_GET_YEAR 102 /* date and time */
-#define SC_OPCODE_GET_MONTH 103
-#define SC_OPCODE_GET_DAY 104
-#define SC_OPCODE_GET_HOUR 105
-#define SC_OPCODE_GET_MIN 106
-#define SC_OPCODE_GET_SEC 107
-#define SC_OPCODE_PLUS_MINUS 108 /* miscellaneous */
-#define SC_OPCODE_ABS 109
-#define SC_OPCODE_INT 110
-#define SC_OPCODE_PHI 111
-#define SC_OPCODE_GAUSS 112
-#define SC_OPCODE_IS_EMPTY 113 /* obtain type */
-#define SC_OPCODE_IS_STRING 114
-#define SC_OPCODE_IS_NON_STRING 115
-#define SC_OPCODE_IS_LOGICAL 116
-#define SC_OPCODE_TYPE 117
-#define SC_OPCODE_IS_REF 118
-#define SC_OPCODE_IS_VALUE 119
-#define SC_OPCODE_IS_FORMULA 120
-#define SC_OPCODE_IS_NV 121
-#define SC_OPCODE_IS_ERR 122
-#define SC_OPCODE_IS_ERROR 123
-#define SC_OPCODE_IS_EVEN 124
-#define SC_OPCODE_IS_ODD 125
-#define SC_OPCODE_N 126
-#define SC_OPCODE_GET_DATE_VALUE 127 /* string functions */
-#define SC_OPCODE_GET_TIME_VALUE 128
-#define SC_OPCODE_CODE 129
-#define SC_OPCODE_TRIM 130
-#define SC_OPCODE_UPPER 131
-#define SC_OPCODE_PROPPER 132
-#define SC_OPCODE_LOWER 133
-#define SC_OPCODE_LEN 134
-#define SC_OPCODE_T 135 /* miscellaneous, part 21 */
-#define SC_OPCODE_VALUE 136
-#define SC_OPCODE_CLEAN 137
-#define SC_OPCODE_CHAR 138
-#define SC_OPCODE_LOG10 139
-#define SC_OPCODE_EVEN 140
-#define SC_OPCODE_ODD 141
-#define SC_OPCODE_STD_NORM_DIST 142
-#define SC_OPCODE_FISHER 143
-#define SC_OPCODE_FISHER_INV 144
-#define SC_OPCODE_S_NORM_INV 145
-#define SC_OPCODE_GAMMA_LN 146
-#define SC_OPCODE_ERROR_TYPE 147
-#define SC_OPCODE_ERR_CELL 148
-#define SC_OPCODE_FORMULA 149
-#define SC_OPCODE_ARABIC 150
-#define SC_OPCODE_INFO 151
-#define SC_OPCODE_BAHTTEXT 152
-#define SC_OPCODE_JIS 153
-#define SC_OPCODE_ASC 154
-#define SC_OPCODE_UNICODE 155
-#define SC_OPCODE_UNICHAR 156
-#define SC_OPCODE_GAMMA 157
-#define SC_OPCODE_STOP_1_PAR 158
+#define SC_OPCODE_COSECANT 98
+#define SC_OPCODE_SECANT 99
+#define SC_OPCODE_COSECANT_HYP 100
+#define SC_OPCODE_SECANT_HYP 101
+#define SC_OPCODE_EXP 102
+#define SC_OPCODE_LN 103
+#define SC_OPCODE_SQRT 104
+#define SC_OPCODE_FACT 105
+#define SC_OPCODE_GET_YEAR 106 /* date and time */
+#define SC_OPCODE_GET_MONTH 107
+#define SC_OPCODE_GET_DAY 108
+#define SC_OPCODE_GET_HOUR 109
+#define SC_OPCODE_GET_MIN 110
+#define SC_OPCODE_GET_SEC 111
+#define SC_OPCODE_PLUS_MINUS 112 /* miscellaneous */
+#define SC_OPCODE_ABS 113
+#define SC_OPCODE_INT 114
+#define SC_OPCODE_PHI 115
+#define SC_OPCODE_GAUSS 116
+#define SC_OPCODE_IS_EMPTY 117 /* obtain type */
+#define SC_OPCODE_IS_STRING 118
+#define SC_OPCODE_IS_NON_STRING 119
+#define SC_OPCODE_IS_LOGICAL 120
+#define SC_OPCODE_TYPE 121
+#define SC_OPCODE_IS_REF 122
+#define SC_OPCODE_IS_VALUE 123
+#define SC_OPCODE_IS_FORMULA 124
+#define SC_OPCODE_IS_NV 125
+#define SC_OPCODE_IS_ERR 126
+#define SC_OPCODE_IS_ERROR 127
+#define SC_OPCODE_IS_EVEN 128
+#define SC_OPCODE_IS_ODD 129
+#define SC_OPCODE_N 130
+#define SC_OPCODE_GET_DATE_VALUE 131 /* string functions */
+#define SC_OPCODE_GET_TIME_VALUE 132
+#define SC_OPCODE_CODE 133
+#define SC_OPCODE_TRIM 134
+#define SC_OPCODE_UPPER 135
+#define SC_OPCODE_PROPPER 136
+#define SC_OPCODE_LOWER 137
+#define SC_OPCODE_LEN 138
+#define SC_OPCODE_T 139 /* miscellaneous, part 21 */
+#define SC_OPCODE_VALUE 140
+#define SC_OPCODE_CLEAN 141
+#define SC_OPCODE_CHAR 142
+#define SC_OPCODE_LOG10 143
+#define SC_OPCODE_EVEN 144
+#define SC_OPCODE_ODD 145
+#define SC_OPCODE_STD_NORM_DIST 146
+#define SC_OPCODE_FISHER 147
+#define SC_OPCODE_FISHER_INV 148
+#define SC_OPCODE_S_NORM_INV 149
+#define SC_OPCODE_GAMMA_LN 150
+#define SC_OPCODE_ERROR_TYPE 151
+#define SC_OPCODE_ERR_CELL 152
+#define SC_OPCODE_FORMULA 153
+#define SC_OPCODE_ARABIC 154
+#define SC_OPCODE_INFO 155
+#define SC_OPCODE_BAHTTEXT 156
+#define SC_OPCODE_JIS 157
+#define SC_OPCODE_ASC 158
+#define SC_OPCODE_UNICODE 159
+#define SC_OPCODE_UNICHAR 160
+#define SC_OPCODE_GAMMA 161
+#define SC_OPCODE_STOP_1_PAR 162
/*** Functions with more than one parameters ***/
#define SC_OPCODE_START_2_PAR 201
diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx
index 240f97401314..fc9a9b7cf525 100644
--- a/formula/inc/formula/opcode.hxx
+++ b/formula/inc/formula/opcode.hxx
@@ -122,6 +122,10 @@ enum OpCodeEnum
ocArcCosHyp = SC_OPCODE_ARC_COS_HYP,
ocArcTanHyp = SC_OPCODE_ARC_TAN_HYP,
ocArcCotHyp = SC_OPCODE_ARC_COT_HYP,
+ ocCosecant = SC_OPCODE_COSECANT,
+ ocSecant = SC_OPCODE_SECANT,
+ ocCosecantHyp = SC_OPCODE_COSECANT_HYP,
+ ocSecantHyp = SC_OPCODE_SECANT_HYP,
ocExp = SC_OPCODE_EXP,
ocLn = SC_OPCODE_LN,
ocSqrt = SC_OPCODE_SQRT,
diff --git a/formula/inc/formula/token.hxx b/formula/inc/formula/token.hxx
index b47147d833e8..bc6cfc2c2793 100644
--- a/formula/inc/formula/token.hxx
+++ b/formula/inc/formula/token.hxx
@@ -70,6 +70,7 @@ enum StackVarEnum
svExternalSingleRef,
svExternalDoubleRef,
svExternalName,
+ svSubroutine, // A token with a subroutine token array.
svError, // error token
svMissing = 0x70, // 0 or ""
svSep, // separator, ocSep, ocOpen, ocClose
@@ -89,6 +90,8 @@ class FormulaToken;
typedef ::boost::intrusive_ptr<FormulaToken> FormulaTokenRef;
typedef ::boost::intrusive_ptr<const FormulaToken> FormulaConstTokenRef;
+class FormulaTokenArray;
+
class FORMULA_DLLPUBLIC FormulaToken : public IFormulaToken
{
OpCode eOp;
@@ -374,6 +377,23 @@ public:
};
+class FORMULA_DLLPUBLIC FormulaSubroutineToken : public FormulaToken
+{
+public:
+ /** Takes ownership of pArray and deletes it upon destruction! */
+ FormulaSubroutineToken( const FormulaTokenArray* pArray ) :
+ FormulaToken( svSubroutine, ocCall ), mpArray( pArray) {}
+ FormulaSubroutineToken( const FormulaSubroutineToken& r );
+ virtual ~FormulaSubroutineToken();
+ virtual FormulaToken* Clone() const { return new FormulaSubroutineToken(*this); }
+ virtual bool operator==( const FormulaToken& rToken ) const;
+ const FormulaTokenArray* GetTokenArray() const;
+
+private:
+ const FormulaTokenArray* mpArray;
+};
+
+
class FORMULA_DLLPUBLIC FormulaUnknownToken : public FormulaToken
{
public:
diff --git a/formula/inc/formula/tokenarray.hxx b/formula/inc/formula/tokenarray.hxx
index 626c958471ad..8ec6a56f9f0f 100644
--- a/formula/inc/formula/tokenarray.hxx
+++ b/formula/inc/formula/tokenarray.hxx
@@ -259,6 +259,7 @@ public:
void Reset();
const FormulaToken* First();
const FormulaToken* Next();
+ const FormulaToken* PeekNextOperator();
bool IsEndOfPath() const; /// if a jump or subroutine path is done
bool HasStacked() const { return pCur->pNext != 0; }
short GetPC() const { return pCur->nPC; }
@@ -279,6 +280,9 @@ public:
void Jump( short nStart, short nNext, short nStop = SHRT_MAX );
void Push( const FormulaTokenArray* );
void Pop();
+
+private:
+ const FormulaToken* GetNonEndOfPathToken( short nIdx ) const;
};
// =============================================================================
} // formula