diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-05-10 16:42:16 +0200 |
commit | 14cd5182c5f64c43581c82db8c958369152226ac (patch) | |
tree | 57f150ba2707f29214eeb9b1eaad2373780d1b15 /editeng | |
parent | e4bb2b4f4875c15bd68297b5be716edd6859841e (diff) |
Replace fallthrough comments with new SAL_FALLTHROUGH macro
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in
preparation of enabling -Wimplicit-fallthrough. (This is only relevant for
C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.)
Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but
that would require adding back in dependencies on boost_headers to many
libraries where we carefully removed any remaining Boost dependencies only
recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its
future evolution will not have any impact on the stable URE interface.) C++17
will have a proper [[fallthroug]], eventually removing the need for a macro
altogether.
Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/eehtml.cxx | 4 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 8 | ||||
-rw-r--r-- | editeng/source/items/textitem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 14 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 6 |
5 files changed, 19 insertions, 15 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index bee0d5d8e233..58620b6efb72 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -292,7 +292,7 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_TABLEHEADER_ON: case HTML_TABLEDATA_ON: nInCell++; - // fall through + SAL_FALLTHROUGH; case HTML_BLOCKQUOTE_ON: case HTML_BLOCKQUOTE_OFF: case HTML_BLOCKQUOTE30_ON: @@ -316,8 +316,8 @@ void EditHTMLParser::NextToken( int nToken ) { if ( nInCell ) nInCell--; + SAL_FALLTHROUGH; } - // fall through case HTML_LISTHEADER_OFF: case HTML_LI_OFF: case HTML_DD_OFF: diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 63cca0627491..00a41e259c68 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1867,28 +1867,28 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } case LEFT_BORDER_DISTANCE: bDistMember = true; - //fall-through + SAL_FALLTHROUGH; case LEFT_BORDER: case MID_LEFT_BORDER: nLine = SvxBoxItemLine::LEFT; break; case RIGHT_BORDER_DISTANCE: bDistMember = true; - //fall-through + SAL_FALLTHROUGH; case RIGHT_BORDER: case MID_RIGHT_BORDER: nLine = SvxBoxItemLine::RIGHT; break; case BOTTOM_BORDER_DISTANCE: bDistMember = true; - //fall-through + SAL_FALLTHROUGH; case BOTTOM_BORDER: case MID_BOTTOM_BORDER: nLine = SvxBoxItemLine::BOTTOM; break; case TOP_BORDER_DISTANCE: bDistMember = true; - //fall-through + SAL_FALLTHROUGH; case TOP_BORDER: case MID_TOP_BORDER: nLine = SvxBoxItemLine::TOP; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 68e6abebc5d3..23243aa85d56 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -3332,7 +3332,7 @@ void SvxScriptSetItem::GetSlotIds( sal_uInt16 nSlotId, sal_uInt16& rLatin, { default: DBG_ASSERT( false, "wrong SlotId for class SvxScriptSetItem" ); - // no break - default to font - Id Range !! + SAL_FALLTHROUGH; // default to font - Id Range !! case SID_ATTR_CHAR_FONT: rLatin = SID_ATTR_CHAR_FONT; diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 3298878baf20..f10a60e1b46e 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1366,17 +1366,17 @@ static void SetBorderLine( int nBorderTyp, SvxBoxItem& rItem, rItem.SetLine( &rBorder, SvxBoxItemLine::TOP ); if( RTF_BOX != nBorderTyp ) return; - // fall-through + SAL_FALLTHROUGH; case RTF_BRDRB: rItem.SetLine( &rBorder, SvxBoxItemLine::BOTTOM ); if( RTF_BOX != nBorderTyp ) return; - // fall-through + SAL_FALLTHROUGH; case RTF_BRDRL: rItem.SetLine( &rBorder, SvxBoxItemLine::LEFT ); if( RTF_BOX != nBorderTyp ) return; - // fall-through + SAL_FALLTHROUGH; case RTF_BRDRR: rItem.SetLine( &rBorder, SvxBoxItemLine::RIGHT ); if( RTF_BOX != nBorderTyp ) @@ -1815,7 +1815,9 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) bIsLeftToRightDef = true; switch( nToken ) { - case RTF_ADEFF: bIsLeftToRightDef = false; // no break! + case RTF_ADEFF: + bIsLeftToRightDef = false; + SAL_FALLTHROUGH; case RTF_DEFF: { if( -1 == nValue ) @@ -1829,7 +1831,9 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) } break; - case RTF_ADEFLANG: bIsLeftToRightDef = false; // no break! + case RTF_ADEFLANG: + bIsLeftToRightDef = false; + SAL_FALLTHROUGH; case RTF_DEFLANG: // store default Language if( -1 != nValue ) diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 0c5a4522c001..c67fc8456f2d 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -187,7 +187,7 @@ void SvxRTFParser::NextToken( int nToken ) case RTF_RDBLQUOTE: cCh = 0x201D; goto INSINGLECHAR; INSINGLECHAR: aToken = OUString(cCh); - // no Break, aToken is set as Text + SAL_FALLTHROUGH; // aToken is set as Text case RTF_TEXTTOKEN: { InsertText(); @@ -418,7 +418,7 @@ void SvxRTFParser::ReadColorTable() : -1 == aToken.indexOf( ";" ) ) break; // At least the ';' must be found - // else no break !! + SAL_FALLTHROUGH; case ';': if( IsParserWorking() ) @@ -509,7 +509,7 @@ void SvxRTFParser::ReadFontTable() // for technical/symbolic font of the rtl_TextEncoding is changed! case RTF_FTECH: pFont->SetCharSet( RTL_TEXTENCODING_SYMBOL ); - // deliberate fall through + SAL_FALLTHROUGH; case RTF_FNIL: pFont->SetFamily( FAMILY_DONTKNOW ); break; |