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 /oox | |
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 'oox')
-rw-r--r-- | oox/source/drawingml/color.cxx | 4 | ||||
-rw-r--r-- | oox/source/drawingml/customshapegeometry.cxx | 21 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 2 | ||||
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 2 | ||||
-rw-r--r-- | oox/source/vml/vmlformatting.cxx | 2 |
5 files changed, 25 insertions, 6 deletions
diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx index 774541fbc90a..74598fc020c2 100644 --- a/oox/source/drawingml/color.cxx +++ b/oox/source/drawingml/color.cxx @@ -695,7 +695,7 @@ void Color::toCrgb() const { case COLOR_HSL: toRgb(); - // run through! + SAL_FALLTHROUGH; case COLOR_RGB: meMode = COLOR_CRGB; mnC1 = lclGamma( lclRgbCompToCrgbComp( mnC1 ), DEC_GAMMA ); @@ -716,7 +716,7 @@ void Color::toHsl() const { case COLOR_CRGB: toRgb(); - // run through! + SAL_FALLTHROUGH; case COLOR_RGB: { meMode = COLOR_HSL; diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx index d019c9fb8d82..4557a6d30468 100644 --- a/oox/source/drawingml/customshapegeometry.cxx +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -223,18 +223,24 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu } break; - case XML_hd10 : // !!PASSTHROUGH INTENDED + case XML_hd10 : nIntVal += 2; // */ h 1.0 10.0 + SAL_FALLTHROUGH; case XML_hd8 : // */ h 1.0 8.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_hd6 : // */ h 1.0 6.0 nIntVal++; + SAL_FALLTHROUGH; case XML_hd5 : // */ h 1.0 5.0 nIntVal++; + SAL_FALLTHROUGH; case XML_hd4 : // */ h 1.0 4.0 nIntVal++; + SAL_FALLTHROUGH; case XML_hd3 : // */ h 1.0 3.0 nIntVal++; + SAL_FALLTHROUGH; case XML_hd2 : // */ h 1.0 2.0 case XML_vc : // */ h 1.0 2.0 { @@ -279,14 +285,19 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu break; case XML_ssd32 : // */ ss 1.0 32.0 nIntVal += 16; + SAL_FALLTHROUGH; case XML_ssd16 : // */ ss 1.0 16.0 nIntVal += 8; + SAL_FALLTHROUGH; case XML_ssd8 : // */ ss 1.0 8.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_ssd6 : // */ ss 1.0 6.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_ssd4 : // */ ss 1.0 4.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_ssd2 : // */ ss 1.0 2.0 { nIntVal += 2; @@ -319,20 +330,28 @@ static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCu case XML_wd32 : // */ w 1.0 32.0 nIntVal += 20; + SAL_FALLTHROUGH; case XML_wd12 : // */ w 1.0 12.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_wd10 : // */ w 1.0 10.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_wd8 : // */ w 1.0 8.0 nIntVal += 2; + SAL_FALLTHROUGH; case XML_wd6 : // */ w 1.0 6.0 nIntVal++; + SAL_FALLTHROUGH; case XML_wd5 : // */ w 1.0 5.0 nIntVal++; + SAL_FALLTHROUGH; case XML_wd4 : // */ w 1.0 4.0 nIntVal++; + SAL_FALLTHROUGH; case XML_wd3 : // */ w 1.0 3.0 nIntVal++; + SAL_FALLTHROUGH; case XML_hc : // */ w 1.0 2.0 case XML_wd2 : // */ w 1.0 2.0 { diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 87dd2e14b56f..880351d61bd1 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -633,7 +633,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet ) SAL_INFO("oox.shape", "dash dots: " << aLineDash.Dots << " dashes: " << aLineDash.Dashes << " dotlen: " << aLineDash.DotLen << " dashlen: " << aLineDash.DashLen << " distance: " << aLineDash.Distance); } - /* fallthru intended */ + SAL_FALLTHROUGH; case drawing::LineStyle_SOLID: default: if ( GETA( LineColor ) ) diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index fe2c9df92611..3d5084fb16c3 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -398,7 +398,7 @@ void ControlConverter::convertAxBackground( PropertyMap& rPropMap, break; case API_TRANSPARENCY_PAINTTRANSPARENT: rPropMap.setProperty( PROP_PaintTransparent, !bOpaque ); - // run-through intended! + SAL_FALLTHROUGH; case API_TRANSPARENCY_VOID: // keep transparency by leaving the (void) default property value if( bOpaque ) diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index 5fee25e42660..b0b36fa6547b 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -781,7 +781,7 @@ void FillModel::pushToPropMap( ShapePropertyMap& rPropMap, const GraphicHelper& } } } - // run-through to XML_solid in case of missing bitmap path intended! + SAL_FALLTHROUGH; // to XML_solid in case of missing bitmap path intended! case XML_solid: default: |