summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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 'vcl')
-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
12 files changed, 32 insertions, 24 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 5fb666e01122..523e12a30070 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1589,7 +1589,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:
@@ -1598,7 +1598,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 1baddd57b150..1db0da853d3b 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -1265,42 +1265,50 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)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 3a46f474e00b..54af9444fd81 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 e576f2a5c028..e667cb23ec41 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5388,7 +5388,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
else
appendName( rWidget.m_aValue, aValue );
}
- // fall-through
+ SAL_FALLTHROUGH;
case PDFWriter::PushButton:
aLine.append( "Btn" );
break;
@@ -10980,7 +10980,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 8af9f0b200d0..1eb2663096ce 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -513,7 +513,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 :
@@ -547,7 +547,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 538c6b1d9573..0f623ebdc8a4 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 e4efb2667270..7d0ea1544ac6 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 599bd9fcd4db..6fa8dde994b9 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2609,7 +2609,7 @@ bool ImplWindowFrameProc( vcl::Window* _pWindow, SalFrame* /*pFrame*/,
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 91c1f6fcd109..ee7ecc474d1d 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -181,7 +181,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 9f0db5e17c85..1e4d636f8f25 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -3886,7 +3886,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;