diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2016-02-13 20:17:41 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-17 07:08:59 +0000 |
commit | f17a4694b07856292804c23b80ce92967d401bb8 (patch) | |
tree | 1f70cbd4826f3583769b2ba759a6284c0f56ad36 /basic/source/inc | |
parent | 7b7ffedfa6357b902a5e354d986dac39a3b2f462 (diff) |
BASIC : use std::unique_ptr for storing SbiExprList
Change-Id: I37f2a1c837c6742cf6d403962d2730b5e80004ec
Reviewed-on: https://gerrit.libreoffice.org/22345
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic/source/inc')
-rw-r--r-- | basic/source/inc/expr.hxx | 11 | ||||
-rw-r--r-- | basic/source/inc/parser.hxx | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 61a5f6b6f7bb..8f17e8b0c8b7 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -35,7 +35,8 @@ class SbiProcDef; #include <vector> -typedef ::std::vector<SbiExprList*> SbiExprListVector; +typedef ::std::unique_ptr<SbiExprList> SbiExprListPtr; +typedef ::std::vector<SbiExprListPtr> SbiExprListVector; struct SbVar { SbiExprNode* pNext; // next element (for structures) @@ -120,7 +121,7 @@ public: SbiExprNode(); SbiExprNode( double, SbxDataType ); SbiExprNode( const OUString& ); - SbiExprNode( const SbiSymDef&, SbxDataType, SbiExprList* = nullptr ); + SbiExprNode( const SbiSymDef&, SbxDataType, SbiExprListPtr = nullptr ); SbiExprNode( SbiExprNode*, SbiToken, SbiExprNode* ); SbiExprNode( SbiExprNode*, sal_uInt16 ); // #120061 TypeOf SbiExprNode( sal_uInt16 ); // new <type> @@ -186,7 +187,7 @@ public: SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR, SbiExprMode eMode = EXPRMODE_STANDARD, const KeywordSymbolInfo* pKeywordSymbolInfo = nullptr ); // parsing Ctor SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE ); - SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = nullptr ); + SbiExpression( SbiParser*, const SbiSymDef&, SbiExprListPtr = nullptr ); ~SbiExpression(); OUString& GetName() { return aArgName; } void SetBased() { bBased = true; } @@ -224,8 +225,8 @@ class SbiExprList final { // class for parameters and dims public: SbiExprList(); ~SbiExprList(); - static SbiExprList* ParseParameters(SbiParser*, bool bStandaloneExpression = false, bool bPar = true); - static SbiExprList* ParseDimList( SbiParser* ); + static SbiExprListPtr ParseParameters(SbiParser*, bool bStandaloneExpression = false, bool bPar = true); + static SbiExprListPtr ParseDimList( SbiParser* ); bool IsBracket() { return bBracket; } bool IsValid() { return !bError; } short GetSize() { return aData.size(); } diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 21e697181658..96683f56a3f5 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -44,7 +44,7 @@ class SbiParser : public SbiTokenizer bool bSingleLineIf; bool bCodeCompleting; - SbiSymDef* VarDecl( SbiExprList**, bool, bool ); + SbiSymDef* VarDecl( SbiExprListPtr*, bool, bool ); SbiProcDef* ProcDecl(bool bDecl); void DefStatic( bool bPrivate ); void DefProc( bool bStatic, bool bPrivate ); // read in procedure |