From 1cbef3eb084b78734165f79854b58afc860bac1c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 6 Mar 2017 09:30:34 +0200 Subject: [PATCH] convert HTMLScriptLanguage to scoped enum Change-Id: If87863b520da704410a6ad261330bbde7ef8008c --- include/svtools/parhtml.hxx | 8 ++++---- svtools/source/svhtml/htmlsupp.cxx | 12 ++++++------ sw/source/filter/html/htmlbas.cxx | 4 ++-- sw/source/filter/html/swhtml.cxx | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx index a46f07f4b8ca..f2a77311d65a 100644 --- a/include/svtools/parhtml.hxx +++ b/include/svtools/parhtml.hxx @@ -65,11 +65,11 @@ enum HTMLInputType HTML_IT_BUTTON = 0x0c }; -enum HTMLScriptLanguage +enum class HTMLScriptLanguage { - HTML_SL_STARBASIC, - HTML_SL_JAVASCRIPT, - HTML_SL_UNKNOWN + StarBasic, + JavaScript, + Unknown }; template diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index e1c9d5dd9b2c..d60c5d575451 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -28,10 +28,10 @@ // Table for converting option values into strings static HTMLOptionEnum const aScriptLangOptEnums[] = { - { OOO_STRING_SVTOOLS_HTML_LG_starbasic, HTML_SL_STARBASIC }, - { OOO_STRING_SVTOOLS_HTML_LG_javascript, HTML_SL_JAVASCRIPT }, - { OOO_STRING_SVTOOLS_HTML_LG_javascript11, HTML_SL_JAVASCRIPT }, - { OOO_STRING_SVTOOLS_HTML_LG_livescript, HTML_SL_JAVASCRIPT }, + { OOO_STRING_SVTOOLS_HTML_LG_starbasic, HTMLScriptLanguage::StarBasic }, + { OOO_STRING_SVTOOLS_HTML_LG_javascript, HTMLScriptLanguage::JavaScript }, + { OOO_STRING_SVTOOLS_HTML_LG_javascript11, HTMLScriptLanguage::JavaScript }, + { OOO_STRING_SVTOOLS_HTML_LG_livescript, HTMLScriptLanguage::JavaScript }, { nullptr, (HTMLScriptLanguage)0 } }; @@ -44,7 +44,7 @@ void HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBas const HTMLOptions& aScriptOptions = GetOptions(); rLangString.clear(); - rLang = HTML_SL_JAVASCRIPT; + rLang = HTMLScriptLanguage::JavaScript; rSrc.clear(); rLibrary.clear(); rModule.clear(); @@ -61,7 +61,7 @@ void HTMLParser::ParseScriptOptions( OUString& rLangString, const OUString& rBas if( aOption.GetEnum( nLang, aScriptLangOptEnums ) ) rLang = (HTMLScriptLanguage)nLang; else - rLang = HTML_SL_UNKNOWN; + rLang = HTMLScriptLanguage::Unknown; } break; diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx index 539c07dd5c27..f2b0e98e8a8d 100644 --- a/sw/source/filter/html/htmlbas.cxx +++ b/sw/source/filter/html/htmlbas.cxx @@ -77,7 +77,7 @@ void SwHTMLParser::EndScript() switch( m_eScriptLang ) { - case HTML_SL_STARBASIC: + case HTMLScriptLanguage::StarBasic: bInsIntoBasic = true; break; default: @@ -184,7 +184,7 @@ void SwHTMLParser::AddScriptSource() { // We'll just remember a few strings here if( aToken.getLength() > 2 && - (HTML_SL_STARBASIC==m_eScriptLang && aToken[ 0 ] == '\'') ) + (HTMLScriptLanguage::StarBasic==m_eScriptLang && aToken[ 0 ] == '\'') ) { sal_Int32 nPos = -1; if( m_aBasicLib.isEmpty() ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 95fb0b6163a4..e835bc70d568 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -301,7 +301,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn, m_nEventId = nullptr; m_bUpperSpace = m_bViewCreated = m_bChkJumpMark = false; - m_eScriptLang = HTML_SL_UNKNOWN; + m_eScriptLang = HTMLScriptLanguage::Unknown; rCursor.DeleteMark(); m_pPam = &rCursor; // re-use existing cursor: avoids spurious ~SwIndexReg assert