summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx2
-rw-r--r--svx/source/dialog/rubydialog.cxx4
-rw-r--r--svx/source/dialog/svxruler.cxx4
-rw-r--r--svx/source/fmcomp/gridcell.cxx2
-rw-r--r--svx/source/fmcomp/gridctrl.cxx7
-rw-r--r--svx/source/form/fmshell.cxx4
-rw-r--r--svx/source/form/fmsrcimp.cxx2
-rw-r--r--svx/source/form/fmvwimp.cxx2
-rw-r--r--svx/source/form/formcontrolfactory.cxx2
-rw-r--r--svx/source/items/rotmodit.cxx2
-rw-r--r--svx/source/svdraw/svdhdl.cxx2
-rw-r--r--svx/source/svdraw/svdobj.cxx2
-rw-r--r--svx/source/svdraw/svdopath.cxx2
-rw-r--r--svx/source/toolbars/extrusionbar.cxx33
-rw-r--r--svx/source/toolbars/fontworkbar.cxx11
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx2
16 files changed, 50 insertions, 33 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index e65e60cdc7c7..8ed0518cc70c 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2037,7 +2037,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 223727c85059..3cf1d17ddb05 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -888,8 +888,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)
@@ -905,8 +905,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 9f55e1b978a1..c010985902a8 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1764,7 +1764,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;
@@ -1848,7 +1848,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 28115bc369f0..1daaf351ad72 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -158,7 +158,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 53bf0f894543..0fbf38422be5 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2900,8 +2900,9 @@ void DbGridControl::Command(const CommandEvent& rEvt)
DbGridControl_Base::Command(rEvt);
return;
}
+
+ SAL_FALLTHROUGH;
}
- //fall-through
default:
DbGridControl_Base::Command(rEvt);
}
@@ -3320,7 +3321,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 18a29f44c7ed..30514ae30f5c 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;
@@ -872,7 +872,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 98a48cbddf29..c5817ff7d306 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -613,7 +613,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 b49d64418dfa..7badff7df860 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1331,7 +1331,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 853aed3cd538..444186024f46 100644
--- a/svx/source/form/formcontrolfactory.cxx
+++ b/svx/source/form/formcontrolfactory.cxx
@@ -405,7 +405,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 639cd2e40d6b..0da46f748f6c 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 4e931a9888d8..66ffc0a8f08a 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2814,7 +2814,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 0a0ee30862af..e51f318f557c 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -1308,7 +1308,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 b364f051daa4..d7309827819b 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 9affc7146a4b..2a61710413f0 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;