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/source/rtf | |
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/source/rtf')
-rw-r--r-- | editeng/source/rtf/rtfitem.cxx | 14 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 6 |
2 files changed, 12 insertions, 8 deletions
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; |