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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/svxruler.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 7 | ||||
-rw-r--r-- | svx/source/form/fmshell.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/fmsrcimp.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmvwimp.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/formcontrolfactory.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/rotmodit.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdhdl.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdopath.cxx | 2 | ||||
-rw-r--r-- | svx/source/toolbars/extrusionbar.cxx | 33 | ||||
-rw-r--r-- | svx/source/toolbars/fontworkbar.cxx | 11 | ||||
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 2 |
16 files changed, 50 insertions, 33 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index aa3c594095d6..a7d514fbe756 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2018,7 +2018,7 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve case mso_sptAccentCallout2 : case mso_sptAccentBorderCallout2 : bAccent = true; - //fall-through + SAL_FALLTHROUGH; case mso_sptCallout2 : case mso_sptBorderCallout2 : { diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 5cfac694d78f..85f31a4add60 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -885,8 +885,8 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r nLeftStart += nCharWidth; nRightEnd -= nCharWidth; } + SAL_FALLTHROUGH; } - // no break! case RubyAdjust_BLOCK: { if (sOutputText.getLength() > 1) @@ -902,8 +902,8 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r } break; } + SAL_FALLTHROUGH; } - //no break; case RubyAdjust_CENTER: rRenderContext.DrawText(Point(nCenter - nOutTextWidth / 2 , nYOutput), sOutputText); break; diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 4567fc1e122c..526924a49967 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1722,7 +1722,7 @@ void SvxRuler::UpdateParaContents_Impl( break; case MOVE_ALL: mpIndents[INDENT_RIGHT_MARGIN].nPos += lDifference; - // no break + SAL_FALLTHROUGH; case MOVE_LEFT: { mpIndents[INDENT_FIRST_LINE].nPos += lDifference; @@ -1806,7 +1806,7 @@ ADD_DEBUG_TEXT("lLastLMargin: ", OUString::number(mxRulerImpl->lLastLMargin)) { default: ;//prevent warning OSL_FAIL("svx::SvxRuler::DragBorders(), unknown drag type!" ); - //fall-through + SAL_FALLTHROUGH; case RULER_TYPE_BORDER: if(mxRulerImpl->bIsTableRows) { diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 5d20ae911d25..6680f180c603 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -157,7 +157,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< css::bea case DataType::TIME: case DataType::TIMESTAMP: m_bDateTime = true; - //fall-through + SAL_FALLTHROUGH; case DataType::BIT: case DataType::BOOLEAN: case DataType::TINYINT: diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index f6bbec2e265d..4cad691ca1d9 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2901,8 +2901,9 @@ void DbGridControl::Command(const CommandEvent& rEvt) DbGridControl_Base::Command(rEvt); return; } + + SAL_FALLTHROUGH; } - //fall-through default: DbGridControl_Base::Command(rEvt); } @@ -3321,7 +3322,9 @@ bool DbGridControl::PreNotify(NotifyEvent& rEvt) return true; } } - } // no break! + + SAL_FALLTHROUGH; + } default: return DbGridControl_Base::PreNotify(rEvt); } diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index bce5d77cfa19..7eb32e2fd976 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -274,7 +274,7 @@ bool FmFormShell::PrepareClose(bool bUI) { case RET_YES: bResult = rController->commitCurrentRecord( ); - // fallthrough to next case + SAL_FALLTHROUGH; case RET_NO: GetImpl()->didPrepareClose( true ); break; @@ -874,7 +874,7 @@ void FmFormShell::GetState(SfxItemSet &rSet) rSet.Put( SfxVisibilityItem( nWhich, false ) ); break; } - // NO break! + SAL_FALLTHROUGH; case SID_FM_SCROLLBAR: case SID_FM_IMAGECONTROL: diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index e86d4d8d1a77..d653f5c782ac 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -610,7 +610,7 @@ FmSearchEngine::SEARCH_RESULT FmSearchEngine::SearchRegularApprox(const OUString bFound = false; break; } - // laeuft in den naechsten Case rein ! + SAL_FALLTHROUGH; case MATCHING_BEGINNING : if (nStart != 0) bFound = false; diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index e5ef357e6870..da804566691e 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1318,7 +1318,7 @@ SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor case DataType::TIMESTAMP: bDateNTimeField = true; sLabelPostfix = SVX_RESSTR(RID_STR_POSTFIX_DATE); - // DON'T break ! + SAL_FALLTHROUGH; case DataType::DATE: nOBJID = OBJ_FM_DATEFIELD; break; diff --git a/svx/source/form/formcontrolfactory.cxx b/svx/source/form/formcontrolfactory.cxx index bcf1fa1d585a..69768810846f 100644 --- a/svx/source/form/formcontrolfactory.cxx +++ b/svx/source/form/formcontrolfactory.cxx @@ -399,7 +399,7 @@ namespace svxform { case FormComponentType::SCROLLBAR: _rxControlModel->setPropertyValue("LiveScroll", makeAny( true ) ); - // NO break! + SAL_FALLTHROUGH; case FormComponentType::SPINBUTTON: { sal_Int32 eOrientation = ScrollBarOrientation::HORIZONTAL; diff --git a/svx/source/items/rotmodit.cxx b/svx/source/items/rotmodit.cxx index 11c76c6aceb7..e586fa0b7324 100644 --- a/svx/source/items/rotmodit.cxx +++ b/svx/source/items/rotmodit.cxx @@ -75,7 +75,7 @@ bool SvxRotateModeItem::GetPresentation( { case SFX_ITEM_PRESENTATION_COMPLETE: rText += "...: "; -// break; // FALL THROUGH!!! + SAL_FALLTHROUGH; // break; // FALL THROUGH!!! case SFX_ITEM_PRESENTATION_NAMELESS: rText += OUString( sal_Unicode(GetValue()) ); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index ce15e90e3dea..923ff014f288 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -134,7 +134,7 @@ const BitmapEx& SdrHdlBitmapSet::GetBitmapEx(BitmapMarkerKind eKindOfMarker, sal default: { OSL_FAIL( "Unknown kind of marker." ); - // no break here, return Rect_9x9 as default + SAL_FALLTHROUGH; // return Rect_9x9 as default } case Rect_9x9: { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 923c19690d24..81394baa6cb9 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2805,7 +2805,7 @@ void SdrObject::SendUserCall(SdrUserCallType eUserCall, const Rectangle& rBoundR { case SDRUSERCALL_RESIZE: notifyShapePropertyChange( svx::eShapeSize ); - // fall through - RESIZE might also imply a change of the position + SAL_FALLTHROUGH; // RESIZE might also imply a change of the position case SDRUSERCALL_MOVEONLY: notifyShapePropertyChange( svx::eShapePosition ); break; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 93cc4db67d04..930ae61a0099 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1304,7 +1304,7 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) SdrObjKind eNewKind=(SdrObjKind)nIdent; switch (eNewKind) { case OBJ_CARC: case OBJ_CIRC: case OBJ_CCUT: case OBJ_SECT: eNewKind=OBJ_CARC; - //fall-through + SAL_FALLTHROUGH; case OBJ_RECT: case OBJ_LINE: case OBJ_PLIN: case OBJ_POLY: case OBJ_PATHLINE: case OBJ_PATHFILL: diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index c30ee0cbf09a..b956061ab902 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -482,57 +482,68 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_TILT_DOWN: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_TILT_UP: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_TILT_LEFT: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_TILT_RIGHT: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_DIRECTION: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_PROJECTION: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_DEPTH: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_3D_COLOR: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_SURFACE: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_LIGHTING_INTENSITY: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_EXTRUSION_LIGHTING_DIRECTION: { if ( !nStrResId ) diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index 9d32139fafc2..07b688e84b8f 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -275,7 +275,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem SdrTextHorzAdjust eHorzAdjust; switch ( nValue ) { - case 4 : eFTS = SDRTEXTFIT_ALLLINES; // passthrough + case 4 : eFTS = SDRTEXTFIT_ALLLINES; SAL_FALLTHROUGH; case 3 : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break; default: eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break; case 1 : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break; @@ -506,17 +506,20 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_FONTWORK_CHARACTER_SPACING: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_FONTWORK_KERN_CHARACTER_PAIRS: { if ( !nStrResId ) nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING; - } // PASSTROUGH + SAL_FALLTHROUGH; + } case SID_FONTWORK_SAME_LETTER_HEIGHTS: { if ( !nStrResId ) diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index daa64a7dee59..061ca7acfc59 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -363,7 +363,7 @@ IMPL_LINK_TYPED(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) break; case SVX_ROMAN_UPPER: bUpper = true; - /* Fall through */ + SAL_FALLTHROUGH; case SVX_ROMAN_LOWER: aPageNumValue += SvxNumberFormat::CreateRomanString(mnPageNumber, bUpper); break; |