summaryrefslogtreecommitdiff
path: root/sc/inc/compiler.hxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-17 11:09:25 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-17 11:09:25 +0000
commitf06e2089d82702cbc577cd3358260d98cc790131 (patch)
tree0e055aab06ec901d42c1b74732f5ee45af6da28b /sc/inc/compiler.hxx
parente6c032c3a8260f176f8d76c7d29931e119e7a69b (diff)
CWS-TOOLING: integrate CWS dr69
2009-09-09 11:45:28 +0200 dr r275979 : suncc failure 2009-09-09 11:33:34 +0200 dr r275977 : gcc warning 2009-09-09 11:09:02 +0200 er r275976 : #i87171# reworked name check for creating defined names 2009-09-09 10:38:02 +0200 dr r275973 : adapt changes in oox base class 2009-09-09 10:21:03 +0200 dr r275969 : remove faulty pagesize stuff 2009-09-09 10:20:13 +0200 dr r275968 : remove faulty pagesize stuff 2009-09-08 20:24:39 +0200 nn r275958 : #i104899# interpret cells when creating chart listener after loading 2009-09-08 16:05:37 +0200 er r275937 : ScXMLDDELinkContext::EndElement: Excel writes bad ODF <table:dde-link> <table:table> without <table:table-column>'s table:number-columns-repeated attribute; be lenient ... 2009-09-08 13:14:54 +0200 er r275925 : #i103315# handle external references in Excel's ODF msoxl namespace 2009-09-07 17:37:18 +0200 dr r275907 : #i104753# crash when deleting cell with note 2009-09-07 14:02:29 +0200 dr r275896 : #i103520# reworked sheet name buffer to resolve internal hyperlinks, fix almost all remaining problems with external links in BIFF, fix auto color import for BIFF 2009-09-06 20:01:05 +0200 er r275862 : #i35913# fix regression introduced by integration of CWS fhawfixes1; patch from <wsfulton> 2009-09-05 18:32:00 +0200 er r275847 : #i104156# merge #i103918# from uncloned dr68ooo311 2009-09-05 18:19:23 +0200 er r275846 : #i104156# merge #i103317# from uncloned dr68ooo311 2009-09-05 17:32:12 +0200 er r275844 : #i104484# glueState: correct casts in range bounds; patch from <cmc> slightly modified 2009-09-03 17:26:38 +0200 dr r275764 : #i103520# handle apostrophs in sheet names in internal URLs 2009-09-03 17:21:26 +0200 dr r275763 : #i95271# show text formatting in temp notes 2009-09-03 12:24:52 +0200 dr r275747 : unused declaration 2009-09-02 21:33:03 +0200 dr r275727 : #i96438# cleanup color handling in xls filter, extend VML color parser 2009-09-02 15:39:57 +0200 dr r275715 : #158571# #i96438# accept also VML colors in the form '#RRGGBB [xyz]' 2009-09-02 15:16:36 +0200 dr r275714 : #158571# #i96438# set note text 2009-09-02 14:59:33 +0200 dr r275713 : #158571# #i96438# load custom line dashes from DrawingML and VML 2009-09-02 11:53:35 +0200 dr r275702 : #158571# #i96438# import VML fill gradients 2009-08-31 19:28:10 +0200 dr r275632 : #158571# #i96438# more vml formatting 2009-08-31 14:29:30 +0200 dr r275606 : #158571# #i96438# changed handling of xml token ids/names 2009-08-28 18:25:26 +0200 dr r275545 : #158571# #i96438# preparations for and basic support of VML shape formatting, load spreadsheet cell notes position, formatting, and visibility 2009-08-25 19:08:31 +0200 dr r275378 : #i103390# dump BIFF STYLEEXT 2009-08-25 18:28:50 +0200 dr r275377 : #i103390# improve built-in style handling 2009-08-25 18:27:38 +0200 dr r275376 : #i103390# improve built-in style handling 2009-08-04 18:49:40 +0200 dr r274629 : CWS-TOOLING: rebase CWS dr69 to trunk@274622 (milestone: DEV300:m54)
Diffstat (limited to 'sc/inc/compiler.hxx')
-rw-r--r--sc/inc/compiler.hxx73
1 files changed, 62 insertions, 11 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 76293479660c..c981af2dad18 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -64,7 +64,7 @@
// constants and data types also for external modules (ScInterpreter et al)
#define MAXCODE 512 /* maximum number of tokens in formula */
-#define MAXSTRLEN 256 /* maximum length of input string of one symbol */
+#define MAXSTRLEN 1024 /* maximum length of input string of one symbol */
#define MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */
// flag values of CharTable
@@ -91,6 +91,8 @@
#define SC_COMPILER_C_ODF_RBRACKET 0x00080000 // ODF ']' reference bracket
#define SC_COMPILER_C_ODF_LABEL_OP 0x00100000 // ODF '!!' automatic intersection of labels
#define SC_COMPILER_C_ODF_NAME_MARKER 0x00200000 // ODF '$$' marker that starts a defined (range) name
+#define SC_COMPILER_C_CHAR_NAME 0x00400000 // start character of a defined name
+#define SC_COMPILER_C_NAME 0x00800000 // continuation character of a defined name
#define SC_COMPILER_FILE_TAB_SEP '#' // 'Doc'#Tab
@@ -217,6 +219,14 @@ typedef formula::SimpleIntrusiveReference< struct ScRawToken > ScRawTokenRef;
class SC_DLLPUBLIC ScCompiler : public formula::FormulaCompiler
{
public:
+
+ enum EncodeUrlMode
+ {
+ ENCODE_BY_GRAMMAR,
+ ENCODE_ALWAYS,
+ ENCODE_NEVER,
+ };
+
struct Convention
{
const formula::FormulaGrammar::AddressConvention meConv;
@@ -313,6 +323,7 @@ private:
SCsTAB nMaxTab; // last sheet in document
sal_Int32 mnRangeOpPosInSymbol; // if and where a range operator is in symbol
const Convention *pConv;
+ EncodeUrlMode meEncodeUrlMode;
bool mbCloseBrackets; // whether to close open brackets automatically, default TRUE
bool mbExtendedErrorDetection;
bool mbRewind; // whether symbol is to be rewound to some step during lexical analysis
@@ -373,6 +384,8 @@ public:
void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar );
+ void SetEncodeUrlMode( EncodeUrlMode eMode );
+ EncodeUrlMode GetEncodeUrlMode() const;
private:
/** Set grammar and reference convention from within SetFormulaLanguage()
or SetGrammar().
@@ -435,28 +448,66 @@ public:
BOOL HasModifiedRange();
- /// If the character is allowed as first character in sheet names or references
+ /** If the character is allowed as first character in sheet names or
+ references, includes '$' and '?'. */
static inline BOOL IsCharWordChar( String const & rStr,
xub_StrLen nPos,
const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
{
sal_Unicode c = rStr.GetChar( nPos );
- return c < 128 ?
- static_cast<BOOL>(
- (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
- ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+ if (c < 128)
+ {
+ return pConventions[eConv] ? static_cast<BOOL>(
+ (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_CHAR_WORD) == SC_COMPILER_C_CHAR_WORD) :
+ FALSE; // no convention => assume invalid
+ }
+ else
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
}
- /// If the character is allowed in sheet names or references
+ /** If the character is allowed in sheet names, thus may be part of a
+ reference, includes '$' and '?' and such. */
static inline BOOL IsWordChar( String const & rStr,
xub_StrLen nPos,
const formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_OOO )
{
sal_Unicode c = rStr.GetChar( nPos );
- return c < 128 ?
- static_cast<BOOL>(
- (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
- ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+ if (c < 128)
+ {
+ return pConventions[eConv] ? static_cast<BOOL>(
+ (pConventions[eConv]->mpCharTable[ UINT8(c) ] & SC_COMPILER_C_WORD) == SC_COMPILER_C_WORD) :
+ FALSE; // convention not known => assume invalid
+ }
+ else
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+ }
+
+ /** If the character is allowed as tested by nFlags (SC_COMPILER_C_...
+ bits) for all known address conventions. If more than one bit is given
+ in nFlags, all bits must match. If bTestLetterNumeric is FALSE and
+ char>=128, no LetterNumeric test is done and FALSE is returned. */
+ static inline bool IsCharFlagAllConventions( String const & rStr,
+ xub_StrLen nPos,
+ ULONG nFlags,
+ bool bTestLetterNumeric = true )
+ {
+ sal_Unicode c = rStr.GetChar( nPos );
+ 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))
+ return false;
+ // convention not known => assume valid
+ }
+ return true;
+ }
+ else if (bTestLetterNumeric)
+ return ScGlobal::pCharClass->isLetterNumeric( rStr, nPos );
+ else
+ return false;
}
private: