summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:26:06 -0400
commite7b11300cd813f821d1ec5cb4633ce2c5f7d1b9f (patch)
treea6c39d9d4cde1baa84a9d788affbce3508af89a8 /editeng
parent34f591ca95c4c63be092da4c4b2294230404f336 (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. (cherry picked from commit 14cd5182c5f64c43581c82db8c958369152226ac) Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/eehtml.cxx4
-rw-r--r--editeng/source/items/frmitems.cxx8
-rw-r--r--editeng/source/items/textitem.cxx2
-rw-r--r--editeng/source/rtf/rtfitem.cxx14
-rw-r--r--editeng/source/rtf/svxrtf.cxx6
5 files changed, 19 insertions, 15 deletions
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index dec2be7479f1..4d644a6b539a 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -297,7 +297,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:
@@ -321,8 +321,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 e3caabbb2b49..36c3756c1bbf 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1908,28 +1908,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 5893f27f7372..dc7b382a71b9 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -3336,7 +3336,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 9464e043cea9..02939c7a3599 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 7b4fb438705a..dd2105fff1cf 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -189,7 +189,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();
@@ -420,7 +420,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;