diff options
author | Eike Rathke <erack@erack.de> | 2011-08-26 13:24:18 +0200 |
---|---|---|
committer | Eike Rathke <erack@erack.de> | 2011-08-26 13:34:59 +0200 |
commit | 6f42e4d03b04204b7a864f3c5c9c03548f5e2392 (patch) | |
tree | 1da52b208ff6e38c524ee8d4a4a4c509d7bcbbce /sc/inc | |
parent | 0e735d61b2601392c2054188166b055bdc061d43 (diff) |
fdo#40378 compile defined names that had unresolveds during load
Dependencies of defined names must not depend on the order in which they
are inserted during file load. In a second step compile defined names
that had unresolved names during load, and only those.
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/compiler.hxx | 11 | ||||
-rw-r--r-- | sc/inc/rangenam.hxx | 13 |
2 files changed, 21 insertions, 3 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 7f418e32486d..f7dde6ae7ed2 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -230,6 +230,13 @@ public: ENCODE_NEVER, }; + enum ExtendedErrorDetection + { + EXTENDED_ERROR_DETECTION_NONE = 0, // no error on unknown symbols, default (interpreter handles it) + EXTENDED_ERROR_DETECTION_NAME_BREAK, // name error on unknown symbols and break, pCode incomplete + EXTENDED_ERROR_DETECTION_NAME_NO_BREAK // name error on unknown symbols, don't break, continue + }; + struct Convention { const formula::FormulaGrammar::AddressConvention meConv; @@ -330,8 +337,8 @@ private: sal_Int32 mnRangeOpPosInSymbol; // if and where a range operator is in symbol const Convention *pConv; EncodeUrlMode meEncodeUrlMode; + ExtendedErrorDetection meExtendedErrorDetection; 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 bool NextNewToken(bool bInArray = false); @@ -417,7 +424,7 @@ public: void CreateStringFromXMLTokenArray( String& rFormula, String& rFormulaNmsp ); - void SetExtendedErrorDetection( bool bVal ) { mbExtendedErrorDetection = bVal; } + void SetExtendedErrorDetection( ExtendedErrorDetection eVal ) { meExtendedErrorDetection = eVal; } bool IsCorrected() { return bCorrected; } const String& GetCorrectedFormula() { return aCorrectedFormula; } diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx index 2774028334af..7b5036216851 100644 --- a/sc/inc/rangenam.hxx +++ b/sc/inc/rangenam.hxx @@ -77,7 +77,8 @@ private: ScAddress aPos; RangeType eType; ScDocument* pDoc; - sal_uInt16 nIndex; + formula::FormulaGrammar::Grammar eTempGrammar; // needed for unresolved XML compiles + sal_uInt16 nIndex; bool bModified; // is set/cleared by UpdateReference // max row and column to use for wrapping of references. If -1 use the @@ -86,6 +87,9 @@ private: SCCOL mnMaxCol; ScRangeData( sal_uInt16 nIndex ); + + void CompileRangeData( const String& rSymbol, bool bSetError ); + public: typedef ::std::map<sal_uInt16, sal_uInt16> IndexMap; @@ -161,6 +165,8 @@ public: SCROW GetMaxRow() const; SC_DLLPUBLIC void SetMaxCol(SCCOL nCol); SCCOL GetMaxCol() const; + + void CompileUnresolvedXML(); }; inline bool ScRangeData::HasType( RangeType nType ) const @@ -204,6 +210,11 @@ public: void UpdateTranspose(const ScRange& rSource, const ScAddress& rDest); void UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY); + /** Compile those names that couldn't be resolved during loading and + inserting because they may have referred a name that was inserted later. + */ + void CompileUnresolvedXML(); + SC_DLLPUBLIC const_iterator begin() const; SC_DLLPUBLIC const_iterator end() const; SC_DLLPUBLIC iterator begin(); |