diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-11 15:19:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-12 09:13:43 +0200 |
commit | e60296840bf9da3f61a3cce02e1369e4315354b3 (patch) | |
tree | ca293c474955b19750b42f0208da7c8c9052cc47 /idl | |
parent | 62225eeb9832b982023dca6c5ce2bc64ac92728f (diff) |
move parsing of "import" into own method
Change-Id: Ib3b3fb6fea52b846ada6fb92478ae8f9f769a665
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/parser.hxx | 1 | ||||
-rw-r--r-- | idl/source/prj/parser.cxx | 46 |
2 files changed, 27 insertions, 20 deletions
diff --git a/idl/inc/parser.hxx b/idl/inc/parser.hxx index 8a15bb48a7bc..97cb3d50d29d 100644 --- a/idl/inc/parser.hxx +++ b/idl/inc/parser.hxx @@ -32,6 +32,7 @@ class SvIdlParser public: SvIdlParser( SvIdlDataBase& rBase_, SvTokenStream & rInStrm_) : rBase(rBase_), rInStm(rInStrm_) {} bool ReadSvIdl( bool bImported, const OUString & rPath ); + bool ReadModuleImport(const OUString & rPath); }; diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index 34820f2f75a7..065c3e200949 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -32,26 +32,7 @@ bool SvIdlParser::ReadSvIdl( bool bImported, const OUString & rPath ) // only one import at the very beginning if( rTok.Is( SvHash_import() ) ) { - rTok = rInStm.GetToken_Next(); - if( rTok.IsString() ) - { - OUString aFullName; - if( osl::FileBase::E_None == osl::File::searchFileURL( - OStringToOUString(rTok.GetString(), RTL_TEXTENCODING_ASCII_US), - rPath, - aFullName) ) - { - osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName ); - rBase.AddDepFile(aFullName); - SvTokenStream aTokStm( aFullName ); - SvIdlParser aInputParser(rBase, aTokStm); - bOk = aInputParser.ReadSvIdl( true, rPath ); - } - else - bOk = false; - } - else - bOk = false; + bOk = ReadModuleImport(rPath); } while( bOk ) @@ -80,4 +61,29 @@ bool SvIdlParser::ReadSvIdl( bool bImported, const OUString & rPath ) return true; } +bool SvIdlParser::ReadModuleImport(const OUString & rPath) +{ + SvToken& rTok = rInStm.GetToken_Next(); + bool bOk = true; + if( rTok.IsString() ) + { + OUString aFullName; + if( osl::FileBase::E_None == osl::File::searchFileURL( + OStringToOUString(rTok.GetString(), RTL_TEXTENCODING_ASCII_US), + rPath, + aFullName) ) + { + osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName ); + rBase.AddDepFile(aFullName); + SvTokenStream aTokStm( aFullName ); + SvIdlParser aInputParser(rBase, aTokStm); + bOk = aInputParser.ReadSvIdl( true, rPath ); + } + else + bOk = false; + } + else + bOk = false; + return bOk; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |