From be48e04b5bd51015595c0f0792a646c51164fd34 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 17 Apr 2016 15:08:39 +0200 Subject: Elide const vars Change-Id: I1b2a7b071f9740e8c848f543e32fd47f054c8318 --- forms/source/xforms/xpathlib/xpathlib.cxx | 6 ++---- reportdesign/source/filter/xml/xmlfilter.cxx | 8 ++------ sw/source/core/swg/SwXMLSectionList.cxx | 11 ++++------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/forms/source/xforms/xpathlib/xpathlib.cxx b/forms/source/xforms/xpathlib/xpathlib.cxx index cc14fbf10765..b5e498266c41 100644 --- a/forms/source/xforms/xpathlib/xpathlib.cxx +++ b/forms/source/xforms/xpathlib/xpathlib.cxx @@ -213,8 +213,6 @@ void xforms_indexFunction(xmlXPathParserContextPtr /*ctxt*/, int /*nargs*/) } // String Functions -static const char* _version = "1.0"; -static const char* _conformance = "conformance"; void xforms_propertyFunction(xmlXPathParserContextPtr ctxt, int nargs) { if (nargs != 1) XP_ERROR(XPATH_INVALID_ARITY); @@ -222,9 +220,9 @@ void xforms_propertyFunction(xmlXPathParserContextPtr ctxt, int nargs) if (xmlXPathCheckError(ctxt)) XP_ERROR(XPATH_INVALID_TYPE); OUString aString(reinterpret_cast(pString), strlen(reinterpret_cast(pString)), RTL_TEXTENCODING_UTF8); if (aString.equalsIgnoreAsciiCase("version")) - xmlXPathReturnString(ctxt, reinterpret_cast(const_cast(_version))); + xmlXPathReturnString(ctxt, reinterpret_cast(const_cast("1.0"))); else if (aString.equalsIgnoreAsciiCase("conformance-level")) - xmlXPathReturnString(ctxt, reinterpret_cast(const_cast(_conformance))); + xmlXPathReturnString(ctxt, reinterpret_cast(const_cast("conformance"))); else xmlXPathReturnEmptyString(ctxt); } diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 553dcb778024..ba6df0b7ee0c 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -77,10 +77,6 @@ using namespace ::com::sun::star::xml::sax; using namespace xmloff; using namespace ::com::sun::star::util; - sal_Char const sXML_np__rpt[] = "_report"; - sal_Char const sXML_np___rpt[] = "__report"; - - class RptMLMasterStylesContext_Impl: public XMLTextMasterStylesContext { @@ -357,11 +353,11 @@ ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext, S { GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_100TH); GetMM100UnitConverter().SetXMLMeasureUnit(util::MeasureUnit::CM); - GetNamespaceMap().Add( sXML_np__rpt, + GetNamespaceMap().Add( "_report", GetXMLToken(XML_N_RPT), XML_NAMESPACE_REPORT ); - GetNamespaceMap().Add( sXML_np___rpt, + GetNamespaceMap().Add( "__report", GetXMLToken(XML_N_RPT_OASIS), XML_NAMESPACE_REPORT ); diff --git a/sw/source/core/swg/SwXMLSectionList.cxx b/sw/source/core/swg/SwXMLSectionList.cxx index 05494d6fa47c..8e051f39c38f 100644 --- a/sw/source/core/swg/SwXMLSectionList.cxx +++ b/sw/source/core/swg/SwXMLSectionList.cxx @@ -25,21 +25,18 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -// TODO: verify if these should match the same-name constants -// in xmloff/source/core/xmlimp.cxx ("_office" and "_office") -sal_Char const sXML_np__office[] = "_ooffice"; -sal_Char const sXML_np__text[] = "_otext"; - SwXMLSectionList::SwXMLSectionList( const uno::Reference< uno::XComponentContext >& rContext, std::vector &rNewSectionList) : SvXMLImport( rContext, "" ), rSectionList ( rNewSectionList ) { - GetNamespaceMap().Add( sXML_np__office, + // TODO: verify if these should match the same-name constants + // in xmloff/source/core/xmlimp.cxx ("_office" and "_office") + GetNamespaceMap().Add( "_ooffice", GetXMLToken(XML_N_OFFICE_OOO), XML_NAMESPACE_OFFICE ); - GetNamespaceMap().Add( sXML_np__text, + GetNamespaceMap().Add( "_otext", GetXMLToken(XML_N_TEXT_OOO), XML_NAMESPACE_TEXT ); } -- cgit