summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-02-24 11:47:30 +0200
committerNoel Grandin <noel@peralex.com>2016-02-24 11:48:39 +0200
commitf163745cca6627fd8de0a089a8c30b3c6e17193f (patch)
tree30ff0edc1772cad1a96dd6bf3c02a6a8e34dd8f0 /comphelper
parenta5e53f9ffdde320a7ba104a1e01b3f5ef75d7975 (diff)
convert HighlighterLanguage to scoped enum
Change-Id: Ibf0871601e52ea4fa49e9622176431943c55abdd
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/qa/unit/syntaxhighlighttest.cxx12
-rw-r--r--comphelper/source/misc/syntaxhighlight.cxx6
2 files changed, 9 insertions, 9 deletions
diff --git a/comphelper/qa/unit/syntaxhighlighttest.cxx b/comphelper/qa/unit/syntaxhighlighttest.cxx
index 848c741c3f2f..47289db28340 100644
--- a/comphelper/qa/unit/syntaxhighlighttest.cxx
+++ b/comphelper/qa/unit/syntaxhighlighttest.cxx
@@ -45,7 +45,7 @@ std::ostream& operator<<(std::ostream& rStrm, const TokenType& tt)
void SyntaxHighlightTest::testBasicString() {
OUString s("\"foo\"");
std::vector<HighlightPortion> ps;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(s, ps);
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(s, ps);
CPPUNIT_ASSERT_EQUAL(
static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin);
@@ -56,7 +56,7 @@ void SyntaxHighlightTest::testBasicString() {
void SyntaxHighlightTest::testBasicComment() {
OUString s("' foo");
std::vector<HighlightPortion> ps;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(s, ps);
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(s, ps);
CPPUNIT_ASSERT_EQUAL(
static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin);
@@ -67,7 +67,7 @@ void SyntaxHighlightTest::testBasicComment() {
void SyntaxHighlightTest::testBasicCommentNewline() {
OUString s("' foo\n");
std::vector<HighlightPortion> ps;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(s, ps);
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(s, ps);
CPPUNIT_ASSERT_EQUAL(
static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin);
@@ -81,7 +81,7 @@ void SyntaxHighlightTest::testBasicCommentNewline() {
void SyntaxHighlightTest::testBasicEmptyComment() {
OUString s("'");
std::vector<HighlightPortion> ps;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(s, ps);
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(s, ps);
CPPUNIT_ASSERT_EQUAL(
static_cast<std::vector<HighlightPortion>::size_type>(1), ps.size());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin);
@@ -92,7 +92,7 @@ void SyntaxHighlightTest::testBasicEmptyComment() {
void SyntaxHighlightTest::testBasicEmptyCommentNewline() {
OUString s("'\n");
std::vector<HighlightPortion> ps;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(s, ps);
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(s, ps);
CPPUNIT_ASSERT_EQUAL(
static_cast<std::vector<HighlightPortion>::size_type>(2), ps.size());
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), ps[0].nBegin);
@@ -108,7 +108,7 @@ void SyntaxHighlightTest::testBasic()
OUString aBasicString(" if Mid(sText,iRun,1 )<> \" \" then Mid( sText ,iRun, 1, Chr( 1 + Asc( Mid(sText,iRun,1 )) ) '");
std::vector<HighlightPortion> aPortions;
- SyntaxHighlighter(HIGHLIGHT_BASIC).getHighlightPortions(
+ SyntaxHighlighter(HighlighterLanguage::Basic).getHighlightPortions(
aBasicString, aPortions );
sal_Int32 prevEnd = 0;
diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx
index 639a957168c7..ac4dd704e7da 100644
--- a/comphelper/source/misc/syntaxhighlight.cxx
+++ b/comphelper/source/misc/syntaxhighlight.cxx
@@ -387,7 +387,7 @@ bool SyntaxHighlighter::Tokenizer::getNextToken(const sal_Unicode*& pos, /*out*/
// Operator?
// only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there
- else if ( testCharFlags( c, CHAR_OPERATOR ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
+ else if ( testCharFlags( c, CHAR_OPERATOR ) || ( (c == '\'') && (aLanguage==HighlighterLanguage::Basic)) )
{
// parameters for SQL view
if ( (c==':') || (c=='?'))
@@ -691,11 +691,11 @@ SyntaxHighlighter::SyntaxHighlighter(HighlighterLanguage language):
{
switch (eLanguage)
{
- case HIGHLIGHT_BASIC:
+ case HighlighterLanguage::Basic:
m_tokenizer->setKeyWords( strListBasicKeyWords,
sizeof( strListBasicKeyWords ) / sizeof( char* ));
break;
- case HIGHLIGHT_SQL:
+ case HighlighterLanguage::SQL:
m_tokenizer->setKeyWords( strListSqlKeyWords,
sizeof( strListSqlKeyWords ) / sizeof( char* ));
break;