diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-12 09:38:47 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-12 09:38:47 +0000 |
commit | 47b1cc26c2697d81b44be5fb53598321cbc5d827 (patch) | |
tree | 38848d46028498de77cf271535fffac1954ad237 /sc/inc/compiler.hxx | |
parent | a190965485508c4493ee33228dae68e12cd858f9 (diff) |
CWS-TOOLING: integrate CWS mooxlsc
2008-12-12 09:32:19 +0100 dr r265390 : #i10000# warning
2008-12-11 14:54:26 +0100 dr r265301 : add strings from dr66 to meet ui freeze
2008-12-11 14:53:20 +0100 dr r265300 : add strings from dr66 to meet ui freeze
2008-12-08 14:43:25 +0100 er r264997 : DBG_... need semicolon
2008-12-04 19:16:50 +0100 er r264872 : DBG_... needs semicolon
2008-12-04 11:09:27 +0100 er r264824 : DBG_ERROR needs semicolon
2008-12-03 13:29:46 +0100 er r264770 : CWS-TOOLING: rebase CWS mooxlsc to trunk@264325 (milestone: DEV300:m36)
2008-12-02 16:49:09 +0100 er r264722 : disable code for named references #i4385# import as long as #i3740# isn't fully implemented
2008-12-02 16:45:04 +0100 er r264721 : some compilers attempt to be too smart; persuade them it's really meant what was written
2008-12-02 16:04:56 +0100 er r264715 : #i3740# no storage in ODF for external name references
2008-11-29 02:20:50 +0100 er r264575 : some huge performance improvement when reading repeated empty rows for the external references cache from ODF, as they often occur in the sparse matrix
2008-11-29 01:14:55 +0100 er r264574 : WriteExternalRefCaches: for table:number-columns-repeated write used columns instead of MAXCOLCOUNT
2008-11-28 18:30:04 +0100 er r264570 : #i3740# write/read external name references as bracketed references, as proposed on the ODFF list
2008-11-27 20:36:54 +0100 er r264521 : merge i95068 from cws calc46 for code correctness
2008-11-21 20:39:34 +0100 kohei r264174 : fixed a crash when importing a BIFF8 document with per-sheet external names.
For now, we don't support per-sheet external names. Let's throw in NoName
error until they are supported.
2008-11-21 18:47:27 +0100 kohei r264168 : I forgot to process cached range references in the EXTERNNAME record, which
prevented cached external names with range references from being imported
correctly.
P.S. I swear I thought I had covered this....
2008-11-20 23:07:22 +0100 er r264104 : #i4385# parse external defined names in MOOXML import
2008-11-14 23:18:54 +0100 er r263700 : #i92797# parse external sheet references under aspects of MOOXML import and new ScExternalRefManager
2008-11-14 18:49:48 +0100 er r263696 : remove infinity assertion, leftover from binary file format; coded double error may occur via filter import
2008-11-12 13:29:44 +0100 er r263593 : make references to entire rows/columns, such as A:A or 3:3, actually work in MOOXML import
2008-11-03 12:35:11 +0100 er r263282 : a struct is a struct is a ...
2008-10-31 00:30:59 +0100 er r262843 : aTableRowCellAttrTokenMap needed
2008-10-31 00:26:07 +0100 er r262842 : GetTableRowCellAttrTokenMap() is not unused
2008-10-31 00:13:53 +0100 er r262841 : merge error
2008-10-31 00:05:39 +0100 er r262840 : merge error
2008-10-30 23:17:48 +0100 er r262839 : unresolved merge conflict!?!
2008-10-30 22:59:11 +0100 er r262838 : merge error
2008-10-30 16:31:04 +0100 hr r262833 : CWS-TOOLING: rebase CWS mooxlsc to trunk@262620 (milestone: DEV300:m34)
2008-10-16 21:57:51 +0200 er r262272 : migrate CWS mooxlsc to SVN
Diffstat (limited to 'sc/inc/compiler.hxx')
-rw-r--r-- | sc/inc/compiler.hxx | 117 |
1 files changed, 92 insertions, 25 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 81f5c606c9be..c583bb831b19 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -45,6 +45,8 @@ #include <unotools/charclass.hxx> #include <rtl/ustrbuf.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/sheet/ExternalLinkInfo.hpp> +#include <vector> namespace com { namespace sun { namespace star { namespace sheet { @@ -71,35 +73,37 @@ namespace com { namespace sun { namespace star { #define MAXJUMPCOUNT 32 /* maximum number of jumps (ocChose) */ // flag values of CharTable -#define SC_COMPILER_C_ILLEGAL 0x00000000 -#define SC_COMPILER_C_CHAR 0x00000001 -#define SC_COMPILER_C_CHAR_BOOL 0x00000002 -#define SC_COMPILER_C_CHAR_WORD 0x00000004 -#define SC_COMPILER_C_CHAR_VALUE 0x00000008 -#define SC_COMPILER_C_CHAR_STRING 0x00000010 -#define SC_COMPILER_C_CHAR_DONTCARE 0x00000020 -#define SC_COMPILER_C_BOOL 0x00000040 -#define SC_COMPILER_C_WORD 0x00000080 -#define SC_COMPILER_C_WORD_SEP 0x00000100 -#define SC_COMPILER_C_VALUE 0x00000200 -#define SC_COMPILER_C_VALUE_SEP 0x00000400 -#define SC_COMPILER_C_VALUE_EXP 0x00000800 -#define SC_COMPILER_C_VALUE_SIGN 0x00001000 -#define SC_COMPILER_C_VALUE_VALUE 0x00002000 -#define SC_COMPILER_C_STRING_SEP 0x00004000 -#define SC_COMPILER_C_NAME_SEP 0x00008000 // there can be only one! '\'' -#define SC_COMPILER_C_CHAR_IDENT 0x00010000 // identifier (built-in function) start -#define SC_COMPILER_C_IDENT 0x00020000 // identifier continuation -#define SC_COMPILER_C_ODF_LBRACKET 0x00040000 // ODF '[' reference bracket -#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_FILE_TAB_SEP '#' // 'Doc'#Tab +#define SC_COMPILER_C_ILLEGAL 0x00000000 +#define SC_COMPILER_C_CHAR 0x00000001 +#define SC_COMPILER_C_CHAR_BOOL 0x00000002 +#define SC_COMPILER_C_CHAR_WORD 0x00000004 +#define SC_COMPILER_C_CHAR_VALUE 0x00000008 +#define SC_COMPILER_C_CHAR_STRING 0x00000010 +#define SC_COMPILER_C_CHAR_DONTCARE 0x00000020 +#define SC_COMPILER_C_BOOL 0x00000040 +#define SC_COMPILER_C_WORD 0x00000080 +#define SC_COMPILER_C_WORD_SEP 0x00000100 +#define SC_COMPILER_C_VALUE 0x00000200 +#define SC_COMPILER_C_VALUE_SEP 0x00000400 +#define SC_COMPILER_C_VALUE_EXP 0x00000800 +#define SC_COMPILER_C_VALUE_SIGN 0x00001000 +#define SC_COMPILER_C_VALUE_VALUE 0x00002000 +#define SC_COMPILER_C_STRING_SEP 0x00004000 +#define SC_COMPILER_C_NAME_SEP 0x00008000 // there can be only one! '\'' +#define SC_COMPILER_C_CHAR_IDENT 0x00010000 // identifier (built-in function) or reference start +#define SC_COMPILER_C_IDENT 0x00020000 // identifier or reference continuation +#define SC_COMPILER_C_ODF_LBRACKET 0x00040000 // ODF '[' reference bracket +#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_FILE_TAB_SEP '#' // 'Doc'#Tab class ScDocument; class ScMatrix; class ScRangeData; +class ScExternalRefManager; // constants and data types internal to compiler @@ -151,6 +155,15 @@ public: bool bHasForceArray; } sbyte; ComplRefData aRef; + struct { + sal_uInt16 nFileId; + sal_Unicode cTabName[MAXSTRLEN+1]; + ComplRefData aRef; + } extref; + struct { + sal_uInt16 nFileId; + sal_Unicode cName[MAXSTRLEN+1]; + } extname; ScMatrix* pMat; USHORT nIndex; // index into name collection sal_Unicode cStr[ MAXSTRLEN+1 ]; // string (up to 255 characters + 0) @@ -180,10 +193,15 @@ public: void SetDouble( double fVal ); //UNUSED2008-05 void SetInt( int nVal ); //UNUSED2008-05 void SetMatrix( ScMatrix* p ); -//UNUSED2008-05 // These methods are ok to use, reference count not cleared. + + // These methods are ok to use, reference count not cleared. //UNUSED2008-05 ComplRefData& GetReference(); //UNUSED2008-05 void SetReference( ComplRefData& rRef ); void SetName( USHORT n ); + void SetExternalSingleRef( sal_uInt16 nFileId, const String& rTabName, const SingleRefData& rRef ); + void SetExternalDoubleRef( sal_uInt16 nFileId, const String& rTabName, const ComplRefData& rRef ); + void SetExternalName( sal_uInt16 nFileId, const String& rName ); + void SetMatrix( ScMatrix* p ); void SetExternal(const sal_Unicode* pStr); ScRawToken* Clone() const; // real copy! @@ -228,6 +246,27 @@ public: xub_StrLen nSrcPos, const CharClass* pCharClass) const = 0; + /** + * Parse the symbol string and pick up the file name and the external + * range name. + * + * @return true on successful parse, or false otherwise. + */ + virtual bool parseExternalName( const String& rSymbol, String& rFile, String& rName, + const ScDocument* pDoc, + const ::com::sun::star::uno::Sequence< + const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks ) const = 0; + + virtual String makeExternalNameStr( const String& rFile, const String& rName ) const = 0; + + virtual void makeExternalRefStr( ::rtl::OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + sal_uInt16 nFileId, const String& rTabName, const SingleRefData& rRef, + ScExternalRefManager* pRefMgr ) const = 0; + + virtual void makeExternalRefStr( ::rtl::OUStringBuffer& rBuffer, const ScCompiler& rCompiler, + sal_uInt16 nFileId, const String& rTabName, const ComplRefData& rRef, + ScExternalRefManager* pRefMgr ) const = 0; + enum SpecialSymbolType { /** @@ -372,6 +411,7 @@ private: static const Convention * const pConvOOO_A1_ODF; static const Convention * const pConvXL_A1; static const Convention * const pConvXL_R1C1; + static const Convention * const pConvXL_OOX; static struct AddInMap { @@ -387,6 +427,9 @@ private: ScDocument* pDoc; ScAddress aPos; + // For ScAddress::CONV_XL_OOX, may be set via API by MOOXML filter. + ::com::sun::star::uno::Sequence< const ::com::sun::star::sheet::ExternalLinkInfo > maExternalLinks; + String aCorrectedFormula; // autocorrected Formula String aCorrectedSymbol; // autocorrected Symbol sal_Unicode cSymbol[MAXSTRLEN]; // current Symbol @@ -448,6 +491,7 @@ private: BOOL IsDoubleReference( const String& ); BOOL IsMacro( const String& ); BOOL IsNamedRange( const String& ); + bool IsExternalNamedRange( const String& rSymbol ); BOOL IsDBRange( const String& ); BOOL IsColRowName( const String& ); BOOL IsBoolean( const String& ); @@ -539,6 +583,29 @@ public: void SetGrammar( const ScGrammar::Grammar eGrammar ); inline ScGrammar::Grammar GetGrammar() const { return meGrammar; } +private: + /** Set grammar and reference convention from within SetFormulaLanguage() + or SetGrammar(). + + @param eNewGrammar + The new grammar to be set and the associated reference convention. + + @param eOldGrammar + The previous grammar that was active before SetFormulaLanguage(). + */ + void SetGrammarAndRefConvention( + const ScGrammar::Grammar eNewGrammar, + const ScGrammar::Grammar eOldGrammar ); +public: + + /// Set external link info for ScAddress::CONV_XL_OOX. + inline void SetExternalLinks( + const ::com::sun::star::uno::Sequence< + const ::com::sun::star::sheet::ExternalLinkInfo > & rLinks ) + { + maExternalLinks = rLinks; + } + void SetExtendedErrorDetection( bool bVal ) { mbExtendedErrorDetection = bVal; } BOOL IsCorrected() { return bCorrected; } |