From 14cd5182c5f64c43581c82db8c958369152226ac Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 May 2016 16:42:16 +0200 Subject: 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 --- canvas/source/cairo/cairo_canvashelper.cxx | 2 +- canvas/source/cairo/cairo_canvashelper_text.cxx | 2 +- canvas/source/vcl/canvashelper.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'canvas') diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index c71d2f555091..6ab701b8012f 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -1215,7 +1215,7 @@ namespace cairocanvas { case rendering::PathJoinType::NONE: bNoLineJoin = true; - // cairo doesn't have join type NONE so we use MITER as it's pretty close + SAL_FALLTHROUGH; // cairo doesn't have join type NONE so we use MITER as it's pretty close case rendering::PathJoinType::MITER: cairo_set_line_join( mpCairo.get(), CAIRO_LINE_JOIN_MITER ); break; diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index 03246f7b37a7..e7879c53a728 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -288,7 +288,7 @@ namespace cairocanvas case rendering::TextDirection::WEAK_RIGHT_TO_LEFT: nLayoutMode |= TEXT_LAYOUT_BIDI_RTL; - // FALLTHROUGH intended + SAL_FALLTHROUGH; case rendering::TextDirection::STRONG_RIGHT_TO_LEFT: nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG; nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_RIGHT; diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 79785aa15e2f..9596172fdf79 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -608,7 +608,7 @@ namespace vclcanvas case rendering::TextDirection::WEAK_RIGHT_TO_LEFT: nLayoutMode |= TEXT_LAYOUT_BIDI_RTL; - // FALLTHROUGH intended + SAL_FALLTHROUGH; case rendering::TextDirection::STRONG_RIGHT_TO_LEFT: nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_BIDI_STRONG; nLayoutMode |= TEXT_LAYOUT_TEXTORIGIN_RIGHT; -- cgit