diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-16 21:00:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-17 00:28:17 +0100 |
commit | 314f15bff08b76bf96acf99141776ef64d2f1355 (patch) | |
tree | 842f7b109d9c4a57fa47fc5089f5818b2610368b /xmloff | |
parent | 46920005f74edcb70acfb8dd1a0ffb9553e5c2b2 (diff) |
Extend loplugin:external to warn about enums
To mitigate the dangers of silently breaking ADL when moving enums into unnamed
namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79
"New loplugin:external"), note all functions that are affected. (The plan is to
extend loplugin:external further to also warn about classes and class templates,
and the code to identify affected functions already takes that into account, so
some parts of that code are not actually relevant for enums.)
But it appears that none of the functions that are actually affected by the
changes in this commit relied on being found through ADL, so no adaptions were
necessary for them.
(clang::DeclContext::collectAllContexts is non-const, which recursively means
that External's Visit... functions must take non-const Decl*. Which required
compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support
such Visit... functions with non-const Decl* parameters.)
Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd
Reviewed-on: https://gerrit.libreoffice.org/83001
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmloff')
31 files changed, 127 insertions, 1 deletions
diff --git a/xmloff/source/chart/XMLSymbolImageContext.cxx b/xmloff/source/chart/XMLSymbolImageContext.cxx index 5fce5f613f05..36fd0eafa6e9 100644 --- a/xmloff/source/chart/XMLSymbolImageContext.cxx +++ b/xmloff/source/chart/XMLSymbolImageContext.cxx @@ -29,6 +29,8 @@ using namespace css; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_SYMBOL_IMAGE_HREF, @@ -37,6 +39,8 @@ enum SvXMLTokenMapAttrs XML_TOK_SYMBOL_IMAGE_SHOW, }; +} + static const SvXMLTokenMapEntry aSymbolImageAttrTokenMap[] = { { XML_NAMESPACE_XLINK, ::xmloff::token::XML_HREF, XML_TOK_SYMBOL_IMAGE_HREF }, diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index c7126b055865..40d5a8f0d6db 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -55,6 +55,7 @@ using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::Any; using ::com::sun::star::document::XEventsSupplier; +namespace { enum XMLImageMapToken: decltype(XML_TOK_UNKNOWN) { @@ -73,6 +74,8 @@ enum XMLImageMapToken: decltype(XML_TOK_UNKNOWN) XML_TOK_IMAP_TARGET }; +} + static const SvXMLTokenMapEntry aImageMapObjectTokenMap[] = { { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_IMAP_URL }, diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index f436035ef56c..082f7ad5153b 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -164,6 +164,8 @@ const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeTokenMap() return *mpAnimationNodeTokenMap; } +namespace { + enum AnimationNodeAttributes { ANA_Begin, @@ -217,6 +219,8 @@ enum AnimationNodeAttributes ANA_Volume }; +} + const SvXMLTokenMap& AnimationsImportHelperImpl::getAnimationNodeAttributeTokenMap() { if( mpAnimationNodeAttributeTokenMap == nullptr ) diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx index 3036aa97e20d..2b0071cd1b5b 100644 --- a/xmloff/source/draw/animexp.cxx +++ b/xmloff/source/draw/animexp.cxx @@ -186,6 +186,8 @@ void SdXMLImplSetEffect( AnimationEffect eEffect, XMLEffect& eKind, XMLEffectDir bIn = rEffect.mbIn; } +namespace { + enum XMLActionKind { XMLE_SHOW, @@ -194,6 +196,8 @@ enum XMLActionKind XMLE_PLAY }; +} + struct XMLEffectHint { XMLActionKind meKind; diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx index 38d8f5eb0148..f1ad97e5af1f 100644 --- a/xmloff/source/draw/animimp.cxx +++ b/xmloff/source/draw/animimp.cxx @@ -335,6 +335,8 @@ public: static constexpr OUStringLiteral gsIsAnimation = "IsAnimation"; }; +namespace { + enum XMLActionKind { XMLE_SHOW, @@ -343,6 +345,8 @@ enum XMLActionKind XMLE_PLAY }; +} + class XMLAnimationsEffectContext : public SvXMLImportContext { public: diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index ddd128d1d8b0..affbfd01a779 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1577,6 +1577,7 @@ void XMLShapeExport::ImpExportText( const uno::Reference< drawing::XShape >& xSh } } +namespace { enum class Found { NONE = 0x0000, @@ -1591,6 +1592,9 @@ enum class Found { MACRO = 0x0100, LIBRARY = 0x0200, }; + +} + namespace o3tl { template<> struct typed_flags<Found> : is_typed_flags<Found, 0x03ff> {}; } diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx index 85173e11b9f2..5f61a157372f 100644 --- a/xmloff/source/style/DashStyle.cxx +++ b/xmloff/source/style/DashStyle.cxx @@ -39,6 +39,8 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_DASH_NAME, @@ -51,6 +53,8 @@ enum SvXMLTokenMapAttrs XML_TOK_DASH_DISTANCE, }; +} + static const SvXMLTokenMapEntry aDashStyleAttrTokenMap[] = { { XML_NAMESPACE_DRAW, XML_NAME, XML_TOK_DASH_NAME }, diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx index 177c21b80ba5..59495892df44 100644 --- a/xmloff/source/style/GradientStyle.cxx +++ b/xmloff/source/style/GradientStyle.cxx @@ -39,6 +39,8 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_GRADIENT_NAME, @@ -55,6 +57,8 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; +} + SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx index 899223754c61..e7f03a817e53 100644 --- a/xmloff/source/style/HatchStyle.cxx +++ b/xmloff/source/style/HatchStyle.cxx @@ -39,6 +39,8 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_HATCH_NAME, @@ -50,6 +52,8 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_END=XML_TOK_UNKNOWN }; +} + SvXMLEnumMapEntry<drawing::HatchStyle> const pXML_HatchStyle_Enum[] = { { XML_HATCHSTYLE_SINGLE, drawing::HatchStyle_SINGLE }, diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx index 164f155fb02e..6fe12b40b2bc 100644 --- a/xmloff/source/style/ImageStyle.cxx +++ b/xmloff/source/style/ImageStyle.cxx @@ -32,6 +32,8 @@ using namespace css; using namespace xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_IMAGE_NAME, @@ -42,6 +44,8 @@ enum SvXMLTokenMapAttrs XML_TOK_IMAGE_ACTUATE }; +} + void XMLImageStyle::exportXML(OUString const & rStrName, uno::Any const & rValue, SvXMLExport& rExport) { if (rStrName.isEmpty()) diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx index 510713ca1ae8..30e4e56426d5 100644 --- a/xmloff/source/style/TransGradientStyle.cxx +++ b/xmloff/source/style/TransGradientStyle.cxx @@ -39,6 +39,8 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_GRADIENT_NAME, @@ -52,6 +54,8 @@ enum SvXMLTokenMapAttrs XML_TOK_GRADIENT_BORDER }; +} + SvXMLEnumMapEntry<awt::GradientStyle> const pXML_GradientStyle_Enum[] = { { XML_GRADIENTSTYLE_LINEAR, awt::GradientStyle_LINEAR }, diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx index 6bdafccff70e..b9ccb73c9c1a 100644 --- a/xmloff/source/style/XMLBackgroundImageContext.cxx +++ b/xmloff/source/style/XMLBackgroundImageContext.cxx @@ -43,6 +43,8 @@ using namespace ::com::sun::star::style; using namespace ::com::sun::star::io; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_BGIMG_HREF, @@ -54,6 +56,9 @@ enum SvXMLTokenMapAttrs XML_TOK_BGIMG_FILTER, XML_TOK_BGIMG_OPACITY }; + +} + static const SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] = { { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_BGIMG_HREF }, diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index 0c8e18a66711..cbb364663502 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -50,6 +50,8 @@ using namespace ::xmloff::token; #define XML_STYLE_FAMILY_FONT 1 +namespace { + enum XMLFontStyleAttrTokens { XML_TOK_FONT_STYLE_ATTR_FAMILY, @@ -59,6 +61,8 @@ enum XMLFontStyleAttrTokens XML_TOK_FONT_STYLE_ATTR_CHARSET, }; +} + static const SvXMLTokenMapEntry* lcl_getFontStyleAttrTokenMap() { static const SvXMLTokenMapEntry aFontStyleAttrTokenMap[] = diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index c01992740f5e..29f9e1f7527b 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -192,6 +192,8 @@ public: virtual void EndElement() override; }; +namespace { + enum SvXMLStyleTokens { XML_TOK_STYLE_TEXT, @@ -264,6 +266,7 @@ enum SvXMLStyleElemAttrTokens XML_TOK_ELEM_ATTR_CALENDAR }; +} // standard colors diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 710bb3ede574..09c95178212b 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -99,6 +99,8 @@ public: SvxXMLListLevelStyleContext_Impl& rLLevel ); }; +namespace { + enum SvxXMLTextListLevelStyleAttrTokens { XML_TOK_TEXT_LEVEL_ATTR_LEVEL, @@ -116,6 +118,8 @@ enum SvxXMLTextListLevelStyleAttrTokens XML_TOK_TEXT_LEVEL_ATTR_DISPLAY_LEVELS }; +} + static const SvXMLTokenMapEntry* lcl_getLevelAttrTokenMap() { static const SvXMLTokenMapEntry aLevelAttrTokenMap[] = @@ -583,6 +587,8 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties() return aPropSeq; } +namespace { + enum SvxXMLStyleAttributesAttrTokens { XML_TOK_STYLE_ATTRIBUTES_ATTR_SPACE_BEFORE, @@ -605,6 +611,8 @@ enum SvxXMLStyleAttributesAttrTokens XML_TOK_STYLE_ATTRIBUTES_ATTR_POSITION_AND_SPACE_MODE }; +} + static const SvXMLTokenMapEntry* lcl_getStyleAttributesAttrTokenMap() { static const SvXMLTokenMapEntry aStyleAttributesAttrTokenMap[] = @@ -912,6 +920,8 @@ SvXMLImportContextRef SvxXMLListLevelStyleAttrContext_Impl::CreateChildContext( return pContext; } +namespace { + enum SvxXMLStyleAttributesLabelAlignmentAttrTokens { XML_TOK_STYLE_ATTRIBUTES_ATTR_LABEL_FOLLOWED_BY, @@ -919,6 +929,9 @@ enum SvxXMLStyleAttributesLabelAlignmentAttrTokens XML_TOK_STYLE_ATTRIBUTES_ATTR_FIRST_LINE_INDENT, XML_TOK_STYLE_ATTRIBUTES_ATTR_INDENT_AT }; + +} + static const SvXMLTokenMapEntry* lcl_getStyleAlignmentAttributesAttrTokenMap() { static const SvXMLTokenMapEntry aStyleAlignmentAttributesAttrTokenMap[] = diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx index 95ae3a67442d..158d696393fc 100644 --- a/xmloff/source/style/xmltabi.cxx +++ b/xmloff/source/style/xmltabi.cxx @@ -31,6 +31,8 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_TABSTOP_POSITION, @@ -40,6 +42,8 @@ enum SvXMLTokenMapAttrs XML_TOK_TABSTOP_LEADER_TEXT }; +} + static const SvXMLTokenMapEntry aTabsAttributesAttrTokenMap[] = { { XML_NAMESPACE_STYLE, XML_POSITION, XML_TOK_TABSTOP_POSITION }, diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index d9ce1134ca1f..cf3beb02918f 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -159,6 +159,8 @@ XMLFootnoteConfigurationImportContext::~XMLFootnoteConfigurationImportContext() { } +namespace { + enum XMLFtnConfigToken { XML_TOK_FTNCONFIG_CITATION_STYLENAME, @@ -174,6 +176,8 @@ enum XMLFtnConfigToken XML_TOK_FTNCONFIG_POSITION }; +} + static const SvXMLTokenMapEntry aTextFieldAttrTokenMap[] = { { XML_NAMESPACE_TEXT, XML_CITATION_STYLE_NAME, XML_TOK_FTNCONFIG_CITATION_STYLENAME }, diff --git a/xmloff/source/text/XMLFootnoteImportContext.cxx b/xmloff/source/text/XMLFootnoteImportContext.cxx index 9569d4119a84..4361417f28f6 100644 --- a/xmloff/source/text/XMLFootnoteImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteImportContext.cxx @@ -42,12 +42,15 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::xml::sax; using namespace ::xmloff::token; +namespace { enum XMLFootnoteChildToken { XML_TOK_FTN_NOTE_CITATION, XML_TOK_FTN_NOTE_BODY }; +} + static const SvXMLTokenMapEntry aFootnoteChildTokenMap[] = { { XML_NAMESPACE_TEXT, XML_NOTE_CITATION, diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index 02d545cdd871..66be9d7a576e 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -185,7 +185,7 @@ void XMLIndexTemplateContext::EndElement() } } - +namespace { /// template token types; used for aTokenTypeMap parameter enum TemplateTokenType { @@ -199,6 +199,7 @@ enum TemplateTokenType XML_TOK_INDEX_TYPE_BIBLIOGRAPHY }; +} SvXMLEnumMapEntry<TemplateTokenType> const aTemplateTokenTypeMap[] = { diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 2ae5b7520bde..db936652cea4 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -1041,6 +1041,7 @@ bool XMLSectionExport::ExportIndexTemplate( return true; } +namespace { enum TemplateTypeEnum { @@ -1070,6 +1071,8 @@ enum TemplateParamEnum TOK_TPARAM_BIBLIOGRAPHY_DATA }; +} + SvXMLEnumStringMapEntry<TemplateTypeEnum> const aTemplateTypeMap[] = { ENUM_STRING_MAP_ENTRY( "TokenEntryNumber", TOK_TTYPE_ENTRY_NUMBER ), diff --git a/xmloff/source/text/XMLSectionImportContext.cxx b/xmloff/source/text/XMLSectionImportContext.cxx index e7754047aacd..d5783a26fcc3 100644 --- a/xmloff/source/text/XMLSectionImportContext.cxx +++ b/xmloff/source/text/XMLSectionImportContext.cxx @@ -47,6 +47,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; using namespace ::xmloff::token; +namespace { enum XMLSectionToken { @@ -60,6 +61,8 @@ enum XMLSectionToken XML_TOK_SECTION_IS_HIDDEN }; +} + static const SvXMLTokenMapEntry aSectionTokenMap[] = { { XML_NAMESPACE_XML , XML_ID, XML_TOK_SECTION_XMLID }, diff --git a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx index beecdbb5b396..3969baba9cc0 100644 --- a/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx +++ b/xmloff/source/text/XMLSectionSourceDDEImportContext.cxx @@ -53,6 +53,8 @@ XMLSectionSourceDDEImportContext::~XMLSectionSourceDDEImportContext() { } +namespace { + enum XMLSectionSourceDDEToken { XML_TOK_SECTION_DDE_APPLICATION, @@ -61,6 +63,8 @@ enum XMLSectionSourceDDEToken XML_TOK_SECTION_IS_AUTOMATIC_UPDATE }; +} + static const SvXMLTokenMapEntry aSectionSourceDDETokenMap[] = { { XML_NAMESPACE_OFFICE, XML_DDE_APPLICATION, diff --git a/xmloff/source/text/XMLSectionSourceImportContext.cxx b/xmloff/source/text/XMLSectionSourceImportContext.cxx index 006fbe5b076e..ec6bd06dec27 100644 --- a/xmloff/source/text/XMLSectionSourceImportContext.cxx +++ b/xmloff/source/text/XMLSectionSourceImportContext.cxx @@ -52,6 +52,7 @@ XMLSectionSourceImportContext::~XMLSectionSourceImportContext() { } +namespace { enum XMLSectionSourceToken { XML_TOK_SECTION_XLINK_HREF, @@ -59,6 +60,8 @@ enum XMLSectionSourceToken XML_TOK_SECTION_TEXT_SECTION_NAME }; +} + static const SvXMLTokenMapEntry aSectionSourceTokenMap[] = { { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_SECTION_XLINK_HREF }, diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx index b62b66fde137..b8f3d55e4884 100644 --- a/xmloff/source/text/XMLTextColumnsContext.cxx +++ b/xmloff/source/text/XMLTextColumnsContext.cxx @@ -40,6 +40,8 @@ using namespace ::com::sun::star::style; using namespace ::com::sun::star::beans; using namespace ::xmloff::token; +namespace { + enum SvXMLTokenMapAttrs { XML_TOK_COLUMN_WIDTH, @@ -56,6 +58,8 @@ enum SvXMLSepTokenMapAttrs XML_TOK_COLUMN_SEP_STYLE }; +} + static const SvXMLTokenMapEntry aColAttrTokenMap[] = { { XML_NAMESPACE_STYLE, XML_REL_WIDTH, XML_TOK_COLUMN_WIDTH }, diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index 9d13c810b240..4dd5c1e76f90 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -107,11 +107,15 @@ XMLTextMarkImportContext::XMLTextMarkImportContext( { } +namespace { + enum lcl_MarkType { TypeReference, TypeReferenceStart, TypeReferenceEnd, TypeBookmark, TypeBookmarkStart, TypeBookmarkEnd, TypeFieldmark, TypeFieldmarkStart, TypeFieldmarkEnd }; +} + static SvXMLEnumMapEntry<lcl_MarkType> const lcl_aMarkTypeMap[] = { { XML_REFERENCE_MARK, TypeReference }, diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx index 8e7dc0e2100b..cceb49caa51c 100644 --- a/xmloff/source/text/txtdropi.cxx +++ b/xmloff/source/text/txtdropi.cxx @@ -37,6 +37,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; using namespace ::xmloff::token; +namespace { enum SvXMLTokenMapDropAttrs { @@ -46,6 +47,8 @@ enum SvXMLTokenMapDropAttrs XML_TOK_DROP_STYLE }; +} + static const SvXMLTokenMapEntry aDropAttrTokenMap[] = { { XML_NAMESPACE_STYLE, XML_LINES, XML_TOK_DROP_LINES }, diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index cde1edd6daa3..10e246596821 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2666,6 +2666,7 @@ void XMLReferenceFieldImportContext::PrepareField( // field declarations container +namespace { enum DdeFieldDeclAttrs { @@ -2676,6 +2677,8 @@ enum DdeFieldDeclAttrs XML_TOK_DDEFIELD_UPDATE }; +} + static const SvXMLTokenMapEntry aDdeDeclAttrTokenMap[] = { { XML_NAMESPACE_OFFICE, XML_NAME, XML_TOK_DDEFIELD_NAME }, diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 0238e918535d..00b4968aa5fe 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -355,6 +355,8 @@ static const sal_Char* aParagraphPropertyNamesAuto[] = nullptr }; +namespace { + enum eParagraphPropertyNamesEnumAuto { NUMBERING_RULES_AUTO = 0, @@ -362,6 +364,8 @@ enum eParagraphPropertyNamesEnumAuto PARA_STYLE_NAME_AUTO = 2 }; +} + static const sal_Char* aParagraphPropertyNames[] = { "NumberingIsNumber", @@ -373,6 +377,8 @@ static const sal_Char* aParagraphPropertyNames[] = nullptr }; +namespace { + enum eParagraphPropertyNamesEnum { NUMBERING_IS_NUMBER = 0, @@ -383,6 +389,8 @@ enum eParagraphPropertyNamesEnum TEXT_SECTION = 5 }; +} + void BoundFrames::Fill(const filter_t& rFilter) { if(!m_xEnumAccess.is()) diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index 5a1f2255035e..e2ddd6ec42d5 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -1052,6 +1052,7 @@ void XMLDatabaseDisplayImportContext::EndElement() // value import helper +namespace { enum ValueType { @@ -1064,6 +1065,8 @@ enum ValueType XML_VALUE_TYPE_BOOLEAN }; +} + static SvXMLEnumMapEntry<ValueType> const aValueTypeMap[] = { { XML_FLOAT, XML_VALUE_TYPE_FLOAT }, diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx index f270cb49cb9f..1e6055ebec14 100644 --- a/xmloff/source/transform/OOo2Oasis.cxx +++ b/xmloff/source/transform/OOo2Oasis.cxx @@ -50,6 +50,8 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::beans; +namespace { + enum XMLUserDefinedTransformerAction { XML_ETACTION_DOCUMENT=XML_ETACTION_USER_DEFINED, @@ -68,6 +70,8 @@ enum XMLUserDefinedTransformerAction XML_ETACTION_TABLE }; +} + #define ENTRY3( n, l, a, p1, p2, p3 ) \ { XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 } #define ENTRY3QQN( n, l, a, n1, l1, n2, l2, p3 ) \ diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 4b85666a02cc..0f55019aa7b9 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -54,6 +54,8 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::beans; +namespace { + enum XMLUserDefinedTransformerAction { XML_ETACTION_META=XML_ETACTION_USER_DEFINED, @@ -75,6 +77,8 @@ enum XMLUserDefinedTransformerAction XML_ETACTION_CHART_PLOT_AREA }; +} + #define ENTRY3( n, l, a, p1, p2, p3 ) \ { XML_NAMESPACE_##n, XML_##l, a, p1, p2, p3 } #define ENTRY3QNQ( n, l, a, n1, l1, p2, n3, l3 ) \ |