summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
parente4bb2b4f4875c15bd68297b5be716edd6859841e (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 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx4
-rw-r--r--xmloff/source/draw/animationexport.cxx2
-rw-r--r--xmloff/source/draw/animationimport.cxx3
-rw-r--r--xmloff/source/draw/eventimp.cxx4
-rw-r--r--xmloff/source/forms/elementexport.cxx12
-rw-r--r--xmloff/source/forms/propertyimport.cxx2
-rw-r--r--xmloff/source/forms/valueproperties.cxx2
-rw-r--r--xmloff/source/style/numehelp.cxx12
-rw-r--r--xmloff/source/style/xmlnumfe.cxx2
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx6
-rw-r--r--xmloff/source/text/txtexppr.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx2
-rw-r--r--xmloff/source/text/txtimppr.cxx4
-rw-r--r--xmloff/source/transform/StyleOASISTContext.cxx2
15 files changed, 33 insertions, 28 deletions
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 1d07bfe19ba6..95c57cf0d267 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -246,7 +246,7 @@ SvXMLImportContext *SchXMLTableContext::CreateChildContext(
{
case XML_TOK_TABLE_HEADER_COLS:
mrTable.bHasHeaderColumn = true;
- // fall through intended
+ SAL_FALLTHROUGH;
case XML_TOK_TABLE_COLUMNS:
pContext = new SchXMLTableColumnsContext( GetImport(), rLocalName, mrTable );
break;
@@ -257,7 +257,7 @@ SvXMLImportContext *SchXMLTableContext::CreateChildContext(
case XML_TOK_TABLE_HEADER_ROWS:
mrTable.bHasHeaderRow = true;
- // fall through intended
+ SAL_FALLTHROUGH;
case XML_TOK_TABLE_ROWS:
pContext = new SchXMLTableRowsContext( mrImportHelper, GetImport(), rLocalName, mrTable );
break;
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 7bc5521e770d..97ae81c7b97a 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -694,8 +694,8 @@ void AnimationsExporterImpl::prepareNode( const Reference< XAnimationNode >& xNo
{
Reference< XIterateContainer > xIter( xNode, UNO_QUERY_THROW );
prepareValue( xIter->getTarget() );
+ SAL_FALLTHROUGH;
}
- // its intended that here is no break!
case AnimationNodeType::PAR:
case AnimationNodeType::SEQ:
{
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index f6cb2e759919..a9dd0f778a35 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -875,9 +875,8 @@ void AnimationNodeContext::init_node( const css::uno::Reference< css::xml::sax:
xAudio->setSource( makeAny( GetImport().GetAbsoluteReference( rValue ) ) );
break;
}
-
+ SAL_FALLTHROUGH;
}
- // fall through intended!
case ANA_Target:
{
{
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index 8e6b65bd3a60..21c0085ed7d4 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -422,7 +422,7 @@ void SdXMLEventContext::EndElement()
case ClickAction_BOOKMARK:
msBookmark = msBookmark.copy(1);
- // Note: no break here!!!
+ SAL_FALLTHROUGH;
case ClickAction_DOCUMENT:
case ClickAction_PROGRAM:
@@ -445,7 +445,7 @@ void SdXMLEventContext::EndElement()
pProperties->State = beans::PropertyState_DIRECT_VALUE;
pProperties++;
- // NOTE: no break here!!!
+ SAL_FALLTHROUGH;
case ClickAction_SOUND:
pProperties->Name = "SoundURL";
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index f90e51c64f0e..f7bc4ee74ebf 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1454,7 +1454,7 @@ namespace xmloff
case FormComponentType::DATEFIELD:
m_eType = DATE;
knownType = true;
- // NO BREAK
+ SAL_FALLTHROUGH;
case FormComponentType::TIMEFIELD:
if ( !knownType )
{
@@ -1462,7 +1462,7 @@ namespace xmloff
knownType = true;
}
m_nIncludeSpecial |= SCA_VALIDATION;
- // NO BREAK
+ SAL_FALLTHROUGH;
case FormComponentType::NUMERICFIELD:
case FormComponentType::CURRENCYFIELD:
case FormComponentType::PATTERNFIELD:
@@ -1471,7 +1471,7 @@ namespace xmloff
m_eType = FORMATTED_TEXT;
knownType = true;
}
- // NO BREAK
+ SAL_FALLTHROUGH;
case FormComponentType::TEXTFIELD:
{ // it's some kind of edit. To know which type we need further investigation
@@ -1625,7 +1625,7 @@ namespace xmloff
m_eType = BUTTON;
m_nIncludeCommon |= CCA_TAB_STOP | CCA_LABEL;
m_nIncludeSpecial = SCA_DEFAULT_BUTTON | SCA_TOGGLE | SCA_FOCUS_ON_CLICK | SCA_IMAGE_POSITION | SCA_REPEAT_DELAY;
- // NO BREAK !
+ SAL_FALLTHROUGH;
case FormComponentType::IMAGEBUTTON:
if (BUTTON != m_eType)
{
@@ -1642,7 +1642,7 @@ namespace xmloff
case FormComponentType::CHECKBOX:
m_eType = CHECKBOX;
m_nIncludeSpecial = SCA_CURRENT_STATE | SCA_IS_TRISTATE | SCA_STATE;
- // NO BREAK !
+ SAL_FALLTHROUGH;
case FormComponentType::RADIOBUTTON:
m_nIncludeCommon =
CCA_NAME | CCA_SERVICE_NAME | CCA_DISABLED | CCA_LABEL | CCA_PRINTABLE |
@@ -1707,7 +1707,7 @@ namespace xmloff
default:
OSL_FAIL("OControlExport::examineControl: unknown control type (class id)!");
- // NO break!
+ SAL_FALLTHROUGH;
case FormComponentType::NAVIGATIONBAR:
// TODO: should we have an own file format for this?
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index c12775989f8f..fa92c1c53552 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -120,7 +120,7 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType,
break;
}
bEnumAsInt = true;
- // NO BREAK! handle it as enum
+ SAL_FALLTHROUGH;
case TypeClass_ENUM:
{
sal_uInt16 nEnumValue(0);
diff --git a/xmloff/source/forms/valueproperties.cxx b/xmloff/source/forms/valueproperties.cxx
index 8f0c542af581..94bd723c7a5b 100644
--- a/xmloff/source/forms/valueproperties.cxx
+++ b/xmloff/source/forms/valueproperties.cxx
@@ -61,7 +61,7 @@ namespace xmloff
case FormComponentType::FILECONTROL:
case FormComponentType::COMBOBOX:
_rpValuePropertyName = PROPERTY_DEFAULT_TEXT;
- // NO BREAK!!
+ SAL_FALLTHROUGH;
case FormComponentType::COMMANDBUTTON:
_rpCurrentValuePropertyName = PROPERTY_TEXT;
break;
diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx
index 2e13bca105d5..84288edf105c 100644
--- a/xmloff/source/style/numehelp.cxx
+++ b/xmloff/source/style/numehelp.cxx
@@ -118,7 +118,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT);
bWasSetTypeAttribute = true;
}
- } // No Break
+ SAL_FALLTHROUGH;
+ }
case util::NumberFormat::PERCENT:
{
if (!bWasSetTypeAttribute)
@@ -126,7 +127,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_PERCENTAGE);
bWasSetTypeAttribute = true;
}
- } // No Break
+ SAL_FALLTHROUGH;
+ }
case util::NumberFormat::CURRENCY:
{
if (!bWasSetTypeAttribute)
@@ -385,7 +387,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
pExport->AddAttribute(sAttrValType, XML_FLOAT);
bWasSetTypeAttribute = true;
}
- } // No Break
+ SAL_FALLTHROUGH;
+ }
case util::NumberFormat::PERCENT:
{
if (!bWasSetTypeAttribute)
@@ -393,7 +396,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
pExport->AddAttribute(sAttrValType, XML_PERCENTAGE);
bWasSetTypeAttribute = true;
}
- } // No Break
+ SAL_FALLTHROUGH;
+ }
case util::NumberFormat::CURRENCY:
{
if (!bWasSetTypeAttribute)
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 218321e91f58..b1637f8374e6 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1014,7 +1014,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
// number-style.
case css::util::NumberFormat::UNDEFINED:
SAL_WARN("xmloff.style","UNDEFINED number format: '" << rFormat.GetFormatstring() << "'");
- // fallthru
+ SAL_FALLTHROUGH;
// Type is 0 if a format contains no recognized elements
// (like text only) - this is handled as a number-style.
case 0:
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index bad3d03f0640..e0e0a63f9068 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -267,7 +267,7 @@ SvXMLImportContext *XMLTextListBlockContext::CreateChildContext(
{
case XML_TOK_TEXT_LIST_HEADER:
bHeader = true;
- //fall-through
+ SAL_FALLTHROUGH;
case XML_TOK_TEXT_LIST_ITEM:
pContext = new XMLTextListItemContext( GetImport(), mrTxtImport,
nPrefix, rLocalName,
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 2cb098aba481..22027c3edcb2 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -214,7 +214,8 @@ void XMLTextMarkImportContext::EndElement()
break; // don't insert
}
}
- } // fall through
+ }
+ SAL_FALLTHROUGH;
case TypeFieldmark:
{
const char *formFieldmarkName=lcl_getFormFieldmarkName(m_sFieldName);
@@ -281,7 +282,8 @@ void XMLTextMarkImportContext::EndElement()
break; // don't insert
}
}
- } // fall through
+ }
+ SAL_FALLTHROUGH;
case TypeFieldmarkEnd:
{
// get old range, and construct
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 5bf94615fa0e..687fa59383ba 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -993,7 +993,7 @@ void XMLTextExportPropertySetMapper::ContextFilter(
// no wrapping: disable para-only and contour
if( pWrapParagraphOnlyState )
pWrapParagraphOnlyState->mnIndex = -1;
- // no break
+ SAL_FALLTHROUGH;
case WrapTextMode_THROUGHT:
// wrap through: disable only contour
if( pWrapContourState )
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 7353bcd33ad5..c198d272d056 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -849,7 +849,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
{
ExportMetaField(xPropSet, true, bProgress);
}
- // fall-through: for the meta-field itself!
+ SAL_FALLTHROUGH;
case FIELD_ID_DOCINFO_PRINT_TIME:
case FIELD_ID_DOCINFO_PRINT_DATE:
case FIELD_ID_DOCINFO_CREATION_DATE:
diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx
index 44ab6903613a..f89a142d0636 100644
--- a/xmloff/source/text/txtimppr.cxx
+++ b/xmloff/source/text/txtimppr.cxx
@@ -481,7 +481,7 @@ void XMLTextImportPropertyMapper::finished(
case CTF_FRAMEHEIGHT_MIN_REL:
// case CTF_SYNCHEIGHT_MIN:
bHasAnyMinHeight = true;
- // no break here!
+ SAL_FALLTHROUGH;
case CTF_FRAMEHEIGHT_ABS:
case CTF_FRAMEHEIGHT_REL:
// case CTF_SYNCHEIGHT:
@@ -489,7 +489,7 @@ void XMLTextImportPropertyMapper::finished(
case CTF_FRAMEWIDTH_MIN_ABS:
case CTF_FRAMEWIDTH_MIN_REL:
bHasAnyMinWidth = true;
- // no break here!
+ SAL_FALLTHROUGH;
case CTF_FRAMEWIDTH_ABS:
case CTF_FRAMEWIDTH_REL:
bHasAnyWidth = true; break;
diff --git a/xmloff/source/transform/StyleOASISTContext.cxx b/xmloff/source/transform/StyleOASISTContext.cxx
index 65f72b3562a2..eb236200f778 100644
--- a/xmloff/source/transform/StyleOASISTContext.cxx
+++ b/xmloff/source/transform/StyleOASISTContext.cxx
@@ -858,7 +858,7 @@ void XMLStyleOASISTContext::StartElement(
break;
case XML_ATACTION_DECODE_STYLE_NAME:
m_bControlStyle = rAttrValue.startsWith( "ctrl" );
- // fall-through
+ SAL_FALLTHROUGH;
case XML_ATACTION_DECODE_STYLE_NAME_REF:
{
OUString aAttrValue( rAttrValue );