From c48ad62924754025266f6ed3986beac44d1c2452 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 20 Apr 2017 15:47:57 +0200 Subject: convert HTML_OPTION_IDS to scoped enum Change-Id: Ia766dc58a571e5853005fd394283d7b53f02e4a6 Reviewed-on: https://gerrit.libreoffice.org/36748 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/ui/misc/HtmlReader.cxx | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'dbaccess/source') diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 62e3d8e04925..43c96c8aba4e 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -134,13 +134,9 @@ void OHTMLReader::NextToken( int nToken ) const HTMLOptions& rHtmlOptions = GetOptions(); for (const auto & rOption : rHtmlOptions) { - switch( rOption.GetToken() ) - { - case HTML_O_WIDTH: - { // percentage: of document width respectively outer cell - m_nColumnWidth = GetWidthPixel( rOption ); - } - break; + if( rOption.GetToken() == HtmlOptionId::WIDTH ) + { // percentage: of document width respectively outer cell + m_nColumnWidth = GetWidthPixel( rOption ); } } } @@ -292,15 +288,16 @@ void OHTMLReader::fetchOptions() { switch( rOption.GetToken() ) { - case HTML_O_SDVAL: + case HtmlOptionId::SDVAL: { m_sValToken = rOption.GetString(); m_bSDNum = true; } break; - case HTML_O_SDNUM: + case HtmlOptionId::SDNUM: m_sNumToken = rOption.GetString(); break; + default: break; } } } @@ -312,7 +309,7 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal) { switch( rOption.GetToken() ) { - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: { const OUString& rOptVal = rOption.GetString(); if (rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_right )) @@ -325,9 +322,10 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal) eVal = SvxCellHorJustify::Standard; } break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: m_nWidth = GetWidthPixel( rOption ); break; + default: break; } } } @@ -339,14 +337,14 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor) { switch( rOption.GetToken() ) { - case HTML_O_COLOR: + case HtmlOptionId::COLOR: { Color aColor; rOption.GetColor( aColor ); _rTextColor = aColor.GetRGBColor(); } break; - case HTML_O_FACE : + case HtmlOptionId::FACE : { const OUString& rFace = rOption.GetString(); OUString aFontName; @@ -364,7 +362,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor) _rFont.Name = aFontName; } break; - case HTML_O_SIZE : + case HtmlOptionId::SIZE : { sal_Int16 nSize = (sal_Int16) rOption.GetNumber(); if ( nSize == 0 ) @@ -375,6 +373,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor) _rFont.Height = nSize; } break; + default: break; } } } -- cgit