diff options
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/lex.hxx | 28 | ||||
-rw-r--r-- | idl/source/cmptools/lex.cxx | 10 |
2 files changed, 19 insertions, 19 deletions
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx index ffcb0c91ee30..d9a09182635a 100644 --- a/idl/inc/lex.hxx +++ b/idl/inc/lex.hxx @@ -20,11 +20,11 @@ #ifndef INCLUDED_IDL_INC_LEX_HXX #define INCLUDED_IDL_INC_LEX_HXX -#include <boost/ptr_container/ptr_vector.hpp> - #include <sal/types.h> #include <hash.hxx> #include <tools/stream.hxx> +#include <vector> +#include <memory> enum SVTOKEN_ENUM { SVTOKEN_EMPTY, SVTOKEN_COMMENT, SVTOKEN_INTEGER, SVTOKEN_STRING, @@ -132,8 +132,8 @@ class SvTokenStream SvFileStream * pInStream; SvStream & rInStream; OUString aFileName; - boost::ptr_vector<SvToken> aTokList; - boost::ptr_vector<SvToken>::iterator pCurToken; + std::vector<std::unique_ptr<SvToken> > aTokList; + std::vector<std::unique_ptr<SvToken> >::iterator pCurToken; OString aBufStr; @@ -178,25 +178,25 @@ public: SvToken* GetToken_PrevAll() { - boost::ptr_vector<SvToken>::iterator pRetToken = pCurToken; + std::vector<std::unique_ptr<SvToken> >::iterator pRetToken = pCurToken; // current iterator always valid if(pCurToken != aTokList.begin()) --pCurToken; - return &(*pRetToken); + return (*pRetToken).get(); } SvToken* GetToken_NextAll() { - boost::ptr_vector<SvToken>::iterator pRetToken = pCurToken++; + std::vector<std::unique_ptr<SvToken> >::iterator pRetToken = pCurToken++; if (pCurToken == aTokList.end()) pCurToken = pRetToken; SetMax(); - return &(*pRetToken); + return (*pRetToken).get(); } SvToken* GetToken_Next() @@ -205,12 +205,12 @@ public: return GetToken_NextAll(); } - SvToken& GetToken() const { return *pCurToken; } + SvToken& GetToken() const { return *(*pCurToken).get(); } bool Read( char cChar ) { - if( pCurToken->IsChar() - && cChar == pCurToken->GetChar() ) + if( (*pCurToken)->IsChar() + && cChar == (*pCurToken)->GetChar() ) { GetToken_Next(); return true; @@ -221,9 +221,9 @@ public: void ReadDelemiter() { - if( pCurToken->IsChar() - && (';' == pCurToken->GetChar() - || ',' == pCurToken->GetChar()) ) + if( (*pCurToken)->IsChar() + && (';' == (*pCurToken)->GetChar() + || ',' == (*pCurToken)->GetChar()) ) { GetToken_Next(); } diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 84737e28df2c..85575113fda3 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -119,7 +119,7 @@ SvTokenStream::~SvTokenStream() void SvTokenStream::FillTokenList() { SvToken * pToken = new SvToken(); - aTokList.push_back(pToken); + aTokList.push_back(std::unique_ptr<SvToken>(pToken)); do { if( !MakeToken( *pToken ) ) @@ -127,10 +127,10 @@ void SvTokenStream::FillTokenList() if (!aTokList.empty()) { *pToken = SvToken(); - boost::ptr_vector<SvToken>::const_iterator it = aTokList.begin(); + std::vector<std::unique_ptr<SvToken> >::const_iterator it = aTokList.begin(); - pToken->SetLine(it->GetLine()); - pToken->SetColumn(it->GetColumn()); + pToken->SetLine((*it)->GetLine()); + pToken->SetColumn((*it)->GetColumn()); } break; } @@ -141,7 +141,7 @@ void SvTokenStream::FillTokenList() else { pToken = new SvToken(); - aTokList.push_back(pToken); + aTokList.push_back(std::unique_ptr<SvToken>(pToken)); } } while( !pToken->IsEof() ); |