diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-20 15:47:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-21 09:20:50 +0200 |
commit | c48ad62924754025266f6ed3986beac44d1c2452 (patch) | |
tree | 1647934028b04eaab4c52225e12e22060bfa7dd1 /sw | |
parent | 42b2c0042b04184c94fb7cba3f301d394d21274e (diff) |
convert HTML_OPTION_IDS to scoped enum
Change-Id: Ia766dc58a571e5853005fd394283d7b53f02e4a6
Reviewed-on: https://gerrit.libreoffice.org/36748
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlcss1.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/html/htmldrawreader.cxx | 29 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfld.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 147 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 110 | ||||
-rw-r--r-- | sw/source/filter/html/htmlnumreader.cxx | 36 | ||||
-rw-r--r-- | sw/source/filter/html/htmlplug.cxx | 131 | ||||
-rw-r--r-- | sw/source/filter/html/htmlsect.cxx | 36 | ||||
-rw-r--r-- | sw/source/filter/html/htmltab.cxx | 122 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 162 |
10 files changed, 417 insertions, 382 deletions
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index bc7ae7fc0b27..3daf8eab650d 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1671,7 +1671,7 @@ void SwHTMLParser::NewStyle() for (size_t i = rOptions2.size(); i; ) { const HTMLOption& rOption = rOptions2[--i]; - if( HTML_O_TYPE == rOption.GetToken() ) + if( HtmlOptionId::TYPE == rOption.GetToken() ) sType = rOption.GetString(); } @@ -1752,15 +1752,16 @@ void SwHTMLParser::InsertLink() const HTMLOption& rOption = rOptions2[--i]; switch( rOption.GetToken() ) { - case HTML_O_REL: + case HtmlOptionId::REL: sRel = rOption.GetString(); break; - case HTML_O_HREF: + case HtmlOptionId::HREF: sHRef = URIHelper::SmartRel2Abs( INetURLObject( m_sBaseURL ), rOption.GetString(), Link<OUString *, bool>(), false ); break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: sType = rOption.GetString(); break; + default: break; } } diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index 3778ba035adb..cc689bcda2c4 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -270,31 +270,31 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) { switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_BEHAVIOR: + case HtmlOptionId::BEHAVIOR: eAniKind = rOption.GetEnum( aHTMLMarqBehaviorTable, eAniKind ); break; - case HTML_O_BGCOLOR: + case HtmlOptionId::BGCOLOR: rOption.GetColor( aBGColor ); bBGColor = true; break; - case HTML_O_DIRECTION: + case HtmlOptionId::DIRECTION: eAniDir = rOption.GetEnum( aHTMLMarqDirectionTable, eAniDir ); bDirection = true; break; - case HTML_O_LOOP: + case HtmlOptionId::LOOP: if (rOption.GetString(). equalsIgnoreAsciiCase(OOO_STRING_SVTOOLS_HTML_LOOP_infinite)) { @@ -307,15 +307,15 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) } break; - case HTML_O_SCROLLAMOUNT: + case HtmlOptionId::SCROLLAMOUNT: nAmount = -((sal_Int16)rOption.GetNumber()); break; - case HTML_O_SCROLLDELAY: + case HtmlOptionId::SCROLLDELAY: nDelay = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: // erstmal nur als Pixelwerte merken! nWidth = rOption.GetNumber(); bPrcWidth = rOption.GetString().indexOf('%') != -1; @@ -323,30 +323,31 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) nWidth = 100; break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: // erstmal nur als Pixelwerte merken! nHeight = rOption.GetNumber(); if( rOption.GetString().indexOf('%') != -1 ) nHeight = 0; break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: // erstmal nur als Pixelwerte merken! aSpace.Height() = rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: // erstmal nur als Pixelwerte merken! aSpace.Width() = rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, text::VertOrientation::TOP ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable ); break; + default: break; } } diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 5901069b8791..b5ef5f9be9fe 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -218,32 +218,33 @@ void SwHTMLParser::NewField() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_TYPE: + case HtmlOptionId::TYPE: bKnownType = rOption.GetEnum( nType, aHTMLFieldTypeTable ); break; - case HTML_O_SUBTYPE: + case HtmlOptionId::SUBTYPE: pSubOption = &rOption; break; - case HTML_O_FORMAT: + case HtmlOptionId::FORMAT: pFormatOption = &rOption; break; - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_VALUE: + case HtmlOptionId::VALUE: aValue = rOption.GetString(); break; - case HTML_O_SDNUM: + case HtmlOptionId::SDNUM: aNumFormat = rOption.GetString(); bHasNumFormat = true; break; - case HTML_O_SDVAL: + case HtmlOptionId::SDVAL: aNumValue = rOption.GetString(); bHasNumValue = true; break; - case HTML_O_SDFIXED: + case HtmlOptionId::SDFIXED: bFixed = true; break; + default: break; } } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 639635d05cbc..f47d1141752b 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1249,34 +1249,34 @@ void SwHTMLParser::NewForm( bool bAppend ) switch( rOption.GetToken() ) { - case HTML_O_ACTION: + case HtmlOptionId::ACTION: aAction = rOption.GetString(); break; - case HTML_O_METHOD: + case HtmlOptionId::METHOD: nMethod = rOption.GetEnum( aHTMLFormMethodTable, nMethod ); break; - case HTML_O_ENCTYPE: + case HtmlOptionId::ENCTYPE: nEncType = rOption.GetEnum( aHTMLFormEncTypeTable, nEncType ); break; - case HTML_O_TARGET: + case HtmlOptionId::TARGET: sTarget = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: sName = rOption.GetString(); break; - case HTML_O_SDONSUBMIT: + case HtmlOptionId::SDONSUBMIT: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONSUBMIT: + case HtmlOptionId::ONSUBMIT: nEvent = HTML_ET_ONSUBMITFORM; bSetEvent = true; break; - case HTML_O_SDONRESET: + case HtmlOptionId::SDONRESET: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONRESET: + case HtmlOptionId::ONRESET: nEvent = HTML_ET_ONRESETFORM; bSetEvent = true; break; @@ -1405,7 +1405,7 @@ void SwHTMLParser::InsertInput() ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs ); const OUString& rDfltScriptType = GetScriptTypeString( pHeaderAttrs ); - sal_uInt16 nKeepCRLFToken = HTML_O_VALUE; + HtmlOptionId nKeepCRLFToken = HtmlOptionId::VALUE; const HTMLOptions& rHTMLOptions = GetOptions( &nKeepCRLFToken ); for (size_t i = rHTMLOptions.size(); i; ) { @@ -1416,95 +1416,95 @@ void SwHTMLParser::InsertInput() switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: eType = rOption.GetInputType(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: sName = rOption.GetString(); break; - case HTML_O_VALUE: + case HtmlOptionId::VALUE: sText = rOption.GetString(); bValue = true; break; - case HTML_O_CHECKED: + case HtmlOptionId::CHECKED: nChecked = TRISTATE_TRUE; break; - case HTML_O_DISABLED: + case HtmlOptionId::DISABLED: bDisabled = true; break; - case HTML_O_MAXLENGTH: + case HtmlOptionId::MAXLENGTH: nMaxLen = (sal_Int16)rOption.GetNumber(); break; - case HTML_O_SIZE: + case HtmlOptionId::SIZE: nSize = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_SRC: + case HtmlOptionId::SRC: sImgSrc = rOption.GetString(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: // erstmal nur als Pixelwerte merken! nWidth = rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: // erstmal nur als Pixelwerte merken! nHeight = rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; - case HTML_O_TABINDEX: + case HtmlOptionId::TABINDEX: // erstmal nur als Pixelwerte merken! nTabIndex = rOption.GetNumber(); break; - case HTML_O_SDONFOCUS: + case HtmlOptionId::SDONFOCUS: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONFOCUS: + case HtmlOptionId::ONFOCUS: nEvent = HTML_ET_ONGETFOCUS; bSetEvent = true; break; - case HTML_O_SDONBLUR: // eigtl. nur EDIT + case HtmlOptionId::SDONBLUR: // eigtl. nur EDIT eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONBLUR: + case HtmlOptionId::ONBLUR: nEvent = HTML_ET_ONLOSEFOCUS; bSetEvent = true; break; - case HTML_O_SDONCLICK: + case HtmlOptionId::SDONCLICK: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCLICK: + case HtmlOptionId::ONCLICK: nEvent = HTML_ET_ONCLICK; bSetEvent = true; break; - case HTML_O_SDONCHANGE: // eigtl. nur EDIT + case HtmlOptionId::SDONCHANGE: // eigtl. nur EDIT eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCHANGE: + case HtmlOptionId::ONCHANGE: nEvent = HTML_ET_ONCHANGE; bSetEvent = true; break; - case HTML_O_SDONSELECT: // eigtl. nur EDIT + case HtmlOptionId::SDONSELECT: // eigtl. nur EDIT eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONSELECT: + case HtmlOptionId::ONSELECT: nEvent = HTML_ET_ONSELECT; bSetEvent = true; break; @@ -1894,71 +1894,71 @@ void SwHTMLParser::NewTextArea() switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: sName = rOption.GetString(); break; - case HTML_O_DISABLED: + case HtmlOptionId::DISABLED: bDisabled = true; break; - case HTML_O_ROWS: + case HtmlOptionId::ROWS: nRows = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_COLS: + case HtmlOptionId::COLS: nCols = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WRAP: + case HtmlOptionId::WRAP: nWrap = rOption.GetEnum( aHTMLTextAreaWrapTable, nWrap ); break; - case HTML_O_TABINDEX: + case HtmlOptionId::TABINDEX: nTabIndex = rOption.GetSNumber(); break; - case HTML_O_SDONFOCUS: + case HtmlOptionId::SDONFOCUS: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONFOCUS: + case HtmlOptionId::ONFOCUS: nEvent = HTML_ET_ONGETFOCUS; bSetEvent = true; break; - case HTML_O_SDONBLUR: + case HtmlOptionId::SDONBLUR: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONBLUR: + case HtmlOptionId::ONBLUR: nEvent = HTML_ET_ONLOSEFOCUS; bSetEvent = true; break; - case HTML_O_SDONCLICK: + case HtmlOptionId::SDONCLICK: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCLICK: + case HtmlOptionId::ONCLICK: nEvent = HTML_ET_ONCLICK; bSetEvent = true; break; - case HTML_O_SDONCHANGE: + case HtmlOptionId::SDONCHANGE: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCHANGE: + case HtmlOptionId::ONCHANGE: nEvent = HTML_ET_ONCHANGE; bSetEvent = true; break; - case HTML_O_SDONSELECT: + case HtmlOptionId::SDONSELECT: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONSELECT: + case HtmlOptionId::ONSELECT: nEvent = HTML_ET_ONSELECT; bSetEvent = true; break; @@ -2173,60 +2173,60 @@ void SwHTMLParser::NewSelect() switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: sName = rOption.GetString(); break; - case HTML_O_MULTIPLE: + case HtmlOptionId::MULTIPLE: bMultiple = true; break; - case HTML_O_DISABLED: + case HtmlOptionId::DISABLED: bDisabled = true; break; - case HTML_O_SIZE: + case HtmlOptionId::SIZE: m_nSelectEntryCnt = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_TABINDEX: + case HtmlOptionId::TABINDEX: nTabIndex = rOption.GetSNumber(); break; - case HTML_O_SDONFOCUS: + case HtmlOptionId::SDONFOCUS: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONFOCUS: + case HtmlOptionId::ONFOCUS: nEvent = HTML_ET_ONGETFOCUS; bSetEvent = true; break; - case HTML_O_SDONBLUR: + case HtmlOptionId::SDONBLUR: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONBLUR: + case HtmlOptionId::ONBLUR: nEvent = HTML_ET_ONLOSEFOCUS; bSetEvent = true; break; - case HTML_O_SDONCLICK: + case HtmlOptionId::SDONCLICK: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCLICK: + case HtmlOptionId::ONCLICK: nEvent = HTML_ET_ONCLICK; bSetEvent = true; break; - case HTML_O_SDONCHANGE: + case HtmlOptionId::SDONCHANGE: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCHANGE: + case HtmlOptionId::ONCHANGE: nEvent = HTML_ET_ONCHANGE; bSetEvent = true; break; @@ -2446,17 +2446,18 @@ void SwHTMLParser::InsertSelectOption() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: // erstmal weglassen!!! break; - case HTML_O_SELECTED: + case HtmlOptionId::SELECTED: m_bLBEntrySelected = true; break; - case HTML_O_VALUE: + case HtmlOptionId::VALUE: aValue = rOption.GetString(); if( aValue.isEmpty() ) aValue = "$$$empty$$$"; break; + default: break; } } diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 9b3c38212196..abff69ca2fef 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -324,28 +324,28 @@ void SwHTMLParser::InsertImage() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_SRC: + case HtmlOptionId::SRC: sGrfNm = rOption.GetString(); if( !InternalImgToPrivateURL(sGrfNm) ) sGrfNm = INetURLObject::GetAbsURL( m_sBaseURL, sGrfNm ); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, text::VertOrientation::TOP ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable ); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: // for now only store as pixel value! nWidth = rOption.GetNumber(); bPrcWidth = (rOption.GetString().indexOf('%') != -1); @@ -353,7 +353,7 @@ void SwHTMLParser::InsertImage() nWidth = 100; bWidthProvided = true; break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: // for now only store as pixel value! nHeight = rOption.GetNumber(); bPrcHeight = (rOption.GetString().indexOf('%') != -1); @@ -361,46 +361,46 @@ void SwHTMLParser::InsertImage() nHeight = 100; bHeightProvided = true; break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: nVSpace = rOption.GetNumber(); break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: nHSpace = rOption.GetNumber(); break; - case HTML_O_ALT: + case HtmlOptionId::ALT: sAltNm = rOption.GetString(); break; - case HTML_O_BORDER: + case HtmlOptionId::BORDER: nBorder = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ISMAP: + case HtmlOptionId::ISMAP: bIsMap = true; break; - case HTML_O_USEMAP: + case HtmlOptionId::USEMAP: aMap = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: sHTMLGrfName = rOption.GetString(); break; - case HTML_O_SDONLOAD: + case HtmlOptionId::SDONLOAD: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONLOAD: + case HtmlOptionId::ONLOAD: nEvent = SVX_EVENT_IMAGE_LOAD; goto IMAGE_SETEVENT; - case HTML_O_SDONABORT: + case HtmlOptionId::SDONABORT: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONABORT: + case HtmlOptionId::ONABORT: nEvent = SVX_EVENT_IMAGE_ABORT; goto IMAGE_SETEVENT; - case HTML_O_SDONERROR: + case HtmlOptionId::SDONERROR: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONERROR: + case HtmlOptionId::ONERROR: nEvent = SVX_EVENT_IMAGE_ERROR; goto IMAGE_SETEVENT; IMAGE_SETEVENT: @@ -417,6 +417,7 @@ IMAGE_SETEVENT: } } break; + default: break; } } @@ -836,74 +837,75 @@ void SwHTMLParser::InsertBodyOptions() switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_BACKGROUND: + case HtmlOptionId::BACKGROUND: aBackGround = rOption.GetString(); break; - case HTML_O_BGCOLOR: + case HtmlOptionId::BGCOLOR: rOption.GetColor( aBGColor ); bBGColor = true; break; - case HTML_O_TEXT: + case HtmlOptionId::TEXT: rOption.GetColor( aTextColor ); bTextColor = true; break; - case HTML_O_LINK: + case HtmlOptionId::LINK: rOption.GetColor( aLinkColor ); bLinkColor = true; break; - case HTML_O_VLINK: + case HtmlOptionId::VLINK: rOption.GetColor( aVLinkColor ); bVLinkColor = true; break; - case HTML_O_SDONLOAD: + case HtmlOptionId::SDONLOAD: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONLOAD: + case HtmlOptionId::ONLOAD: aEvent = GlobalEventConfig::GetEventName( GlobalEventId::OPENDOC ); bSetEvent = true; break; - case HTML_O_SDONUNLOAD: + case HtmlOptionId::SDONUNLOAD: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONUNLOAD: + case HtmlOptionId::ONUNLOAD: aEvent = GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEDOC ); bSetEvent = true; break; - case HTML_O_SDONFOCUS: + case HtmlOptionId::SDONFOCUS: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONFOCUS: + case HtmlOptionId::ONFOCUS: aEvent = GlobalEventConfig::GetEventName( GlobalEventId::ACTIVATEDOC ); bSetEvent = true; break; - case HTML_O_SDONBLUR: + case HtmlOptionId::SDONBLUR: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONBLUR: + case HtmlOptionId::ONBLUR: aEvent = GlobalEventConfig::GetEventName( GlobalEventId::DEACTIVATEDOC ); bSetEvent = true; break; - case HTML_O_ONERROR: + case HtmlOptionId::ONERROR: break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); bTextColor = true; break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } if( bSetEvent ) @@ -1071,55 +1073,55 @@ void SwHTMLParser::NewAnchor() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_HREF: + case HtmlOptionId::HREF: sHRef = rOption.GetString(); bHasHRef = true; break; - case HTML_O_TARGET: + case HtmlOptionId::TARGET: sTarget = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_SDFIXED: + case HtmlOptionId::SDFIXED: bFixed = true; break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; - case HTML_O_SDONCLICK: + case HtmlOptionId::SDONCLICK: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONCLICK: + case HtmlOptionId::ONCLICK: nEvent = SFX_EVENT_MOUSECLICK_OBJECT; goto ANCHOR_SETEVENT; - case HTML_O_SDONMOUSEOVER: + case HtmlOptionId::SDONMOUSEOVER: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONMOUSEOVER: + case HtmlOptionId::ONMOUSEOVER: nEvent = SFX_EVENT_MOUSEOVER_OBJECT; goto ANCHOR_SETEVENT; - case HTML_O_SDONMOUSEOUT: + case HtmlOptionId::SDONMOUSEOUT: eScriptType2 = STARBASIC; SAL_FALLTHROUGH; - case HTML_O_ONMOUSEOUT: + case HtmlOptionId::ONMOUSEOUT: nEvent = SFX_EVENT_MOUSEOUT_OBJECT; goto ANCHOR_SETEVENT; ANCHOR_SETEVENT: @@ -1135,7 +1137,7 @@ ANCHOR_SETEVENT: } } break; - + default: break; } } diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index ab291b56925d..186f8f599bf0 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -136,10 +136,10 @@ void SwHTMLParser::NewNumBulList( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: if( bNewNumFormat && !rOption.GetString().isEmpty() ) { switch( nToken ) @@ -164,7 +164,7 @@ void SwHTMLParser::NewNumBulList( int nToken ) } } break; - case HTML_O_START: + case HtmlOptionId::START: { sal_uInt16 nStart = (sal_uInt16)rOption.GetNumber(); if( bNewNumFormat ) @@ -178,19 +178,19 @@ void SwHTMLParser::NewNumBulList( int nToken ) } } break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; - case HTML_O_SRC: + case HtmlOptionId::SRC: if( bNewNumFormat ) { aBulletSrc = rOption.GetString(); @@ -198,15 +198,16 @@ void SwHTMLParser::NewNumBulList( int nToken ) aBulletSrc = URIHelper::SmartRel2Abs( INetURLObject( m_sBaseURL ), aBulletSrc, Link<OUString *, bool>(), false ); } break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: nWidth = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: nHeight = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); break; + default: break; } } @@ -441,24 +442,25 @@ void SwHTMLParser::NewNumBulListItem( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_VALUE: + case HtmlOptionId::VALUE: nStart = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 94d38e6aeb25..3e5b9de50293 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -307,59 +307,59 @@ void SwHTMLParser::InsertEmbed() { switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_SRC: + case HtmlOptionId::SRC: if( aURL.isEmpty() ) aURL = rOption.GetString(); break; - case HTML_O_ALT: + case HtmlOptionId::ALT: aAlt = rOption.GetString(); break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: if( aType.isEmpty() ) aType = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: if( eVertOri==text::VertOrientation::NONE && eHoriOri==text::HoriOrientation::NONE ) { eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); } break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: if( USHRT_MAX==aSize.Width() ) { bPrcWidth = (rOption.GetString().indexOf('%') != -1); aSize.Width() = (long)rOption.GetNumber(); } break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: if( USHRT_MAX==aSize.Height() ) { bPrcHeight = (rOption.GetString().indexOf('%') != -1); aSize.Height() = (long)rOption.GetNumber(); } break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: if( USHRT_MAX==aSpace.Width() ) aSpace.Width() = (long)rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: if( USHRT_MAX==aSpace.Height() ) aSpace.Height() = (long)rOption.GetNumber(); break; - case HTML_O_UNKNOWN: + case HtmlOptionId::UNKNOWN: if (rOption.GetTokenString().equalsIgnoreAsciiCase( OOO_STRING_SW_HTML_O_Hidden)) { @@ -367,6 +367,7 @@ void SwHTMLParser::InsertEmbed() "FALSE"); } break; + default: break; } // Es werden alle Parameter an das Plugin weitergereicht @@ -502,68 +503,69 @@ void SwHTMLParser::NewObject() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_DECLARE: + case HtmlOptionId::DECLARE: bDeclare = true; break; - case HTML_O_CLASSID: + case HtmlOptionId::CLASSID: aClassID = rOption.GetString(); break; - case HTML_O_CODEBASE: + case HtmlOptionId::CODEBASE: break; - case HTML_O_DATA: + case HtmlOptionId::DATA: break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: break; - case HTML_O_CODETYPE: + case HtmlOptionId::CODETYPE: break; - case HTML_O_ARCHIVE: - case HTML_O_UNKNOWN: + case HtmlOptionId::ARCHIVE: + case HtmlOptionId::UNKNOWN: break; - case HTML_O_STANDBY: + case HtmlOptionId::STANDBY: aStandBy = rOption.GetString(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: bPrcWidth = (rOption.GetString().indexOf('%') != -1); aSize.Width() = (long)rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: bPrcHeight = (rOption.GetString().indexOf('%') != -1); aSize.Height() = (long)rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; - case HTML_O_USEMAP: + case HtmlOptionId::USEMAP: break; - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: aSpace.Width() = (long)rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: aSpace.Height() = (long)rOption.GetNumber(); break; - case HTML_O_BORDER: + case HtmlOptionId::BORDER: break; - case HTML_O_SDONCLICK: - case HTML_O_ONCLICK: - case HTML_O_SDONMOUSEOVER: - case HTML_O_ONMOUSEOVER: - case HTML_O_SDONMOUSEOUT: - case HTML_O_ONMOUSEOUT: + case HtmlOptionId::SDONCLICK: + case HtmlOptionId::ONCLICK: + case HtmlOptionId::SDONMOUSEOVER: + case HtmlOptionId::ONMOUSEOVER: + case HtmlOptionId::SDONMOUSEOUT: + case HtmlOptionId::ONMOUSEOUT: break; + default: break; } // Es werden alle Parameter auch an das Applet weitergereicht m_pAppletImpl->AppendParam( rOption.GetTokenString(), @@ -670,48 +672,49 @@ void SwHTMLParser::InsertApplet() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_CODEBASE: + case HtmlOptionId::CODEBASE: aCodeBase = rOption.GetString(); break; - case HTML_O_CODE: + case HtmlOptionId::CODE: aCode = rOption.GetString(); break; - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_ALT: + case HtmlOptionId::ALT: aAlt = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: bPrcWidth = (rOption.GetString().indexOf('%') != -1); aSize.Width() = (long)rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: bPrcHeight = (rOption.GetString().indexOf('%') != -1); aSize.Height() = (long)rOption.GetNumber(); break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: aSpace.Width() = (long)rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: aSpace.Height() = (long)rOption.GetNumber(); break; - case HTML_O_MAYSCRIPT: + case HtmlOptionId::MAYSCRIPT: bMayScript = true; break; + default: break; } // Es werden alle Parameter auch an das Applet weitergereicht @@ -795,12 +798,13 @@ void SwHTMLParser::InsertParam() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); break; - case HTML_O_VALUE: + case HtmlOptionId::VALUE: aValue = rOption.GetString(); break; + default: break; } } @@ -829,36 +833,37 @@ void SwHTMLParser::InsertFloatingFrame() { switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_ALT: + case HtmlOptionId::ALT: aAlt = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: bPrcWidth = (rOption.GetString().indexOf('%') != -1); aSize.Width() = (long)rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: bPrcHeight = (rOption.GetString().indexOf('%') != -1); aSize.Height() = (long)rOption.GetNumber(); break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: aSpace.Width() = (long)rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: aSpace.Height() = (long)rOption.GetNumber(); break; + default: break; } } diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index adbd6a190835..4a6792e384bf 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -70,29 +70,29 @@ void SwHTMLParser::NewDivision( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: if( HTML_DIVISION_ON==nToken ) eAdjust = rOption.GetEnum( aHTMLPAlignTable, eAdjust ); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; - case HTML_O_HREF: + case HtmlOptionId::HREF: aHRef = rOption.GetString(); break; - case HTML_O_TITLE: + case HtmlOptionId::TITLE: { const OUString& rType = rOption.GetString(); if( rType.equalsIgnoreAsciiCase("header") ) @@ -100,6 +100,8 @@ void SwHTMLParser::NewDivision( int nToken ) else if( rType.equalsIgnoreAsciiCase("footer") ) bFooter = true; } + break; + default: break; } } @@ -544,34 +546,34 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; - case HTML_O_COLS: + case HtmlOptionId::COLS: nCols = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: nWidth = rOption.GetNumber(); bPrcWidth = (rOption.GetString().indexOf('%') != -1); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; - case HTML_O_GUTTER: + case HtmlOptionId::GUTTER: nGutter = (sal_uInt16)rOption.GetNumber(); break; - + default: break; } } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 3aee21ce5391..8ceb91cd7099 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -3030,33 +3030,33 @@ CellSaveStruct::CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, const HTMLOption& rOption = rOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: m_aId = rOption.GetString(); break; - case HTML_O_COLSPAN: + case HtmlOptionId::COLSPAN: m_nColSpan = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ROWSPAN: + case HtmlOptionId::ROWSPAN: m_nRowSpan = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: m_eAdjust = rOption.GetEnum( aHTMLPAlignTable, m_eAdjust ); break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: m_eVertOri = rOption.GetEnum( aHTMLTableVAlignTable, m_eVertOri ); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: m_nWidth = (sal_uInt16)rOption.GetNumber(); // Just for Netscape m_bPrcWidth = (rOption.GetString().indexOf('%') != -1); if( m_bPrcWidth && m_nWidth>100 ) m_nWidth = 100; break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: m_nHeight = (sal_uInt16)rOption.GetNumber(); // Just for Netscape if( rOption.GetString().indexOf('%') != -1) m_nHeight = 0; // don't consider % attributes break; - case HTML_O_BGCOLOR: + case HtmlOptionId::BGCOLOR: // Ignore empty BGCOLOR on <TABLE>, <TR> and <TD>/<TH> like Netscape // *really* not on other tags if( !rOption.GetString().isEmpty() ) @@ -3065,32 +3065,33 @@ CellSaveStruct::CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, m_bBGColor = true; } break; - case HTML_O_BACKGROUND: + case HtmlOptionId::BACKGROUND: m_aBGImage = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: m_aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: m_aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: m_aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: m_aDir = rOption.GetString(); break; - case HTML_O_SDNUM: + case HtmlOptionId::SDNUM: aNumFormat = rOption.GetString(); m_bHasNumFormat = true; break; - case HTML_O_SDVAL: + case HtmlOptionId::SDVAL: m_bHasValue = true; aValue = rOption.GetString(); break; - case HTML_O_NOWRAP: + case HtmlOptionId::NOWRAP: m_bNoWrap = true; break; + default: break; } } @@ -3754,7 +3755,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, const HTMLOptions& rHTMLOptions = GetOptions(); for (const auto & rOption : rHTMLOptions) { - if( HTML_O_ALIGN==rOption.GetToken() ) + if( HtmlOptionId::ALIGN==rOption.GetToken() ) { SvxAdjust eAdjust = rOption.GetEnum( aHTMLPAlignTable, SvxAdjust::End ); bNeedsSection = SvxAdjust::Left == eAdjust || @@ -4039,16 +4040,16 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions, const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eAdjust = rOption.GetEnum( aHTMLPAlignTable, eAdjust ); break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: eVertOri = rOption.GetEnum( aHTMLTableVAlignTable, eVertOri ); break; - case HTML_O_BGCOLOR: + case HtmlOptionId::BGCOLOR: // Ignore empty BGCOLOR on <TABLE>, <TR> and <TD>/>TH> like Netscape // *really* not on other tags if( !rOption.GetString().isEmpty() ) @@ -4057,15 +4058,16 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, bool bReadOptions, bBGColor = true; } break; - case HTML_O_BACKGROUND: + case HtmlOptionId::BACKGROUND: aBGImage = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass= rOption.GetString(); break; + default: break; } } } @@ -4234,18 +4236,19 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable, const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: InsertBookmark( rOption.GetString() ); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: pSaveStruct->eAdjust = rOption.GetEnum( aHTMLPAlignTable, pSaveStruct->eAdjust ); break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: pSaveStruct->eVertOri = rOption.GetEnum( aHTMLTableVAlignTable, pSaveStruct->eVertOri ); break; + default: break; } } } @@ -4419,26 +4422,27 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable, const HTMLOption& rOption = rColGrpOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: InsertBookmark( rOption.GetString() ); break; - case HTML_O_SPAN: + case HtmlOptionId::SPAN: pSaveStruct->nColGrpSpan = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: pSaveStruct->nColGrpWidth = (sal_uInt16)rOption.GetNumber(); pSaveStruct->bRelColGrpWidth = (rOption.GetString().indexOf('*') != -1); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: pSaveStruct->eColGrpAdjust = rOption.GetEnum( aHTMLPAlignTable, pSaveStruct->eColGrpAdjust ); break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: pSaveStruct->eColGrpVertOri = rOption.GetEnum( aHTMLTableVAlignTable, pSaveStruct->eColGrpVertOri ); break; + default: break; } } } @@ -4500,24 +4504,25 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable, const HTMLOption& rOption = rColOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: InsertBookmark( rOption.GetString() ); break; - case HTML_O_SPAN: + case HtmlOptionId::SPAN: nColSpan = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: nColWidth = (sal_uInt16)rOption.GetNumber(); bRelColWidth = (rOption.GetString().indexOf('*') != -1); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eColAdjust = rOption.GetEnum( aHTMLPAlignTable, eColAdjust ); break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: eColVertOri = rOption.GetEnum( aHTMLTableVAlignTable, eColVertOri ); break; + default: break; } } pCurTable->InsertCol( nColSpan, nColWidth, bRelColWidth, @@ -4634,7 +4639,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) for ( size_t i = rHTMLOptions.size(); i; ) { const HTMLOption& rOption = rHTMLOptions[--i]; - if( HTML_O_ALIGN == rOption.GetToken() ) + if( HtmlOptionId::ALIGN == rOption.GetToken() ) { if (rOption.GetString().equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_bottom)) @@ -4853,30 +4858,30 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, const HTMLOption& rOption = rOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_COLS: + case HtmlOptionId::COLS: nCols = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: nWidth = (sal_uInt16)rOption.GetNumber(); bPrcWidth = (rOption.GetString().indexOf('%') != -1); if( bPrcWidth && nWidth>100 ) nWidth = 100; break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: nHeight = (sal_uInt16)rOption.GetNumber(); if( rOption.GetString().indexOf('%') != -1 ) nHeight = 0; // don't use % attributes break; - case HTML_O_CELLPADDING: + case HtmlOptionId::CELLPADDING: nCellPadding = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_CELLSPACING: + case HtmlOptionId::CELLSPACING: nCellSpacing = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: { if( rOption.GetEnum( eAdjust, aHTMLPAlignTable ) ) { @@ -4884,10 +4889,10 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, } } break; - case HTML_O_VALIGN: + case HtmlOptionId::VALIGN: eVertOri = rOption.GetEnum( aHTMLTableVAlignTable, eVertOri ); break; - case HTML_O_BORDER: + case HtmlOptionId::BORDER: // Handle BORDER and BORDER=BORDER like BORDER=1 if (!rOption.GetString().isEmpty() && !rOption.GetString().equalsIgnoreAsciiCase( @@ -4903,15 +4908,15 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, if( !bHasRules ) eRules = ( nBorder ? HTMLTableRules::All : HTMLTableRules::NONE ); break; - case HTML_O_FRAME: + case HtmlOptionId::FRAME: eFrame = rOption.GetTableFrame(); bHasFrame = true; break; - case HTML_O_RULES: + case HtmlOptionId::RULES: eRules = rOption.GetTableRules(); bHasRules = true; break; - case HTML_O_BGCOLOR: + case HtmlOptionId::BGCOLOR: // Ignore empty BGCOLOR on <TABLE>, <TR> and <TD>/<TH> like Netscape // *really* not on other tags if( !rOption.GetString().isEmpty() ) @@ -4920,32 +4925,33 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions, bBGColor = true; } break; - case HTML_O_BACKGROUND: + case HtmlOptionId::BACKGROUND: aBGImage = rOption.GetString(); break; - case HTML_O_BORDERCOLOR: + case HtmlOptionId::BORDERCOLOR: rOption.GetColor( aBorderColor ); bBorderColor = true; break; - case HTML_O_BORDERCOLORDARK: + case HtmlOptionId::BORDERCOLORDARK: if( !bBorderColor ) rOption.GetColor( aBorderColor ); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; - case HTML_O_HSPACE: + case HtmlOptionId::HSPACE: nHSpace = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_VSPACE: + case HtmlOptionId::VSPACE: nVSpace = (sal_uInt16)rOption.GetNumber(); break; + default: break; } } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 8e62ead5c06e..be451faa479c 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1286,10 +1286,10 @@ void SwHTMLParser::NextToken( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_HREF: + case HtmlOptionId::HREF: m_sBaseURL = rOption.GetString(); break; - case HTML_O_TARGET: + case HtmlOptionId::TARGET: if( IsNewDoc() ) { SwDocShell *pDocShell(m_xDoc->GetDocShell()); @@ -1307,6 +1307,7 @@ void SwHTMLParser::NextToken( int nToken ) } } break; + default: break; } } } @@ -1897,7 +1898,7 @@ void SwHTMLParser::NextToken( int nToken ) for (size_t i = rHTMLOptions.size(); i; ) { const HTMLOption& rOption = rHTMLOptions[--i]; - if( HTML_O_DIR == rOption.GetToken() ) + if( HtmlOptionId::DIR == rOption.GetToken() ) { const OUString& rDir = rOption.GetString(); SfxItemSet aItemSet( m_xDoc->GetAttrPool(), @@ -3409,21 +3410,22 @@ void SwHTMLParser::NewStdAttr( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -3462,21 +3464,22 @@ void SwHTMLParser::NewStdAttr( int nToken, const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -3542,24 +3545,25 @@ void SwHTMLParser::NewBasefontAttr() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_SIZE: + case HtmlOptionId::SIZE: nSize = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -3643,7 +3647,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_SIZE: + case HtmlOptionId::SIZE: if( HTML_FONT_ON==nToken && !rOption.GetString().isEmpty() ) { sal_Int32 nSSize; @@ -3662,32 +3666,33 @@ void SwHTMLParser::NewFontAttr( int nToken ) nFontHeight = m_aFontHeights[nSize-1]; } break; - case HTML_O_COLOR: + case HtmlOptionId::COLOR: if( HTML_FONT_ON==nToken ) { rOption.GetColor( aColor ); bColor = true; } break; - case HTML_O_FACE: + case HtmlOptionId::FACE: if( HTML_FONT_ON==nToken ) aFace = rOption.GetString(); break; - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -3862,24 +3867,25 @@ void SwHTMLParser::NewPara() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: m_eParaAdjust = rOption.GetEnum( aHTMLPAlignTable, m_eParaAdjust ); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -3981,24 +3987,25 @@ void SwHTMLParser::NewHeading( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: m_eParaAdjust = rOption.GetEnum( aHTMLPAlignTable, m_eParaAdjust ); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -4105,21 +4112,22 @@ void SwHTMLParser::NewTextFormatColl( int nToken, sal_uInt16 nColl ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -4233,21 +4241,22 @@ void SwHTMLParser::NewDefList() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -4742,21 +4751,22 @@ void SwHTMLParser::NewCharFormat( int nToken ) const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; - case HTML_O_LANG: + case HtmlOptionId::LANG: aLang = rOption.GetString(); break; - case HTML_O_DIR: + case HtmlOptionId::DIR: aDir = rOption.GetString(); break; + default: break; } } @@ -4810,13 +4820,13 @@ void SwHTMLParser::InsertSpacer() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_TYPE: + case HtmlOptionId::TYPE: rOption.GetEnum( nType, aHTMLSpacerTypeTable ); break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); @@ -4824,20 +4834,21 @@ void SwHTMLParser::InsertSpacer() rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri ); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: // erstmal nur als Pixelwerte merken! bPrcWidth = (rOption.GetString().indexOf('%') != -1); aSize.Width() = (long)rOption.GetNumber(); break; - case HTML_O_HEIGHT: + case HtmlOptionId::HEIGHT: // erstmal nur als Pixelwerte merken! bPrcHeight = (rOption.GetString().indexOf('%') != -1); aSize.Height() = (long)rOption.GetNumber(); break; - case HTML_O_SIZE: + case HtmlOptionId::SIZE: // erstmal nur als Pixelwerte merken! nSize = rOption.GetNumber(); break; + default: break; } } @@ -5010,7 +5021,7 @@ void SwHTMLParser::InsertIDOption() for (size_t i = rHTMLOptions.size(); i; ) { const HTMLOption& rOption = rHTMLOptions[--i]; - if( HTML_O_ID==rOption.GetToken() ) + if( HtmlOptionId::ID==rOption.GetToken() ) { aId = rOption.GetString(); break; @@ -5050,7 +5061,7 @@ void SwHTMLParser::InsertLineBreak() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_CLEAR: + case HtmlOptionId::CLEAR: { const OUString &rClear = rOption.GetString(); if( rClear.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_AL_all ) ) @@ -5064,15 +5075,16 @@ void SwHTMLParser::InsertLineBreak() bClearRight = true; } break; - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_STYLE: + case HtmlOptionId::STYLE: aStyle = rOption.GetString(); break; - case HTML_O_CLASS: + case HtmlOptionId::CLASS: aClass = rOption.GetString(); break; + default: break; } } @@ -5197,13 +5209,13 @@ void SwHTMLParser::InsertHorzRule() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_ID: + case HtmlOptionId::ID: aId = rOption.GetString(); break; - case HTML_O_SIZE: + case HtmlOptionId::SIZE: nSize = (sal_uInt16)rOption.GetNumber(); break; - case HTML_O_WIDTH: + case HtmlOptionId::WIDTH: bPrcWidth = (rOption.GetString().indexOf('%') != -1); nWidth = (sal_uInt16)rOption.GetNumber(); if( bPrcWidth && nWidth>=100 ) @@ -5213,16 +5225,17 @@ void SwHTMLParser::InsertHorzRule() bPrcWidth = false; } break; - case HTML_O_ALIGN: + case HtmlOptionId::ALIGN: eAdjust = rOption.GetEnum( aHTMLPAlignTable, eAdjust ); break; - case HTML_O_NOSHADE: + case HtmlOptionId::NOSHADE: bNoShade = true; break; - case HTML_O_COLOR: + case HtmlOptionId::COLOR: rOption.GetColor( aColor ); bColor = true; break; + default: break; } } @@ -5349,17 +5362,18 @@ void SwHTMLParser::ParseMoreMetaOptions() const HTMLOption& rOption = rHTMLOptions[--i]; switch( rOption.GetToken() ) { - case HTML_O_NAME: + case HtmlOptionId::NAME: aName = rOption.GetString(); bHTTPEquiv = false; break; - case HTML_O_HTTPEQUIV: + case HtmlOptionId::HTTPEQUIV: aName = rOption.GetString(); bHTTPEquiv = true; break; - case HTML_O_CONTENT: + case HtmlOptionId::CONTENT: aContent = rOption.GetString(); break; + default: break; } } |