diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-03-06 17:28:27 +0100 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-22 10:34:44 +0200 |
commit | d9726a692024e202f0b28a8b6955463f1d90d1e4 (patch) | |
tree | 5749580ff7aa0a55183f726ee4511b37eb58b824 /include/formula | |
parent | 9ec1ccb23af0de56f141d906f2eb60bab40aefb8 (diff) |
formula: remove indirection and use unique_ptr
Change-Id: Ib0c083803024d223f62b91ec54850b84eb68a758
Reviewed-on: https://gerrit.libreoffice.org/39033
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'include/formula')
-rw-r--r-- | include/formula/FormulaCompiler.hxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index a9b65671e4cd..970909cd9f00 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -81,8 +81,8 @@ public: /** Mappings from strings to OpCodes and vice versa. */ class FORMULA_DLLPUBLIC OpCodeMap final { - OpCodeHashMap * mpHashMap; /// Hash map of symbols, OUString -> OpCode - OUString * mpTable; /// Array of symbols, OpCode -> OUString, offset==OpCode + OpCodeHashMap maHashMap; /// Hash map of symbols, OUString -> OpCode + std::unique_ptr<OUString[]> mpTable; /// Array of symbols, OpCode -> OUString, offset==OpCode ExternalHashMap maExternalHashMap; /// Hash map of ocExternal, Filter String -> AddIn String ExternalHashMap maReverseExternalHashMap; /// Hash map of ocExternal, AddIn String -> Filter String FormulaGrammar::Grammar meGrammar; /// Grammar, language and reference convention @@ -96,15 +96,14 @@ public: public: OpCodeMap(sal_uInt16 nSymbols, bool bCore, FormulaGrammar::Grammar eGrammar ) : - mpHashMap( new OpCodeHashMap( nSymbols)), + maHashMap(nSymbols), mpTable( new OUString[ nSymbols ]), meGrammar( eGrammar), mnSymbols( nSymbols), - mbCore( bCore) + mbCore( bCore), + mbEnglish ( FormulaGrammar::isEnglish(eGrammar) ) { - mbEnglish = FormulaGrammar::isEnglish( meGrammar); } - ~OpCodeMap(); /** Copy mappings from r into this map, effectively replacing this map. @@ -115,13 +114,13 @@ public: void copyFrom( const OpCodeMap& r ); /// Get the symbol String -> OpCode hash map for finds. - const OpCodeHashMap* getHashMap() const { return mpHashMap; } + const OpCodeHashMap& getHashMap() const { return maHashMap; } /// Get the symbol String -> AddIn String hash map for finds. - const ExternalHashMap* getExternalHashMap() const { return &maExternalHashMap; } + const ExternalHashMap& getExternalHashMap() const { return maExternalHashMap; } /// Get the AddIn String -> symbol String hash map for finds. - const ExternalHashMap* getReverseExternalHashMap() const { return &maReverseExternalHashMap; } + const ExternalHashMap& getReverseExternalHashMap() const { return maReverseExternalHashMap; } /// Get the symbol string matching an OpCode. const OUString& getSymbol( const OpCode eOp ) const |