diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-08 19:54:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-01-09 13:01:49 +0100 |
commit | ac396f2f6b058ddff8c394443669b8c5d8b97b71 (patch) | |
tree | fc5120838a69ced58c3cd2333718ffeb6d4adf67 /xmloff | |
parent | 0c20b68149797c8b0779534a8e0cb9045085d451 (diff) |
fix coverity parse errors
Change-Id: I3a1179947704452e3ffec02be59d0f7bf0b75ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109017
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/chart/SchXMLTableContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/forms/elementimport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/meta/xmlversion.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextListBlockContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextMarkImportContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 54 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/text/txtvfldi.cxx | 18 |
11 files changed, 68 insertions, 68 deletions
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 15de497408aa..01ebb74b84bd 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -55,7 +55,7 @@ using ::com::sun::star::uno::Reference; namespace { -const OUStringLiteral aCategoriesRange = u"categories"; +constexpr OUStringLiteral aCategoriesRange = u"categories"; typedef ::std::multimap< OUString, OUString > lcl_tOriginalRangeToInternalRangeMap; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index dac4db9eb464..fad6a7e484e0 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1358,9 +1358,9 @@ static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, cons return pPrefix + OUString::number( nIndex ); } -const OUStringLiteral gpStrHeaderTextPrefix = u"hdr"; -const OUStringLiteral gpStrFooterTextPrefix = u"ftr"; -const OUStringLiteral gpStrDateTimeTextPrefix = u"dtd"; +constexpr OUStringLiteral gpStrHeaderTextPrefix = u"hdr"; +constexpr OUStringLiteral gpStrFooterTextPrefix = u"ftr"; +constexpr OUStringLiteral gpStrDateTimeTextPrefix = u"dtd"; HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference<XDrawPage>& xDrawPage ) { diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 2ac15ae78ed5..c2fb5999fdea 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -112,10 +112,10 @@ struct XMLShapeImportHelperImpl bool mbIsPresentationShapesSupported; }; -const OUStringLiteral gsStartShape(u"StartShape"); -const OUStringLiteral gsEndShape(u"EndShape"); -const OUStringLiteral gsStartGluePointIndex(u"StartGluePointIndex"); -const OUStringLiteral gsEndGluePointIndex(u"EndGluePointIndex"); +constexpr OUStringLiteral gsStartShape(u"StartShape"); +constexpr OUStringLiteral gsEndShape(u"EndShape"); +constexpr OUStringLiteral gsStartGluePointIndex(u"StartGluePointIndex"); +constexpr OUStringLiteral gsEndGluePointIndex(u"EndGluePointIndex"); XMLShapeImportHelper::XMLShapeImportHelper( SvXMLImport& rImporter, diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 79bc77a71e89..bb2e371f6c79 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -442,7 +442,7 @@ namespace xmloff { // no optimization here. If this method gets called, the XML stream did not contain a name for the // element, which is a heavy error. So in this case we don't care for performance - static const OUStringLiteral sUnnamedName = u"unnamed"; + static constexpr OUStringLiteral sUnnamedName = u"unnamed"; OSL_ENSURE(m_xParentContainer.is(), "OElementImport::implGetDefaultName: no parent container!"); if (!m_xParentContainer.is()) return sUnnamedName; diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx index 2aa1100e5b21..7776ea876427 100644 --- a/xmloff/source/meta/xmlversion.cxx +++ b/xmloff/source/meta/xmlversion.cxx @@ -40,7 +40,7 @@ using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; -const OUStringLiteral XMLN_VERSIONSLIST = u"VersionList.xml"; +constexpr OUStringLiteral XMLN_VERSIONSLIST = u"VersionList.xml"; XMLVersionListExport::XMLVersionListExport( const css::uno::Reference< css::uno::XComponentContext >& rContext, diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index fdad9672c099..de19b3d56e15 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1227,10 +1227,10 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef, const OUString& rTargetFrameName, bool bMap ) { - static const OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; - static const OUStringLiteral s_HyperLinkName = u"HyperLinkName"; - static const OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; - static const OUStringLiteral s_ServerMap = u"ServerMap"; + static constexpr OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; + static constexpr OUStringLiteral s_HyperLinkName = u"HyperLinkName"; + static constexpr OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; + static constexpr OUStringLiteral s_ServerMap = u"ServerMap"; if( !xPropSet.is() ) return; diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx index b7a55c2ac80b..58f0aa5e8909 100644 --- a/xmloff/source/text/XMLTextListBlockContext.cxx +++ b/xmloff/source/text/XMLTextListBlockContext.cxx @@ -55,7 +55,7 @@ XMLTextListBlockContext::XMLTextListBlockContext( , msListId() , msContinueListId() { - static const OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; + static constexpr OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; { // get the parent list block context (if any); this is a bit ugly... XMLTextListBlockContext * pLB(nullptr); diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index e48159449f02..65fcd19d9625 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -241,7 +241,7 @@ static auto PopFieldmark(XMLTextImportHelper & rHelper) -> void void XMLTextMarkImportContext::endFastElement(sal_Int32 nElement) { - static const OUStringLiteral sAPI_bookmark = u"com.sun.star.text.Bookmark"; + static constexpr OUStringLiteral sAPI_bookmark = u"com.sun.star.text.Bookmark"; lcl_MarkType nTmp{}; if (!SvXMLUnitConverter::convertEnum(nTmp, SvXMLImport::getNameFromToken(nElement), lcl_aMarkTypeMap)) diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index e813d4a725f7..fc1e00d18347 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -90,35 +90,35 @@ constexpr OUStringLiteral sAPI_textfield_prefix = u"com.sun.star.text.TextField. constexpr char16_t sAPI_fieldmaster_prefix[] = u"com.sun.star.text.FieldMaster."; const char sAPI_presentation_prefix[] = "com.sun.star.presentation.TextField."; -const OUStringLiteral sAPI_date_time = u"DateTime"; -const OUStringLiteral sAPI_page_number = u"PageNumber"; -const OUStringLiteral sAPI_docinfo_change_date_time = u"DocInfo.ChangeDateTime"; -const OUStringLiteral sAPI_docinfo_create_date_time = u"DocInfo.CreateDateTime"; -const OUStringLiteral sAPI_docinfo_custom = u"DocInfo.Custom"; -const OUStringLiteral sAPI_docinfo_print_date_time = u"DocInfo.PrintDateTime"; -const OUStringLiteral sAPI_dde = u"DDE"; -const OUStringLiteral sAPI_url = u"URL"; +constexpr OUStringLiteral sAPI_date_time = u"DateTime"; +constexpr OUStringLiteral sAPI_page_number = u"PageNumber"; +constexpr OUStringLiteral sAPI_docinfo_change_date_time = u"DocInfo.ChangeDateTime"; +constexpr OUStringLiteral sAPI_docinfo_create_date_time = u"DocInfo.CreateDateTime"; +constexpr OUStringLiteral sAPI_docinfo_custom = u"DocInfo.Custom"; +constexpr OUStringLiteral sAPI_docinfo_print_date_time = u"DocInfo.PrintDateTime"; +constexpr OUStringLiteral sAPI_dde = u"DDE"; +constexpr OUStringLiteral sAPI_url = u"URL"; // property names -const OUStringLiteral sAPI_is_fixed = u"IsFixed"; -const OUStringLiteral sAPI_content = u"Content"; -const OUStringLiteral sAPI_author = u"Author"; -const OUStringLiteral sAPI_hint = u"Hint"; -const OUStringLiteral sAPI_name = u"Name"; -const OUStringLiteral sAPI_sub_type = u"SubType"; -const OUStringLiteral sAPI_date_time_value = u"DateTimeValue"; -const OUStringLiteral sAPI_number_format = u"NumberFormat"; -const OUStringLiteral sAPI_numbering_type = u"NumberingType"; -const OUStringLiteral sAPI_offset = u"Offset"; -const OUStringLiteral sAPI_condition = u"Condition"; -const OUStringLiteral sAPI_set_number = u"SetNumber"; -const OUStringLiteral sAPI_file_format = u"FileFormat"; -const OUStringLiteral sAPI_is_date = u"IsDate"; -const OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; -const OUStringLiteral sAPI_is_hidden = u"IsHidden"; -const OUStringLiteral sAPI_is_fixed_language = u"IsFixedLanguage"; - -const OUStringLiteral sAPI_true = u"TRUE"; +constexpr OUStringLiteral sAPI_is_fixed = u"IsFixed"; +constexpr OUStringLiteral sAPI_content = u"Content"; +constexpr OUStringLiteral sAPI_author = u"Author"; +constexpr OUStringLiteral sAPI_hint = u"Hint"; +constexpr OUStringLiteral sAPI_name = u"Name"; +constexpr OUStringLiteral sAPI_sub_type = u"SubType"; +constexpr OUStringLiteral sAPI_date_time_value = u"DateTimeValue"; +constexpr OUStringLiteral sAPI_number_format = u"NumberFormat"; +constexpr OUStringLiteral sAPI_numbering_type = u"NumberingType"; +constexpr OUStringLiteral sAPI_offset = u"Offset"; +constexpr OUStringLiteral sAPI_condition = u"Condition"; +constexpr OUStringLiteral sAPI_set_number = u"SetNumber"; +constexpr OUStringLiteral sAPI_file_format = u"FileFormat"; +constexpr OUStringLiteral sAPI_is_date = u"IsDate"; +constexpr OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; +constexpr OUStringLiteral sAPI_is_hidden = u"IsHidden"; +constexpr OUStringLiteral sAPI_is_fixed_language = u"IsFixedLanguage"; + +constexpr OUStringLiteral sAPI_true = u"TRUE"; XMLTextFieldImportContext::XMLTextFieldImportContext( diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index e32c02d8ca1b..9642eb83d6da 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -405,7 +405,7 @@ XMLTextImportHelper::XMLTextImportHelper( bProgress, bBlockMode, bOrganizerMode) ) , m_xBackpatcherImpl( MakeBackpatcherImpl() ) { - static const OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; + static constexpr OUStringLiteral s_PropNameDefaultListId = u"DefaultListId"; Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); @@ -1013,14 +1013,14 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( bool bSetListAttrs, bool bOutlineContentVisible) { - static const OUStringLiteral s_NumberingRules = u"NumberingRules"; - static const OUStringLiteral s_NumberingIsNumber = u"NumberingIsNumber"; - static const OUStringLiteral s_NumberingLevel = u"NumberingLevel"; - static const OUStringLiteral s_ParaIsNumberingRestart = u"ParaIsNumberingRestart"; - static const OUStringLiteral s_NumberingStartValue = u"NumberingStartValue"; - static const OUStringLiteral s_PropNameListId = u"ListId"; - static const OUStringLiteral s_PageDescName = u"PageDescName"; - static const OUStringLiteral s_OutlineLevel = u"OutlineLevel"; + static constexpr OUStringLiteral s_NumberingRules = u"NumberingRules"; + static constexpr OUStringLiteral s_NumberingIsNumber = u"NumberingIsNumber"; + static constexpr OUStringLiteral s_NumberingLevel = u"NumberingLevel"; + static constexpr OUStringLiteral s_ParaIsNumberingRestart = u"ParaIsNumberingRestart"; + static constexpr OUStringLiteral s_NumberingStartValue = u"NumberingStartValue"; + static constexpr OUStringLiteral s_PropNameListId = u"ListId"; + static constexpr OUStringLiteral s_PageDescName = u"PageDescName"; + static constexpr OUStringLiteral s_OutlineLevel = u"OutlineLevel"; const XmlStyleFamily nFamily = bPara ? XmlStyleFamily::TEXT_PARAGRAPH : XmlStyleFamily::TEXT_TEXT; @@ -1619,12 +1619,12 @@ void XMLTextImportHelper::SetHyperlink( const OUString& rVisitedStyleName, XMLEventsImportContext* pEvents) { - static const OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; - static const OUStringLiteral s_HyperLinkName = u"HyperLinkName"; - static const OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; - static const OUStringLiteral s_UnvisitedCharStyleName = u"UnvisitedCharStyleName"; - static const OUStringLiteral s_VisitedCharStyleName = u"VisitedCharStyleName"; - static const OUStringLiteral s_HyperLinkEvents = u"HyperLinkEvents"; + static constexpr OUStringLiteral s_HyperLinkURL = u"HyperLinkURL"; + static constexpr OUStringLiteral s_HyperLinkName = u"HyperLinkName"; + static constexpr OUStringLiteral s_HyperLinkTarget = u"HyperLinkTarget"; + static constexpr OUStringLiteral s_UnvisitedCharStyleName = u"UnvisitedCharStyleName"; + static constexpr OUStringLiteral s_VisitedCharStyleName = u"VisitedCharStyleName"; + static constexpr OUStringLiteral s_HyperLinkEvents = u"HyperLinkEvents"; Reference < XPropertySet > xPropSet( rCursor, UNO_QUERY ); Reference < XPropertySetInfo > xPropSetInfo( @@ -2212,7 +2212,7 @@ void XMLTextImportHelper::ConnectFrameChains( bool XMLTextImportHelper::IsInFrame() const { - static const OUStringLiteral s_TextFrame = u"TextFrame"; + static constexpr OUStringLiteral s_TextFrame = u"TextFrame"; bool bIsInFrame = false; diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx index f6fdcaee02c4..e43039e8202a 100644 --- a/xmloff/source/text/txtvfldi.cxx +++ b/xmloff/source/text/txtvfldi.cxx @@ -54,17 +54,17 @@ // service names constexpr char16_t sAPI_fieldmaster_prefix[] = u"com.sun.star.text.FieldMaster."; -const OUStringLiteral sAPI_get_expression = u"GetExpression"; -const OUStringLiteral sAPI_set_expression = u"SetExpression"; -const OUStringLiteral sAPI_user = u"User"; -const OUStringLiteral sAPI_database = u"com.sun.star.text.TextField.Database"; +constexpr OUStringLiteral sAPI_get_expression = u"GetExpression"; +constexpr OUStringLiteral sAPI_set_expression = u"SetExpression"; +constexpr OUStringLiteral sAPI_user = u"User"; +constexpr OUStringLiteral sAPI_database = u"com.sun.star.text.TextField.Database"; // property names -const OUStringLiteral sAPI_content = u"Content"; -const OUStringLiteral sAPI_sub_type = u"SubType"; -const OUStringLiteral sAPI_number_format = u"NumberFormat"; -const OUStringLiteral sAPI_is_visible = u"IsVisible"; -const OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; +constexpr OUStringLiteral sAPI_content = u"Content"; +constexpr OUStringLiteral sAPI_sub_type = u"SubType"; +constexpr OUStringLiteral sAPI_number_format = u"NumberFormat"; +constexpr OUStringLiteral sAPI_is_visible = u"IsVisible"; +constexpr OUStringLiteral sAPI_current_presentation = u"CurrentPresentation"; using namespace ::com::sun::star; |