convert HTMLScriptLanguage to scoped enum
Change-Id: If87863b520da704410a6ad261330bbde7ef8008c
This commit is contained in:
@@ -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<typename EnumT>
|
||||
|
@@ -28,10 +28,10 @@
|
||||
// Table for converting option values into strings
|
||||
static HTMLOptionEnum<HTMLScriptLanguage> 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;
|
||||
|
||||
|
@@ -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() )
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user