diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 08:52:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-21 08:42:30 +0200 |
commit | 528632660b72b105345945c13c5b68060d94a91b (patch) | |
tree | 860508d482959abeb9175f0ce6b9e65954269f95 /basic/source/comp/scanner.cxx | |
parent | aee66aa85e75f67135e5c6079a281e18402d261a (diff) |
convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this
is a modified copy, but there are lots of convenience accessors
which are nice to define on the class.
Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a
Reviewed-on: https://gerrit.libreoffice.org/38497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/source/comp/scanner.cxx')
-rw-r--r-- | basic/source/comp/scanner.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index e906cfb19c52..48072debbd15 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -85,15 +85,14 @@ void SbiScanner::GenError( ErrCode code ) // in case of EXPECTED or UNEXPECTED it always refers // to the last token, so take the Col1 over sal_Int32 nc = nColLock ? nSavedCol1 : nCol1; - switch( code ) + if ( code.anyOf( + ERRCODE_BASIC_EXPECTED, + ERRCODE_BASIC_UNEXPECTED, + ERRCODE_BASIC_SYMBOL_EXPECTED, + ERRCODE_BASIC_LABEL_EXPECTED) ) { - case ERRCODE_BASIC_EXPECTED: - case ERRCODE_BASIC_UNEXPECTED: - case ERRCODE_BASIC_SYMBOL_EXPECTED: - case ERRCODE_BASIC_LABEL_EXPECTED: nc = nCol1; if( nc > nCol2 ) nCol2 = nc; - break; } bRes = pBasic->CError( code, aError, nLine, nc, nCol2 ); } |