summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-05-10 16:42:16 +0200
commit14cd5182c5f64c43581c82db8c958369152226ac (patch)
tree57f150ba2707f29214eeb9b1eaad2373780d1b15 /vcl
parentNote pull request for boost patch (diff)
downloadcore-14cd5182c5f64c43581c82db8c958369152226ac.tar.gz
core-14cd5182c5f64c43581c82db8c958369152226ac.zip
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 'vcl')
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/source/control/edit.cxx4
-rw-r--r--vcl/source/edit/textview.cxx24
-rw-r--r--vcl/source/fontsubset/cff.cxx2
-rw-r--r--vcl/source/fontsubset/xlat.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx4
-rw-r--r--vcl/source/gdi/pngread.cxx4
-rw-r--r--vcl/source/window/decoview.cxx6
-rw-r--r--vcl/source/window/layout.cxx2
-rw-r--r--vcl/source/window/winproc.cxx2
-rw-r--r--vcl/unx/generic/gdi/salbmp.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
13 files changed, 33 insertions, 25 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 68ea2f324f2e..180ad2c5d0d6 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -101,7 +101,7 @@ BitmapBuffer* ImplCreateDIB(
}
default:
nBitCount = 32;
- //fall through
+ SAL_FALLTHROUGH;
case 32:
{
pDIB->mnFormat = SVP_CAIRO_FORMAT;
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 9fda579dda51..5c28f9f8afc3 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1568,7 +1568,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
bSelect = true;
- // fallthrough intended
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
@@ -1577,7 +1577,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
bSelect = true;
- // fallthrough intended
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_END_OF_LINE:
case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index daaf4f480b29..a033c6b871b7 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -1214,42 +1214,50 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16) css::i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16) css::i18n::CharacterIteratorMode::SKIPCELL );
break;
case css::awt::Key::SELECT_WORD_FORWARD:
- bSelect = true; // fallthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_WORD_FORWARD:
aPaM = CursorWordRight( aPaM );
break;
case css::awt::Key::SELECT_WORD_BACKWARD:
- bSelect = true; // fallthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_WORD_BACKWARD:
aPaM = CursorWordLeft( aPaM );
break;
case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
- bSelect = true; // fallthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
aPaM = CursorStartOfLine( aPaM );
break;
case css::awt::Key::SELECT_TO_END_OF_LINE:
- bSelect = true; // fallthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_END_OF_LINE:
aPaM = CursorEndOfLine( aPaM );
break;
case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
- bSelect = true; // falltthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
aPaM = CursorStartOfParagraph( aPaM );
break;
case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
- bSelect = true; // falltthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
aPaM = CursorEndOfParagraph( aPaM );
break;
case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
- bSelect = true; // falltthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
aPaM = CursorStartOfDoc();
break;
case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
- bSelect = true; // falltthrough intentional
+ bSelect = true;
+ SAL_FALLTHROUGH;
case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
aPaM = CursorEndOfDoc();
break;
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 6ea7268318a4..ac3bf78bb098 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1002,7 +1002,7 @@ void CffSubsetterContext::convertOneTypeEsc()
assert( mnStackIdx >= 1 );
if( pTop[0] >= 0)
break;
- // fall through
+ SAL_FALLTHROUGH;
case TYPE2OP::NEG:
assert( mnStackIdx >= 1 );
pTop[0] = -pTop[0];
diff --git a/vcl/source/fontsubset/xlat.cxx b/vcl/source/fontsubset/xlat.cxx
index 408e6b1aef22..6fc4cb7b6559 100644
--- a/vcl/source/fontsubset/xlat.cxx
+++ b/vcl/source/fontsubset/xlat.cxx
@@ -68,7 +68,7 @@ void ConverterCache::ensureConverter( int nSelect )
rtl_TextEncoding eRecodeFrom = RTL_TEXTENCODING_UNICODE;
switch( nSelect )
{
- default: nSelect = 1; // fall through to unicode recoding
+ default: nSelect = 1; SAL_FALLTHROUGH; // to unicode recoding
case 1: eRecodeFrom = RTL_TEXTENCODING_UNICODE; break;
case 2: eRecodeFrom = RTL_TEXTENCODING_SHIFT_JIS; break;
case 3: eRecodeFrom = RTL_TEXTENCODING_GB_2312; break;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 2299f71c91fb..c7a177ced98c 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5341,7 +5341,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
else
appendName( rWidget.m_aValue, aValue );
}
- // fall-through
+ SAL_FALLTHROUGH;
case PDFWriter::PushButton:
aLine.append( "Btn" );
break;
@@ -10928,7 +10928,7 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject )
aCol[1] = rObject.m_aGradient.GetEndColor().GetGreen();
aCol[2] = rObject.m_aGradient.GetEndColor().GetBlue();
CHECK_RETURN( writeBuffer( aCol, 3 ) );
- // fall-through
+ SAL_FALLTHROUGH;
case GradientStyle_LINEAR:
{
aCol[0] = rObject.m_aGradient.GetStartColor().GetRed();
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index b4ce854c4a28..223e0e3a0775 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -516,7 +516,7 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
break;
case 16 :
mnTargetDepth = 8; // we have to reduce the bitmap
- // fall through
+ SAL_FALLTHROUGH;
case 1 :
case 4 :
case 8 :
@@ -550,7 +550,7 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
{
case 2 :
mnTargetDepth = 4; // we have to expand the bitmap
- // fall through
+ SAL_FALLTHROUGH;
case 1 :
case 4 :
case 8 :
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 4e75b536c608..717b899b9ad2 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -256,7 +256,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType
pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-n2+1 ),
Point( nRect.Left(), aCenter.Y()+n2-1 ) );
++nRect.Left();
- // Intentional fall-through
+ SAL_FALLTHROUGH;
case SymbolType::WINDBACKWARD:
pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) );
pDev->DrawPixel( Point( nRect.Left()+n2, aCenter.Y() ) );
@@ -274,7 +274,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType
pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-n2+1 ),
Point( nRect.Right(), aCenter.Y()+n2-1 ) );
--nRect.Right();
- // Intentional fall-through
+ SAL_FALLTHROUGH;
case SymbolType::WINDFORWARD:
pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) );
pDev->DrawPixel( Point( nRect.Right()-n2, aCenter.Y() ) );
@@ -313,7 +313,7 @@ void ImplDrawSymbol( OutputDevice* pDev, Rectangle nRect, const SymbolType eType
Point( nRect.Right(), nRect.Bottom() ) );
pDev->DrawLine( Point( nRect.Left(), nRect.Bottom() ),
Point( nRect.Right(), nRect.Bottom() ) );
- // Intentional fall-through
+ SAL_FALLTHROUGH;
case SymbolType::ROLLUP:
pDev->DrawRect( Rectangle( nRect.Left(), nRect.Top(),
nRect.Right(), nRect.Top()+n8 ) );
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 59a970a8caae..2c6cabff51e7 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -603,7 +603,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation)
break;
default:
SAL_WARN("vcl.layout", "todo unimplemented layout style");
- //fall-through
+ SAL_FALLTHROUGH;
case VCL_BUTTONBOX_DEFAULT_STYLE:
case VCL_BUTTONBOX_END:
if (!aReq.m_aMainGroupDimensions.empty())
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index fc39c2fc277d..cde81f6163c6 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2559,7 +2559,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalEvent nEvent, const void* pE
ImplHandleSurroundingTextSelectionChange( pWindow,
pEvt->mnStart,
pEvt->mnEnd );
- // Fallthrough really intended?
+ SAL_FALLTHROUGH; // TODO: Fallthrough really intended?
}
case SalEvent::StartReconversion:
ImplHandleStartReconversion( pWindow );
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index da866c88f4d9..dd01c4b7a348 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -186,7 +186,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
#endif
default:
nBitCount = 24;
- //fall through
+ SAL_FALLTHROUGH;
case 24:
pDIB->mnFormat |= BMP_FORMAT_24BIT_TC_BGR;
break;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index ca95054cb6e7..afc09698ee21 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -3887,7 +3887,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
XSetInputFocus( GetXDisplay(), GetShellWindow(),
RevertToNone, CurrentTime );
}
- //fall-through
+ SAL_FALLTHROUGH;
case ButtonRelease:
case MotionNotify:
case EnterNotify:
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index 1cb92cdc094a..9b5bbd0ca674 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -627,7 +627,7 @@ void WindowEventHandler(void *, VclSimpleEvent& rEvent)
case VCLEVENT_OBJECT_DYING:
g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow() );
- // fallthrough intentional !
+ SAL_FALLTHROUGH;
case VCLEVENT_TOOLBOX_HIGHLIGHTOFF:
handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(&rEvent)->GetWindow());
break;