diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/compiler.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index cfd5affb0b8f..9e73783f1f28 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -33,6 +33,7 @@ #include <rtl/ustrbuf.hxx> #include <com/sun/star/sheet/ExternalLinkInfo.hpp> #include <vector> +#include <memory> #include <formula/FormulaCompiler.hxx> #include <o3tl/typed_flags_set.hxx> @@ -244,7 +245,7 @@ public: virtual ScCharFlags getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const = 0; protected: - const ScCharFlags* mpCharTable; + std::unique_ptr<ScCharFlags[]> mpCharTable; }; friend struct Convention; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 8e552a878f81..e8af73691b29 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -290,8 +290,6 @@ OUString ScCompiler::FindAddInFunction( const OUString& rUpperName, bool bLocalF ScCompiler::Convention::~Convention() { - delete [] mpCharTable; - mpCharTable = nullptr; } ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv ) @@ -302,7 +300,7 @@ ScCompiler::Convention::Convention( FormulaGrammar::AddressConvention eConv ) ScCharFlags *t= new ScCharFlags [128]; ScCompiler::pConventions[ meConv ] = this; - mpCharTable = t; + mpCharTable.reset( t ); for (i = 0; i < 128; i++) t[i] = ScCharFlags::Illegal; |