diff options
author | Gabor Kelemen <kelemen.gabor2@nisz.hu> | 2019-01-13 15:13:32 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-16 07:20:49 +0100 |
commit | e48e063254caa7eb26b5c3c50fd64236d59ed553 (patch) | |
tree | df7519af69e3d8c016cf1d0823bc1365afacc6ce /basic | |
parent | b0f3f3094cb3944945dcd59e7fd44f7fe0b433b7 (diff) |
o3tl::make_unique -> std::make_unique in basctl...bridges
Since it is now possible to use C++14, it's time to replace
the temporary solution with the standard one
Change-Id: I9a20a58c68d12656359dcaa060d8ab41f621af32
Reviewed-on: https://gerrit.libreoffice.org/66262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 1 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 3 | ||||
-rw-r--r-- | basic/source/comp/exprtree.cxx | 69 | ||||
-rw-r--r-- | basic/source/comp/parser.cxx | 5 | ||||
-rw-r--r-- | basic/source/comp/sbcomp.cxx | 3 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 5 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 5 | ||||
-rw-r--r-- | basic/source/sbx/sbxbase.cxx | 3 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 4 |
9 files changed, 44 insertions, 54 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 0cd4123cf5b6..92d94a423334 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -32,7 +32,6 @@ #include <tools/diagnose_ex.h> #include <basic/sbmod.hxx> #include <unotools/intlwrapper.hxx> -#include <o3tl/make_unique.hxx> #include <sal/log.hxx> #include <basic/sbuno.hxx> diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index f3c276d88003..2daadfad2c04 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -20,7 +20,6 @@ #include <sal/config.h> #include <o3tl/any.hxx> -#include <o3tl/make_unique.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/errcode.hxx> @@ -4646,7 +4645,7 @@ void SbUnoStructRefObject::initMemberCache() for ( sal_Int32 nPos = pCompTypeDescr->nMembers; nPos--; ) { OUString aName( ppNames[nPos] ); - maFields[ aName ] = o3tl::make_unique<StructRefInfo>( maMemberInfo.getRootAnyRef(), ppTypeRefs[nPos], maMemberInfo.getPos() + pMemberOffsets[nPos] ); + maFields[ aName ] = std::make_unique<StructRefInfo>( maMemberInfo.getRootAnyRef(), ppTypeRefs[nPos], maMemberInfo.getPos() + pMemberOffsets[nPos] ); } } typelib_typedescription_release(pTD); diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index ed7f49e1b4e0..68345a5e5636 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -22,7 +22,6 @@ #include <parser.hxx> #include <basic/sbx.hxx> #include <expr.hxx> -#include <o3tl/make_unique.hxx> SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo ) @@ -54,7 +53,7 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) nParenLevel = 0; eCurExpr = SbOPERAND; m_eMode = EXPRMODE_STANDARD; - pExpr = o3tl::make_unique<SbiExprNode>( n, t ); + pExpr = std::make_unique<SbiExprNode>( n, t ); pExpr->Optimize(pParser); } @@ -65,7 +64,7 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprListPtr p nParenLevel = 0; eCurExpr = SbOPERAND; m_eMode = EXPRMODE_STANDARD; - pExpr = o3tl::make_unique<SbiExprNode>( r, SbxVARIANT, std::move(pPar) ); + pExpr = std::make_unique<SbiExprNode>( r, SbxVARIANT, std::move(pPar) ); } SbiExpression::~SbiExpression() { } @@ -179,7 +178,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Term( const KeywordSymbolInfo* pKeyw if( !pNd ) { pParser->Error( ERRCODE_BASIC_UNEXPECTED, DOT ); - pNd = o3tl::make_unique<SbiExprNode>( 1.0, SbxDOUBLE ); + pNd = std::make_unique<SbiExprNode>( 1.0, SbxDOUBLE ); } return pNd; } @@ -199,7 +198,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Term( const KeywordSymbolInfo* pKeyw if( eNextTok == ASSIGN ) { pParser->UnlockColumn(); - return o3tl::make_unique<SbiExprNode>( aSym ); + return std::make_unique<SbiExprNode>( aSym ); } // no keywords allowed from here on! if( SbiTokenizer::IsKwd( eTok ) @@ -291,11 +290,11 @@ std::unique_ptr<SbiExprNode> SbiExpression::Term( const KeywordSymbolInfo* pKeyw pvMoreParLcl.reset(); if( pConst->GetType() == SbxSTRING ) { - return o3tl::make_unique<SbiExprNode>( pConst->GetString() ); + return std::make_unique<SbiExprNode>( pConst->GetString() ); } else { - return o3tl::make_unique<SbiExprNode>( pConst->GetValue(), pConst->GetType() ); + return std::make_unique<SbiExprNode>( pConst->GetValue(), pConst->GetType() ); } } @@ -496,24 +495,24 @@ std::unique_ptr<SbiExprNode> SbiExpression::Operand( bool bUsedForTypeOf ) if( !bUsedForTypeOf && pParser->IsVBASupportOn() && pParser->Peek() == IS ) { eTok = pParser->Next(); - pRes = o3tl::make_unique<SbiExprNode>( std::move(pRes), eTok, Like() ); + pRes = std::make_unique<SbiExprNode>( std::move(pRes), eTok, Like() ); } break; case DOT: // .with pRes = Term(); break; case NUMBER: pParser->Next(); - pRes = o3tl::make_unique<SbiExprNode>( pParser->GetDbl(), pParser->GetType() ); + pRes = std::make_unique<SbiExprNode>( pParser->GetDbl(), pParser->GetType() ); break; case FIXSTRING: pParser->Next(); - pRes = o3tl::make_unique<SbiExprNode>( pParser->GetSym() ); break; + pRes = std::make_unique<SbiExprNode>( pParser->GetSym() ); break; case LPAREN: pParser->Next(); if( nParenLevel == 0 && m_eMode == EXPRMODE_LPAREN_PENDING && pParser->Peek() == RPAREN ) { m_eMode = EXPRMODE_EMPTY_PAREN; - pRes = o3tl::make_unique<SbiExprNode>(); // Dummy node + pRes = std::make_unique<SbiExprNode>(); // Dummy node pParser->Next(); break; } @@ -558,7 +557,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Operand( bool bUsedForTypeOf ) else { pParser->Next(); - pRes = o3tl::make_unique<SbiExprNode>( 1.0, SbxDOUBLE ); + pRes = std::make_unique<SbiExprNode>( 1.0, SbxDOUBLE ); pParser->Error( ERRCODE_BASIC_UNEXPECTED, eTok ); } break; @@ -575,7 +574,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Unary() case MINUS: eTok = NEG; pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( Unary(), eTok, nullptr ); + pNd = std::make_unique<SbiExprNode>( Unary(), eTok, nullptr ); break; case NOT: if( pParser->IsVBASupportOn() ) @@ -585,7 +584,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Unary() else { pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( Unary(), eTok, nullptr ); + pNd = std::make_unique<SbiExprNode>( Unary(), eTok, nullptr ); } break; case PLUS: @@ -599,7 +598,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Unary() pParser->TestToken( IS ); SbiSymDef* pTypeDef = new SbiSymDef( OUString() ); pParser->TypeDecl( *pTypeDef, true ); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pObjNode), pTypeDef->GetTypeId() ); + pNd = std::make_unique<SbiExprNode>( std::move(pObjNode), pTypeDef->GetTypeId() ); break; } case NEW: @@ -607,7 +606,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Unary() pParser->Next(); SbiSymDef* pTypeDef = new SbiSymDef( OUString() ); pParser->TypeDecl( *pTypeDef, true ); - pNd = o3tl::make_unique<SbiExprNode>( pTypeDef->GetTypeId() ); + pNd = std::make_unique<SbiExprNode>( pTypeDef->GetTypeId() ); break; } default: @@ -624,7 +623,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Exp() while( pParser->Peek() == EXPON ) { SbiToken eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Unary() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Unary() ); } } return pNd; @@ -643,7 +642,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::MulDiv() break; } eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Exp() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Exp() ); } } return pNd; @@ -657,7 +656,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::IntDiv() while( pParser->Peek() == IDIV ) { SbiToken eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, MulDiv() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, MulDiv() ); } } return pNd; @@ -671,7 +670,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Mod() while( pParser->Peek() == MOD ) { SbiToken eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, IntDiv() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, IntDiv() ); } } return pNd; @@ -690,7 +689,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::AddSub() break; } eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Mod() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Mod() ); } } return pNd; @@ -709,7 +708,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Cat() break; } eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, AddSub() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, AddSub() ); } } return pNd; @@ -734,7 +733,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Comp() break; } eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Cat() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Cat() ); nCount++; } } @@ -750,7 +749,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::VBA_Not() if( eTok == NOT ) { pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( VBA_Not(), eTok, nullptr ); + pNd = std::make_unique<SbiExprNode>( VBA_Not(), eTok, nullptr ); } else { @@ -768,7 +767,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Like() while( pParser->Peek() == LIKE ) { SbiToken eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Comp() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Comp() ); nCount++; } // multiple operands in a row does not work @@ -796,7 +795,7 @@ std::unique_ptr<SbiExprNode> SbiExpression::Boolean() break; } eTok = pParser->Next(); - pNd = o3tl::make_unique<SbiExprNode>( std::move(pNd), eTok, Like() ); + pNd = std::make_unique<SbiExprNode>( std::move(pNd), eTok, Like() ); } } return pNd; @@ -840,7 +839,7 @@ SbiConstExpression::SbiConstExpression( SbiParser* p ) : SbiExpression( p ) if( bIsBool ) { - pExpr = o3tl::make_unique<SbiExprNode>( (bBoolVal ? SbxTRUE : SbxFALSE), SbxINTEGER ); + pExpr = std::make_unique<SbiExprNode>( (bBoolVal ? SbxTRUE : SbxFALSE), SbxINTEGER ); eType = pExpr->GetType(); nVal = pExpr->nVal; } @@ -919,7 +918,7 @@ void SbiExprList::addExpression( std::unique_ptr<SbiExpression>&& pExpr ) //SbiParameters::SbiParameters( SbiParser* p, sal_Bool bConst, sal_Bool bPar) : SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandaloneExpression, bool bPar) { - auto pExprList = o3tl::make_unique<SbiExprList>(); + auto pExprList = std::make_unique<SbiExprList>(); if( !bPar ) { return pExprList; @@ -959,7 +958,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon // missing argument if( eTok == COMMA ) { - pExpr = o3tl::make_unique<SbiExpression>( pParser, 0, SbxEMPTY ); + pExpr = std::make_unique<SbiExpression>( pParser, 0, SbxEMPTY ); } // named arguments: either .name= or name:= else @@ -974,7 +973,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon if( bAssumeExprLParenMode ) { - pExpr = o3tl::make_unique<SbiExpression>( pParser, SbSTDEXPR, EXPRMODE_LPAREN_PENDING ); + pExpr = std::make_unique<SbiExpression>( pParser, SbSTDEXPR, EXPRMODE_LPAREN_PENDING ); bAssumeExprLParenMode = false; SbiExprMode eModeAfter = pExpr->m_eMode; @@ -999,7 +998,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon } else { - pExpr = o3tl::make_unique<SbiExpression>( pParser ); + pExpr = std::make_unique<SbiExpression>( pParser ); } if( bByVal && pExpr->IsLvalue() ) { @@ -1014,7 +1013,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon // SbiExpression::Term() has made as string out of it aName = pExpr->GetString(); pParser->Next(); - pExpr = o3tl::make_unique<SbiExpression>( pParser ); + pExpr = std::make_unique<SbiExpression>( pParser ); } pExpr->GetName() = aName; } @@ -1065,7 +1064,7 @@ SbiExprListPtr SbiExprList::ParseParameters( SbiParser* pParser, bool bStandalon SbiExprListPtr SbiExprList::ParseDimList( SbiParser* pParser ) { - auto pExprList = o3tl::make_unique<SbiExprList>(); + auto pExprList = std::make_unique<SbiExprList>(); if( pParser->Next() != LPAREN ) { @@ -1078,11 +1077,11 @@ SbiExprListPtr SbiExprList::ParseDimList( SbiParser* pParser ) SbiToken eTok; for( ;; ) { - auto pExpr1 = o3tl::make_unique<SbiExpression>( pParser ); + auto pExpr1 = std::make_unique<SbiExpression>( pParser ); eTok = pParser->Next(); if( eTok == TO ) { - auto pExpr2 = o3tl::make_unique<SbiExpression>( pParser ); + auto pExpr2 = std::make_unique<SbiExpression>( pParser ); pExpr1->ConvertToIntConstIfPossible(); pExpr2->ConvertToIntConstIfPossible(); eTok = pParser->Next(); diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index fcf524a8057a..44eb2efcbc2f 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -22,7 +22,6 @@ #include <com/sun/star/script/ModuleType.hpp> #include <svtools/miscopt.hxx> #include <rtl/character.hxx> -#include <o3tl/make_unique.hxx> struct SbiParseStack { // "Stack" for statement-blocks SbiParseStack* pNext; // Chain @@ -508,10 +507,10 @@ void SbiParser::Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo ) if( nParCount == 2 || nParCount == 3 ) { if( nParCount == 2 ) - pPar->addExpression( o3tl::make_unique<SbiExpression>( this, -1, SbxLONG ) ); + pPar->addExpression( std::make_unique<SbiExpression>( this, -1, SbxLONG ) ); TestToken( EQ ); - pPar->addExpression( o3tl::make_unique<SbiExpression>( this ) ); + pPar->addExpression( std::make_unique<SbiExpression>( this ) ); bSpecialMidHandling = true; } diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index bd789433be6f..a13b85fdd2ab 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -25,7 +25,6 @@ #include <svtools/miscopt.hxx> #include <rtl/character.hxx> #include <memory> -#include <o3tl/make_unique.hxx> // This routine is defined here, so that the // compiler can be loaded as a discrete segment. @@ -42,7 +41,7 @@ bool SbModule::Compile() SbModule* pOld = GetSbData()->pCompMod; GetSbData()->pCompMod = this; - auto pParser = o3tl::make_unique<SbiParser>( pBasic, this ); + auto pParser = std::make_unique<SbiParser>( pBasic, this ); while( pParser->Parse() ) {} if( !pParser->GetErrors() ) pParser->aGen.Save(); diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 351cdaa818e5..aa7ce59e949f 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -26,7 +26,6 @@ #include <stdio.h> #include <string.h> #include <rtl/character.hxx> -#include <o3tl/make_unique.hxx> // All symbol names are laid down int the symbol-pool's stringpool, so that // all symbols are handled in the same case. On saving the code-image, the @@ -352,7 +351,7 @@ SbiSymPool& SbiSymDef::GetPool() { if( !pPool ) { - pPool = o3tl::make_unique<SbiSymPool>( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser );// is dumped + pPool = std::make_unique<SbiSymPool>( pIn->pParser->aGblStrings, SbLOCAL, pIn->pParser );// is dumped } return *pPool; } @@ -378,7 +377,7 @@ SbiProcDef::SbiProcDef( SbiParser* pParser, const OUString& rName, , mbProcDecl( bProcDecl ) { aParams.SetParent( &pParser->aPublics ); - pPool = o3tl::make_unique<SbiSymPool>( pParser->aGblStrings, SbLOCAL, pParser ); + pPool = std::make_unique<SbiSymPool>( pParser->aGblStrings, SbLOCAL, pParser ); pPool->SetParent( &aParams ); nLine1 = nLine2 = 0; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 0ecced15e6b3..3a6bbc2715a5 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -65,7 +65,6 @@ #include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp> #include <memory> #include <random> -#include <o3tl/make_unique.hxx> #include <o3tl/char16_t2wchar_t.hxx> using namespace comphelper; @@ -2567,7 +2566,7 @@ static OUString implSetupWildcard(const OUString& rFileParam, SbiRTLData& rRTLDa // invalid anyway because it was not accepted by OSL before if (aPureFileName != "*") { - rRTLData.pWildCard = o3tl::make_unique<WildCard>(aPureFileName); + rRTLData.pWildCard = std::make_unique<WildCard>(aPureFileName); } return aPathStr; } @@ -2798,7 +2797,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) // Read directory bool bIncludeFolders = bool(nFlags & SbAttributes::DIRECTORY); - rRTLData.pDir = o3tl::make_unique<Directory>(aDirURL); + rRTLData.pDir = std::make_unique<Directory>(aDirURL); FileBase::RC nRet = rRTLData.pDir->open(); if( nRet != FileBase::E_None ) { diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 5b68b90e32ec..6090643955d0 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -18,7 +18,6 @@ */ #include <memory> -#include <o3tl/make_unique.hxx> #include <tools/debug.hxx> #include <tools/stream.hxx> #include <vcl/svapp.hxx> @@ -280,7 +279,7 @@ SbxInfo::~SbxInfo() void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags) { - m_Params.push_back(o3tl::make_unique<SbxParamInfo>(rName, eType, nFlags)); + m_Params.push_back(std::make_unique<SbxParamInfo>(rName, eType, nFlags)); } const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 6b785b3fdca8..f0c75478c6a5 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -50,8 +50,6 @@ #include <sal/log.hxx> #include <svl/zforlist.hxx> -#include <o3tl/make_unique.hxx> - void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep, sal_Unicode& rcDecimalSepAlt ) { @@ -858,7 +856,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const OUString aFalseStrg = BasResId(STR_BASICKEY_FORMAT_FALSE); OUString aCurrencyFormatStrg = BasResId(STR_BASICKEY_FORMAT_CURRENCY); - rAppData.pBasicFormater = o3tl::make_unique<SbxBasicFormater>( + rAppData.pBasicFormater = std::make_unique<SbxBasicFormater>( cComma,c1000,aOnStrg,aOffStrg, aYesStrg,aNoStrg,aTrueStrg,aFalseStrg, aCurrencyStrg,aCurrencyFormatStrg ); |