summaryrefslogtreecommitdiff
path: root/writerfilter
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 /writerfilter
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 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.cxx2
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfdispatchflag.cxx3
-rw-r--r--writerfilter/source/rtftok/rtfdispatchvalue.cxx18
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx2
6 files changed, 20 insertions, 13 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index acc320af7c83..5eb24e9472b3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2273,7 +2273,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
break;
case NS_ooxml::LN_paratrackchange:
m_pImpl->StartParaMarkerChange( );
- /* fallthrough */
+ SAL_FALLTHROUGH;
case NS_ooxml::LN_CT_PPr_pPrChange:
case NS_ooxml::LN_trackchange:
case NS_ooxml::LN_EG_RPrContent_rPrChange:
@@ -3364,7 +3364,7 @@ void DomainMapper::handleUnderlineType(const Id nId, const ::std::shared_ptr<Pro
break;
case NS_ooxml::LN_Value_ST_Underline_words:
rContext->Insert(PROP_CHAR_WORD_MODE, uno::makeAny(true));
- // fall-through intended
+ SAL_FALLTHROUGH;
case NS_ooxml::LN_Value_ST_Underline_single:
nUnderline = awt::FontUnderline::SINGLE;
break;
@@ -3435,7 +3435,7 @@ void DomainMapper::handleParaJustification(const sal_Int32 nIntValue, const ::st
break;
case 4:
nLastLineAdjust = style::ParagraphAdjust_BLOCK;
- //no break;
+ SAL_FALLTHROUGH;
case NS_ooxml::LN_Value_ST_Jc_both:
nAdjust = style::ParagraphAdjust_BLOCK;
aStringValue = "both";
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 05eb20d3569c..57fcf24818e1 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -439,7 +439,7 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
break;
default:
SAL_WARN("writerfilter", "unknown LN_CT_Style_type " << nType);
- //fall-through
+ SAL_FALLTHROUGH;
case 0: // explicit unknown set by tokenizer
break;
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 30eb8a8f9df2..e0c9f07d5f86 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1624,7 +1624,7 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
case NMSP_vmlOffice:
if (!bGroupShape)
xContextHandler.set(OOXMLFactory::createFastChildContextFromStart(this, Element));
- // no break;
+ SAL_FALLTHROUGH;
default:
if (!xContextHandler.is())
{
diff --git a/writerfilter/source/rtftok/rtfdispatchflag.cxx b/writerfilter/source/rtftok/rtfdispatchflag.cxx
index d3bc5175b282..6888f3f80eb4 100644
--- a/writerfilter/source/rtftok/rtfdispatchflag.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchflag.cxx
@@ -978,11 +978,12 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_numFmt, std::make_shared<RTFValue>(23)); // bullets, same as \levelnfc23
}
break;
- case RTF_LANDSCAPE: // fall through: set the default + current value
+ case RTF_LANDSCAPE:
{
auto pValue = std::make_shared<RTFValue>(NS_ooxml::LN_Value_ST_PageOrientation_landscape);
putNestedAttribute(m_aDefaultState.aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_orient, pValue);
+ SAL_FALLTHROUGH; // set the default + current value
}
case RTF_LNDSCPSXN:
{
diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 76e24ddfe9e7..27777108b293 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -860,41 +860,47 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
rAttributes.set((nKeyword == RTF_COLW ? NS_ooxml::LN_CT_Column_w : NS_ooxml::LN_CT_Column_space), pIntValue);
}
break;
- case RTF_PAPERH: // fall through: set the default + current value
+ case RTF_PAPERH:
putNestedAttribute(m_aDefaultState.aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_PGHSXN:
putNestedAttribute(m_aStates.top().aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_h, pIntValue);
break;
- case RTF_PAPERW: // fall through: set the default + current value
+ case RTF_PAPERW:
putNestedAttribute(m_aDefaultState.aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_PGWSXN:
putNestedAttribute(m_aStates.top().aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgSz, NS_ooxml::LN_CT_PageSz_w, pIntValue);
break;
- case RTF_MARGL: // fall through: set the default + current value
+ case RTF_MARGL:
putNestedAttribute(m_aDefaultState.aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_MARGLSXN:
putNestedAttribute(m_aStates.top().aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_left, pIntValue);
break;
- case RTF_MARGR: // fall through: set the default + current value
+ case RTF_MARGR:
putNestedAttribute(m_aDefaultState.aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_MARGRSXN:
putNestedAttribute(m_aStates.top().aSectionSprms,
NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_right, pIntValue);
break;
- case RTF_MARGT: // fall through: set the default + current value
+ case RTF_MARGT:
putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_MARGTSXN:
putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_top, pIntValue);
break;
- case RTF_MARGB: // fall through: set the default + current value
+ case RTF_MARGB:
putNestedAttribute(m_aDefaultState.aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue);
+ SAL_FALLTHROUGH; // set the default + current value
case RTF_MARGBSXN:
putNestedAttribute(m_aStates.top().aSectionSprms, NS_ooxml::LN_EG_SectPrContents_pgMar, NS_ooxml::LN_CT_PageMar_bottom, pIntValue);
break;
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index e69ec23af97a..56b99fce863f 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -301,7 +301,7 @@ int RTFSdrImport::initShape(uno::Reference<drawing::XShape>& o_xShape,
o_xPropSet->setPropertyValue(aDefaults[j].Name, aDefaults[j].Value);
break;
}
- // fall-through intended
+ SAL_FALLTHROUGH;
default:
createShape("com.sun.star.drawing.CustomShape", o_xShape, o_xPropSet);
o_rIsCustomShape = true;