formula/source/core/api/token.cxx | 7 formula/source/core/resource/core_resource.src | 6 include/formula/compiler.hrc | 270 ++++++++++++------------- include/formula/opcode.hxx | 2 sc/source/core/tool/compiler.cxx | 93 +++++++- sc/source/core/tool/token.cxx | 2 6 files changed, 227 insertions(+), 153 deletions(-)
New commits: commit f965b10819fb32d6c6d66f00fb129068749a50ac Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 20:30:23 2015 +0100 ScCompiler::HandleTableRef() implement ALL case In general it should work like this.. Change-Id: Ic45ca6138c1b252ce9d216ce61c7129c055342ef diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 053af69..6469918 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4645,19 +4645,38 @@ bool ScCompiler::HandleDbData() bool ScCompiler::HandleTableRef() { - ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex(mpToken->GetIndex()); + ScTableRefToken* pTR = dynamic_cast<ScTableRefToken*>(mpToken.get()); + if (!pTR) + { + SetError(errUnknownToken); + return true; + } + + ScDBData* pDBData = pDoc->GetDBCollection()->getNamedDBs().findByIndex( pTR->GetIndex()); if ( !pDBData ) SetError(errNoName); else if (mbJumpCommandReorder) { - /* TODO: handle it */ -#if 0 + ScRange aRange; + pDBData->GetArea(aRange); + aRange.aEnd.SetTab(aRange.aStart.Tab()); ScTokenArray* pNew = new ScTokenArray(); - pNew->AddDoubleReference( aRefData ); + ScTableRefToken::Item eItem = pTR->GetItem(); + if (eItem == ScTableRefToken::ALL) + { + ScComplexRefData aRefData; + aRefData.InitFlags(); + aRefData.SetRange(aRange, aPos); + pNew->AddDoubleReference( aRefData ); + } + else + { + /* TODO: implement all other cases. */ + SetError(errUnknownToken); + } PushTokenArray( pNew, true ); pNew->Reset(); return GetToken(); -#endif } return true; } commit cca2f93eeda560203ac31f44eaf5b5998762afab Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 19:09:40 2015 +0100 don't count table ref item separator as parameter separator ... similar to ocArrayOpen,ocArrayClose Change-Id: I10b4cd2f74167cc57ef7a2ed96e0e98f0cd86805 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 5d6ba70..053af69 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3847,6 +3847,23 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula ) if (bUseFunctionStack && nFunction) --nFunction; } + case ocTableRefOpen: + { + // Don't count following item separator as parameter separator. + if (bUseFunctionStack) + { + ++nFunction; + pFunctionStack[ nFunction ].eOp = eOp; + pFunctionStack[ nFunction ].nSep = 0; + } + } + break; + case ocTableRefClose: + { + if (bUseFunctionStack && nFunction) + --nFunction; + } + break; default: break; } commit 3b76732e89715ce77b2619230e36f8289958acff Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 18:39:43 2015 +0100 ocTableRefOpen,ocTableRefClose are of StackVarType svSep Change-Id: Icfbf088ee8d91d90779dc804b7dff299df1170a4 diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b38c370..55a0601 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -168,6 +168,8 @@ void ScRawToken::SetOpCode( OpCode e ) case ocArrayColSep: case ocArrayOpen: case ocArrayClose: + case ocTableRefOpen: + case ocTableRefClose: eType = svSep; break; default: commit ce20a967a781a721276b7a96c8a052656ebb6275 Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 16:38:20 2015 +0100 add '[' and ']' to conventions' char flags where appropriate Change-Id: Ic82ccfcba08ce276eac08609de215ba8edf8e813 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 6bdf70a..5d6ba70 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -353,12 +353,48 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv ) /* \ */ // FREE /* ] */ t[93] = SC_COMPILER_C_ODF_RBRACKET; } + else if (FormulaGrammar::CONV_OOO == meConv) + { +/* [ */ t[91] = SC_COMPILER_C_CHAR; +/* \ */ // FREE +/* ] */ t[93] = SC_COMPILER_C_CHAR; + } + else if (FormulaGrammar::CONV_XL_OOX == meConv) + { +#if 1 + /* TODO: currently SC_COMPILER_C_CHAR doesn't work as long as the + * table references aren't implemented. */ +/* [ */ t[91] = SC_COMPILER_C_CHAR_IDENT; +/* \ */ // FREE +/* ] */ t[93] = SC_COMPILER_C_IDENT; +#else + /* TODO: check if SC_COMPILER_C_CHAR_IDENT and SC_COMPILER_C_IDENT + * were only added to be able to import table structured + * reference of a whole table. If so, then remove here. */ +/* [ */ t[91] = SC_COMPILER_C_CHAR | SC_COMPILER_C_CHAR_IDENT; +/* \ */ // FREE +/* ] */ t[93] = SC_COMPILER_C_CHAR | SC_COMPILER_C_IDENT; +#endif + } + else if (FormulaGrammar::CONV_XL_A1 == meConv) + { +/* [ */ t[91] = SC_COMPILER_C_CHAR; +/* \ */ // FREE +/* ] */ t[93] = SC_COMPILER_C_CHAR; + } + else if( FormulaGrammar::CONV_XL_R1C1 == meConv ) + { +/* [ */ t[91] = SC_COMPILER_C_IDENT; +/* \ */ // FREE +/* ] */ t[93] = SC_COMPILER_C_IDENT; + } else { /* [ */ // FREE /* \ */ // FREE /* ] */ // FREE } + /* ^ */ t[94] = SC_COMPILER_C_CHAR | SC_COMPILER_C_WORD_SEP | SC_COMPILER_C_VALUE_SEP; /* _ */ t[95] = SC_COMPILER_C_CHAR_WORD | SC_COMPILER_C_WORD | SC_COMPILER_C_CHAR_IDENT | SC_COMPILER_C_IDENT | SC_COMPILER_C_CHAR_NAME | SC_COMPILER_C_NAME; /* ` */ // FREE @@ -408,17 +444,6 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv ) /* | */ t[124]|= SC_COMPILER_C_WORD; /* } */ t[125]|= SC_COMPILER_C_WORD; /* ~ */ t[126]|= SC_COMPILER_C_WORD; - - if( FormulaGrammar::CONV_XL_R1C1 == meConv ) - { -/* [ */ t[91] |= SC_COMPILER_C_IDENT; -/* ] */ t[93] |= SC_COMPILER_C_IDENT; - } - if( FormulaGrammar::CONV_XL_OOX == meConv ) - { -/* [ */ t[91] |= SC_COMPILER_C_CHAR_IDENT; -/* ] */ t[93] |= SC_COMPILER_C_IDENT; - } } } commit e73c0f53870eb7fd0e2d054be9c85a33baeed1ab Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 14:28:11 2015 +0100 introduce ocTableRefOpen,ocTableRefClose Change-Id: Ia9d54fd582f8e195edaa05937ee0f0290e56875f diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src index 483a5d2..0fd104f 100644 --- a/formula/source/core/resource/core_resource.src +++ b/formula/source/core/resource/core_resource.src @@ -439,6 +439,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML String SC_OPCODE_CHOOSE { Text = "CHOOSE" ; }; String SC_OPCODE_OPEN { Text = "(" ; }; String SC_OPCODE_CLOSE { Text = ")" ; }; + String SC_OPCODE_TABLE_REF_OPEN { Text = "[" ; }; + String SC_OPCODE_TABLE_REF_CLOSE { Text = "]" ; }; String SC_OPCODE_ARRAY_OPEN { Text = "{" ; }; String SC_OPCODE_ARRAY_CLOSE { Text = "}" ; }; String SC_OPCODE_ARRAY_ROW_SEP { Text = ";" ; }; @@ -850,6 +852,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH String SC_OPCODE_CHOOSE { Text = "CHOOSE" ; }; String SC_OPCODE_OPEN { Text = "(" ; }; String SC_OPCODE_CLOSE { Text = ")" ; }; + String SC_OPCODE_TABLE_REF_OPEN { Text = "[" ; }; + String SC_OPCODE_TABLE_REF_CLOSE { Text = "]" ; }; String SC_OPCODE_ARRAY_OPEN { Text = "{" ; }; String SC_OPCODE_ARRAY_CLOSE { Text = "}" ; }; String SC_OPCODE_ARRAY_ROW_SEP { Text = "|" ; }; @@ -1270,6 +1274,8 @@ Resource RID_STRLIST_FUNCTION_NAMES }; String SC_OPCODE_OPEN { Text = "(" ; }; String SC_OPCODE_CLOSE { Text = ")" ; }; + String SC_OPCODE_TABLE_REF_OPEN { Text = "[" ; }; + String SC_OPCODE_TABLE_REF_CLOSE { Text = "]" ; }; String SC_OPCODE_ARRAY_OPEN { Text = "{" ; }; String SC_OPCODE_ARRAY_CLOSE { Text = "}" ; }; String SC_OPCODE_ARRAY_ROW_SEP { Text = "|" ; }; diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc index ba31646..9131ce0 100644 --- a/include/formula/compiler.hrc +++ b/include/formula/compiler.hrc @@ -51,153 +51,155 @@ #define SC_OPCODE_ARRAY_CLOSE 25 #define SC_OPCODE_ARRAY_ROW_SEP 26 #define SC_OPCODE_ARRAY_COL_SEP 27 /* some convs use sep != col_sep */ -#define SC_OPCODE_STOP_DIV 28 -#define SC_OPCODE_SKIP 29 /* used to skip raw tokens during string compilation */ +#define SC_OPCODE_TABLE_REF_OPEN 28 +#define SC_OPCODE_TABLE_REF_CLOSE 29 +#define SC_OPCODE_STOP_DIV 30 +#define SC_OPCODE_SKIP 31 /* used to skip raw tokens during string compilation */ /*** error constants #... ***/ -#define SC_OPCODE_START_ERRORS 30 -#define SC_OPCODE_ERROR_NULL 30 -#define SC_OPCODE_ERROR_DIVZERO 31 -#define SC_OPCODE_ERROR_VALUE 32 -#define SC_OPCODE_ERROR_REF 33 -#define SC_OPCODE_ERROR_NAME 34 -#define SC_OPCODE_ERROR_NUM 35 -#define SC_OPCODE_ERROR_NA 36 -#define SC_OPCODE_STOP_ERRORS 37 +#define SC_OPCODE_START_ERRORS 40 +#define SC_OPCODE_ERROR_NULL 40 +#define SC_OPCODE_ERROR_DIVZERO 41 +#define SC_OPCODE_ERROR_VALUE 42 +#define SC_OPCODE_ERROR_REF 43 +#define SC_OPCODE_ERROR_NAME 44 +#define SC_OPCODE_ERROR_NUM 45 +#define SC_OPCODE_ERROR_NA 46 +#define SC_OPCODE_STOP_ERRORS 47 /*** Binary operators ***/ -#define SC_OPCODE_START_BIN_OP 40 -#define SC_OPCODE_ADD 40 -#define SC_OPCODE_SUB 41 -#define SC_OPCODE_MUL 42 -#define SC_OPCODE_DIV 43 -#define SC_OPCODE_AMPERSAND 44 -#define SC_OPCODE_POW 45 -#define SC_OPCODE_EQUAL 46 -#define SC_OPCODE_NOT_EQUAL 47 -#define SC_OPCODE_LESS 48 -#define SC_OPCODE_GREATER 49 -#define SC_OPCODE_LESS_EQUAL 50 -#define SC_OPCODE_GREATER_EQUAL 51 -#define SC_OPCODE_AND 52 -#define SC_OPCODE_OR 53 -#define SC_OPCODE_INTERSECT 54 -#define SC_OPCODE_UNION 55 -#define SC_OPCODE_RANGE 56 -#define SC_OPCODE_STOP_BIN_OP 57 +#define SC_OPCODE_START_BIN_OP 50 +#define SC_OPCODE_ADD 50 +#define SC_OPCODE_SUB 51 +#define SC_OPCODE_MUL 52 +#define SC_OPCODE_DIV 53 +#define SC_OPCODE_AMPERSAND 54 +#define SC_OPCODE_POW 55 +#define SC_OPCODE_EQUAL 56 +#define SC_OPCODE_NOT_EQUAL 57 +#define SC_OPCODE_LESS 58 +#define SC_OPCODE_GREATER 59 +#define SC_OPCODE_LESS_EQUAL 60 +#define SC_OPCODE_GREATER_EQUAL 61 +#define SC_OPCODE_AND 62 +#define SC_OPCODE_OR 63 +#define SC_OPCODE_INTERSECT 64 +#define SC_OPCODE_UNION 65 +#define SC_OPCODE_RANGE 66 +#define SC_OPCODE_STOP_BIN_OP 67 /* NOTE: binary and unary operators must be in sequence for compiler! */ /*** Unary operators ***/ -#define SC_OPCODE_START_UN_OP 60 -#define SC_OPCODE_NOT 60 -#define SC_OPCODE_NEG 61 -#define SC_OPCODE_NEG_SUB 62 -#define SC_OPCODE_STOP_UN_OP 63 +#define SC_OPCODE_START_UN_OP 70 +#define SC_OPCODE_NOT 70 +#define SC_OPCODE_NEG 71 +#define SC_OPCODE_NEG_SUB 72 +#define SC_OPCODE_STOP_UN_OP 73 -#define SC_OPCODE_START_FUNCTION 65 +#define SC_OPCODE_START_FUNCTION 75 /*** Functions without parameters ***/ -#define SC_OPCODE_START_NO_PAR 65 -#define SC_OPCODE_PI 65 -#define SC_OPCODE_RANDOM 66 -#define SC_OPCODE_TRUE 67 -#define SC_OPCODE_FALSE 68 -#define SC_OPCODE_GET_ACT_DATE 69 -#define SC_OPCODE_GET_ACT_TIME 70 -#define SC_OPCODE_NO_VALUE 71 -#define SC_OPCODE_CURRENT 72 -#define SC_OPCODE_STOP_NO_PAR 73 +#define SC_OPCODE_START_NO_PAR 75 +#define SC_OPCODE_PI 75 +#define SC_OPCODE_RANDOM 76 +#define SC_OPCODE_TRUE 77 +#define SC_OPCODE_FALSE 78 +#define SC_OPCODE_GET_ACT_DATE 79 +#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 /*** Functions with one parameter ***/ -#define SC_OPCODE_START_1_PAR 80 -#define SC_OPCODE_DEG 80 /* trigonometric */ -#define SC_OPCODE_RAD 81 -#define SC_OPCODE_SIN 82 -#define SC_OPCODE_COS 83 -#define SC_OPCODE_TAN 84 -#define SC_OPCODE_COT 85 -#define SC_OPCODE_ARC_SIN 86 -#define SC_OPCODE_ARC_COS 87 -#define SC_OPCODE_ARC_TAN 88 -#define SC_OPCODE_ARC_COT 89 -#define SC_OPCODE_SIN_HYP 90 -#define SC_OPCODE_COS_HYP 91 -#define SC_OPCODE_TAN_HYP 92 -#define SC_OPCODE_COT_HYP 93 -#define SC_OPCODE_ARC_SIN_HYP 94 /* transcendent */ -#define SC_OPCODE_ARC_COS_HYP 95 -#define SC_OPCODE_ARC_TAN_HYP 96 -#define SC_OPCODE_ARC_COT_HYP 97 -#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_PROPER 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_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_GAMMA_LN_MS 162 -#define SC_OPCODE_ERF_MS 163 -#define SC_OPCODE_ERFC_MS 164 -#define SC_OPCODE_ERROR_TYPE_ODF 165 -#define SC_OPCODE_ENCODEURL 166 -#define SC_OPCODE_STOP_1_PAR 167 +#define SC_OPCODE_START_1_PAR 90 +#define SC_OPCODE_DEG 90 /* trigonometric */ +#define SC_OPCODE_RAD 91 +#define SC_OPCODE_SIN 92 +#define SC_OPCODE_COS 93 +#define SC_OPCODE_TAN 94 +#define SC_OPCODE_COT 95 +#define SC_OPCODE_ARC_SIN 96 +#define SC_OPCODE_ARC_COS 97 +#define SC_OPCODE_ARC_TAN 98 +#define SC_OPCODE_ARC_COT 99 +#define SC_OPCODE_SIN_HYP 100 +#define SC_OPCODE_COS_HYP 101 +#define SC_OPCODE_TAN_HYP 102 +#define SC_OPCODE_COT_HYP 103 +#define SC_OPCODE_ARC_SIN_HYP 104 /* transcendent */ +#define SC_OPCODE_ARC_COS_HYP 105 +#define SC_OPCODE_ARC_TAN_HYP 106 +#define SC_OPCODE_ARC_COT_HYP 107 +#define SC_OPCODE_COSECANT 108 +#define SC_OPCODE_SECANT 109 +#define SC_OPCODE_COSECANT_HYP 110 +#define SC_OPCODE_SECANT_HYP 111 +#define SC_OPCODE_EXP 112 +#define SC_OPCODE_LN 113 +#define SC_OPCODE_SQRT 114 +#define SC_OPCODE_FACT 115 +#define SC_OPCODE_GET_YEAR 116 /* date and time */ +#define SC_OPCODE_GET_MONTH 117 +#define SC_OPCODE_GET_DAY 118 +#define SC_OPCODE_GET_HOUR 119 +#define SC_OPCODE_GET_MIN 120 +#define SC_OPCODE_GET_SEC 121 +#define SC_OPCODE_PLUS_MINUS 122 /* miscellaneous */ +#define SC_OPCODE_ABS 123 +#define SC_OPCODE_INT 124 +#define SC_OPCODE_PHI 125 +#define SC_OPCODE_GAUSS 126 +#define SC_OPCODE_IS_EMPTY 127 /* obtain type */ +#define SC_OPCODE_IS_STRING 128 +#define SC_OPCODE_IS_NON_STRING 129 +#define SC_OPCODE_IS_LOGICAL 130 +#define SC_OPCODE_TYPE 131 +#define SC_OPCODE_IS_REF 132 +#define SC_OPCODE_IS_VALUE 133 +#define SC_OPCODE_IS_FORMULA 134 +#define SC_OPCODE_IS_NV 135 +#define SC_OPCODE_IS_ERR 136 +#define SC_OPCODE_IS_ERROR 137 +#define SC_OPCODE_IS_EVEN 138 +#define SC_OPCODE_IS_ODD 139 +#define SC_OPCODE_N 140 +#define SC_OPCODE_GET_DATE_VALUE 141 /* string functions */ +#define SC_OPCODE_GET_TIME_VALUE 142 +#define SC_OPCODE_CODE 143 +#define SC_OPCODE_TRIM 144 +#define SC_OPCODE_UPPER 145 +#define SC_OPCODE_PROPER 146 +#define SC_OPCODE_LOWER 147 +#define SC_OPCODE_LEN 148 +#define SC_OPCODE_T 149 /* miscellaneous, part 21 */ +#define SC_OPCODE_VALUE 150 +#define SC_OPCODE_CLEAN 151 +#define SC_OPCODE_CHAR 152 +#define SC_OPCODE_LOG10 153 +#define SC_OPCODE_EVEN 154 +#define SC_OPCODE_ODD 155 +#define SC_OPCODE_STD_NORM_DIST 156 +#define SC_OPCODE_FISHER 157 +#define SC_OPCODE_FISHER_INV 158 +#define SC_OPCODE_S_NORM_INV 159 +#define SC_OPCODE_GAMMA_LN 160 +#define SC_OPCODE_ERROR_TYPE 161 +#define SC_OPCODE_FORMULA 163 +#define SC_OPCODE_ARABIC 164 +#define SC_OPCODE_INFO 165 +#define SC_OPCODE_BAHTTEXT 166 +#define SC_OPCODE_JIS 167 +#define SC_OPCODE_ASC 168 +#define SC_OPCODE_UNICODE 169 +#define SC_OPCODE_UNICHAR 170 +#define SC_OPCODE_GAMMA 171 +#define SC_OPCODE_GAMMA_LN_MS 172 +#define SC_OPCODE_ERF_MS 173 +#define SC_OPCODE_ERFC_MS 174 +#define SC_OPCODE_ERROR_TYPE_ODF 175 +#define SC_OPCODE_ENCODEURL 176 +#define SC_OPCODE_STOP_1_PAR 177 /*** Functions with more than one parameters ***/ #define SC_OPCODE_START_2_PAR 201 diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx index 667edeb..c093ab5 100644 --- a/include/formula/opcode.hxx +++ b/include/formula/opcode.hxx @@ -40,6 +40,8 @@ enum OpCode : sal_uInt16 // Parentheses and separators ocOpen = SC_OPCODE_OPEN, ocClose = SC_OPCODE_CLOSE, + ocTableRefOpen = SC_OPCODE_TABLE_REF_OPEN, + ocTableRefClose = SC_OPCODE_TABLE_REF_CLOSE, ocSep = SC_OPCODE_SEP, ocArrayOpen = SC_OPCODE_ARRAY_OPEN, ocArrayClose = SC_OPCODE_ARRAY_CLOSE, commit c7a98ea861d4aae18c74a94772c4939391eb1a24 Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 14:09:50 2015 +0100 translate comments while at it Change-Id: I62cce7321dfe038d1723c73ba9deb0450a03f0e5 diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 368b9b5..567c12c 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -910,7 +910,7 @@ FormulaToken* FormulaTokenArray::AddStringXML( const OUString& rStr ) void FormulaTokenArray::AddRecalcMode( ScRecalcMode nBits ) { - //! Reihenfolge ist wichtig + //! Order is important. if ( nBits & RECALCMODE_ALWAYS ) SetExclusiveRecalcModeAlways(); else if ( !IsRecalcModeAlways() ) @@ -928,8 +928,8 @@ bool FormulaTokenArray::HasMatrixDoubleRefOps() { if ( pRPN && nRPN ) { - // RPN-Interpreter Simulation - // als Ergebnis jeder Funktion wird einfach ein Double angenommen + // RPN-Interpreter simulation. + // Simply assumes a double as return value of each function. boost::scoped_array<FormulaToken*> pStack(new FormulaToken* [nRPN]); FormulaToken* pResult = new FormulaDoubleToken( 0.0 ); short sp = 0; commit 1b5a62e9da2211448ab6485fd75808758cd6e644 Author: Eike Rathke <er...@redhat.com> Date: Thu Mar 5 14:07:38 2015 +0100 add ocTableRef to lcl_IsReference() Change-Id: I63b41ea4619098390824f335859d62b4fa8fcc66 diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 1780c57..368b9b5 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -56,6 +56,7 @@ inline bool lcl_IsReference( OpCode eOp, StackVar eType ) || (eOp == ocColRowNameAuto && eType == svDoubleRef) || (eOp == ocColRowName && eType == svSingleRef) || (eOp == ocMatRef && eType == svSingleRef) + || (eOp == ocTableRef && (eType == svSingleRef || eType == svDoubleRef)) ; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits