[ooo-build-commit] .: patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Oct 4 13:11:11 PDT 2010
patches/dev300/apply | 3
patches/dev300/calc-formula-r1c1-parser-fix.diff | 207 -----------------------
2 files changed, 210 deletions(-)
New commits:
commit 4e0a2afe560aa48da70cae456adfad19addceaf2
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Oct 4 16:10:35 2010 -0400
Removed calc-formula-r1c1-parser-fix.diff; moved to git.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 829705b..07fb0a1 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2703,9 +2703,6 @@ calc-perf-xlsx-import-string-cells.diff, n#594513, kohei
# Speed up outline level changes with notes.
calc-perf-outlining-with-notes.diff, kohei
-# Fix parse error on minus operator e.g. R[-2]C-R[-1]C.
-calc-formula-r1c1-parser-fix.diff, n#604903, kohei
-
# Fix poor performance on saving document with hidden rows.
# #FIXME ooo330-m4: doesn't apply in m3f
# FIXME ooo330-m3: does not apply: calc-perf-ods-export-hidden-rows.diff, deb#582785, kohei
diff --git a/patches/dev300/calc-formula-r1c1-parser-fix.diff b/patches/dev300/calc-formula-r1c1-parser-fix.diff
deleted file mode 100644
index a4522fb..0000000
--- a/patches/dev300/calc-formula-r1c1-parser-fix.diff
+++ /dev/null
@@ -1,207 +0,0 @@
----
- sc/inc/compiler.hxx | 20 +++++++++++++-------
- sc/source/core/tool/compiler.cxx | 35 +++++++++++++++++++++++++----------
- 2 files changed, 38 insertions(+), 17 deletions(-)
-
-diff --git sc/inc/compiler.hxx sc/inc/compiler.hxx
-index f137182..a1266d9 100644
---- sc/inc/compiler.hxx
-+++ sc/inc/compiler.hxx
-@@ -227,8 +227,6 @@ public:
- struct Convention
- {
- const formula::FormulaGrammar::AddressConvention meConv;
-- const ULONG* mpCharTable;
--
-
- Convention( formula::FormulaGrammar::AddressConvention eConvP );
- virtual ~Convention();
-@@ -278,6 +276,11 @@ public:
- ABS_SHEET_PREFIX
- };
- virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
-+
-+ virtual ULONG getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const = 0;
-+
-+ protected:
-+ const ULONG* mpCharTable;
- };
- friend struct Convention;
-
-@@ -452,10 +455,11 @@ public:
- const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
- {
- sal_Unicode c = rStr.GetChar( nPos );
-+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
- if (c < 128)
- {
- return pConventions[eConv] ? static_cast<BOOL>(
-- (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
-+ (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
- FALSE; // no convention => assume invalid
- }
- else
-@@ -469,10 +473,11 @@ public:
- const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
- {
- sal_Unicode c = rStr.GetChar( nPos );
-+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar(nPos-1) : 0;
- if (c < 128)
- {
- return pConventions[eConv] ? static_cast<BOOL>(
-- (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
-+ (pConventions[eConv]->getCharTableFlags(c, cLast) & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
- FALSE; // convention not known => assume invalid
- }
- else
-@@ -489,13 +494,14 @@ public:
- bool bTestLetterNumeric = true )
- {
- sal_Unicode c = rStr.GetChar( nPos );
-+ sal_Unicode cLast = nPos > 0 ? rStr.GetChar( nPos-1 ) : 0;
- if (c < 128)
- {
- for ( int nConv = formula::FormulaGrammar::CONV_UNSPECIFIED;
- ++nConv < formula::FormulaGrammar::CONV_LAST; )
- {
- if (pConventions[nConv] &&
-- ((pConventions[nConv]->mpCharTable[ UINT8(c) ] & nFlags) != nFlags))
-+ ((pConventions[nConv]->getCharTableFlags(c, cLast) & nFlags) != nFlags))
- return false;
- // convention not known => assume valid
- }
-@@ -530,8 +536,8 @@ private:
- virtual BOOL IsImportingXML() const;
-
- /// Access the CharTable flags
-- inline ULONG GetCharTableFlags( sal_Unicode c )
-- { return c < 128 ? pConv->mpCharTable[ UINT8(c) ] : 0; }
-+ inline ULONG GetCharTableFlags( sal_Unicode c, sal_Unicode cLast )
-+ { return c < 128 ? pConv->getCharTableFlags(c, cLast) : 0; }
- };
-
- SC_DLLPUBLIC String GetScCompilerNativeSymbol( OpCode eOp ); //CHINA001
-diff --git sc/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
-index 80e4098..c69600e 100644
---- sc/source/core/tool/compiler.cxx
-+++ sc/source/core/tool/compiler.cxx
-@@ -548,7 +548,6 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv )
-
- if( FormulaGrammar::CONV_XL_R1C1 == meConv )
- {
--/* - */ t[45] |= SC_COMPILER_C_IDENT;
- /* [ */ t[91] |= SC_COMPILER_C_IDENT;
- /* ] */ t[93] |= SC_COMPILER_C_IDENT;
- }
-@@ -824,6 +823,11 @@ struct Convention_A1 : public ScCompiler::Convention
- return pCharClass->parseAnyToken( rFormula,
- nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
- }
-+
-+ virtual ULONG getCharTableFlags( sal_Unicode c, sal_Unicode /*cLast*/ ) const
-+ {
-+ return mpCharTable[static_cast<sal_uInt8>(c)];
-+ }
- };
-
- void Convention_A1::MakeColStr( rtl::OUStringBuffer& rBuffer, SCCOL nCol )
-@@ -1792,6 +1796,15 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
- r1c1_add_row(rBuffer, aRef.Ref2);
- r1c1_add_col(rBuffer, aRef.Ref2);
- }
-+
-+ virtual ULONG getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const
-+ {
-+ ULONG nFlags = mpCharTable[static_cast<sal_uInt8>(c)];
-+ if (c == '-' && cLast == '[')
-+ // '-' can occur within a reference string only after '[' e.g. R[-1]C.
-+ nFlags |= SC_COMPILER_C_IDENT;
-+ return nFlags;
-+ }
- };
-
- static const ConventionXL_R1C1 ConvXL_R1C1;
-@@ -1982,7 +1995,8 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray)
- while ((c != 0) && (eState != ssStop) )
- {
- pSrc++;
-- ULONG nMask = GetCharTableFlags( c );
-+ ULONG nMask = GetCharTableFlags( c, cLast );
-+
- // The parameter separator and the array column and row separators end
- // things unconditionally if not in string or reference.
- if (c == cSep || (bInArray && (c == cArrayColSep || c == cArrayRowSep)))
-@@ -2012,7 +2026,7 @@ Label_MaskStateMachine:
- if( nMask & SC_COMPILER_C_ODF_LABEL_OP )
- {
- // '!!' automatic intersection
-- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_ODF_LABEL_OP)
-+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_ODF_LABEL_OP)
- {
- /* TODO: For now the UI "space operator" is used, this
- * could be enhanced using a specialized OpCode to get
-@@ -2043,7 +2057,7 @@ Label_MaskStateMachine:
- else if( nMask & SC_COMPILER_C_ODF_NAME_MARKER )
- {
- // '$$' defined name marker
-- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_ODF_NAME_MARKER)
-+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_ODF_NAME_MARKER)
- {
- // both eaten, not added to pSym
- ++pSrc;
-@@ -2177,7 +2191,7 @@ Label_MaskStateMachine:
- }
- else if (c == 'E' || c == 'e')
- {
-- if (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_VALUE_EXP)
-+ if (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_VALUE_EXP)
- *pSym++ = c;
- else
- {
-@@ -2189,7 +2203,7 @@ Label_MaskStateMachine:
- else if( nMask & SC_COMPILER_C_VALUE_SIGN )
- {
- if (((cLast == 'E') || (cLast == 'e')) &&
-- (GetCharTableFlags( pSrc[0] ) & SC_COMPILER_C_VALUE_VALUE))
-+ (GetCharTableFlags( pSrc[0], 0 ) & SC_COMPILER_C_VALUE_VALUE))
- {
- *pSym++ = c;
- }
-@@ -2822,7 +2836,7 @@ BOOL ScCompiler::IsReference( const String& rName )
- if ( !(ch2 == '$' || CharClass::isAsciiAlpha( ch2 )) )
- return FALSE;
- if ( cDecSep == '.' && (ch2 == 'E' || ch2 == 'e') // E + - digit
-- && (GetCharTableFlags( pTabSep[2] ) & SC_COMPILER_C_VALUE_EXP) )
-+ && (GetCharTableFlags( pTabSep[2], pTabSep[1] ) & SC_COMPILER_C_VALUE_EXP) )
- { // #91053#
- // If it is an 1.E2 expression check if "1" is an existent sheet
- // name. If so, a desired value 1.E2 would have to be entered as
-@@ -3307,12 +3321,13 @@ void ScCompiler::AutoCorrectParsedSymbol()
- const sal_Unicode cX = 'X';
- sal_Unicode c1 = aCorrectedSymbol.GetChar( 0 );
- sal_Unicode c2 = aCorrectedSymbol.GetChar( nPos );
-+ sal_Unicode c2p = nPos > 0 ? aCorrectedSymbol.GetChar( nPos-1 ) : 0;
- if ( c1 == cQuote && c2 != cQuote )
- { // "...
- // What's not a word doesn't belong to it.
- // Don't be pedantic: c < 128 should be sufficient here.
- while ( nPos && ((aCorrectedSymbol.GetChar(nPos) < 128) &&
-- ((GetCharTableFlags( aCorrectedSymbol.GetChar(nPos) ) &
-+ ((GetCharTableFlags(aCorrectedSymbol.GetChar(nPos), aCorrectedSymbol.GetChar(nPos-1)) &
- (SC_COMPILER_C_WORD | SC_COMPILER_C_CHAR_DONTCARE)) == 0)) )
- nPos--;
- if ( nPos == MAXSTRLEN - 2 )
-@@ -3331,8 +3346,8 @@ void ScCompiler::AutoCorrectParsedSymbol()
- aCorrectedSymbol = mxSymbols->getSymbol(ocMul);
- bCorrected = TRUE;
- }
-- else if ( (GetCharTableFlags( c1 ) & SC_COMPILER_C_CHAR_VALUE)
-- && (GetCharTableFlags( c2 ) & SC_COMPILER_C_CHAR_VALUE) )
-+ else if ( (GetCharTableFlags( c1, 0 ) & SC_COMPILER_C_CHAR_VALUE)
-+ && (GetCharTableFlags( c2, c2p ) & SC_COMPILER_C_CHAR_VALUE) )
- {
- xub_StrLen nXcount;
- if ( (nXcount = aCorrectedSymbol.GetTokenCount( cx )) > 1 )
---
-1.7.0.1
-
More information about the ooo-build-commit
mailing list