diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-03 14:52:45 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-04 06:13:25 +0000 |
commit | f5e131b2bcd2c88a47e5988d5f319bffd767c4dc (patch) | |
tree | dfa4853d09b4327c4c812dfbe3b44ec1c6447060 /xmloff | |
parent | fee4fe8e589e101140d9b318ac757825bf836506 (diff) |
loplugin:unuseddefaultparams in vcl and xmloff
and teach the plugin about code that takes the address of a function
Change-Id: Ia9d5afef44520aca236659e8176f1e27135ef4fc
Reviewed-on: https://gerrit.libreoffice.org/22861
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/txtflde.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 45 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 5 |
4 files changed, 13 insertions, 42 deletions
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 00f723e97393..20025a0113f9 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -267,8 +267,7 @@ protected: void ProcessString( enum ::xmloff::token::XMLTokenEnum eXmlName, /// attribute token (namespace text) sal_uInt16 nValuePrefix, - const OUString& sValue, /// attribute value - bool bOmitEmpty = false); /// omit attribute, if value is empty + const OUString& sValue); /// attribute value /// export a string attribute, omit if default diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index e81167ce9568..9e04ef03cc6a 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1031,50 +1031,23 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref } void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, - const LanguageTag& rLanguageTag, bool bWriteEmpty, xmloff::token::XMLTokenEnum eClass ) -{ - xmloff::token::XMLTokenEnum eLanguage, eScript, eCountry, eRfcLanguageTag; - switch (eClass) - { - default: - case XML_LANGUAGE: - eLanguage = XML_LANGUAGE; - eScript = XML_SCRIPT; - eCountry = XML_COUNTRY; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG; - break; - case XML_LANGUAGE_ASIAN: - eLanguage = XML_LANGUAGE_ASIAN; - eScript = XML_SCRIPT_ASIAN; - eCountry = XML_COUNTRY_ASIAN; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG_ASIAN; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - case XML_LANGUAGE_COMPLEX: - eLanguage = XML_LANGUAGE_COMPLEX; - eScript = XML_SCRIPT_COMPLEX; - eCountry = XML_COUNTRY_COMPLEX; - eRfcLanguageTag = XML_RFC_LANGUAGE_TAG_COMPLEX; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - } + const LanguageTag& rLanguageTag, bool bWriteEmpty ) +{ if (rLanguageTag.isIsoODF()) { if (bWriteEmpty || !rLanguageTag.isSystemLocale()) { - AddAttribute( nPrefix, eLanguage, rLanguageTag.getLanguage()); + AddAttribute( nPrefix, XML_LANGUAGE, rLanguageTag.getLanguage()); if (rLanguageTag.hasScript() && getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefix, eScript, rLanguageTag.getScript()); + AddAttribute( nPrefix, XML_SCRIPT, rLanguageTag.getScript()); if (bWriteEmpty || !rLanguageTag.getCountry().isEmpty()) - AddAttribute( nPrefix, eCountry, rLanguageTag.getCountry()); + AddAttribute( nPrefix, XML_COUNTRY, rLanguageTag.getCountry()); } } else { if (getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefixRfc, eRfcLanguageTag, rLanguageTag.getBcp47()); + AddAttribute( nPrefixRfc, XML_RFC_LANGUAGE_TAG, rLanguageTag.getBcp47()); // Also in case of non-pure-ISO tag store best matching fo: attributes // for consumers not handling *:rfc-language-tag, ensuring that only // valid ISO codes are stored. Here the bWriteEmpty parameter has no @@ -1083,11 +1056,11 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref rLanguageTag.getIsoLanguageScriptCountry( aLanguage, aScript, aCountry); if (!aLanguage.isEmpty()) { - AddAttribute( nPrefix, eLanguage, aLanguage); + AddAttribute( nPrefix, XML_LANGUAGE, aLanguage); if (!aScript.isEmpty() && getDefaultVersion() >= SvtSaveOptions::ODFVER_012) - AddAttribute( nPrefix, eScript, aScript); + AddAttribute( nPrefix, XML_SCRIPT, aScript); if (!aCountry.isEmpty()) - AddAttribute( nPrefix, eCountry, aCountry); + AddAttribute( nPrefix, XML_COUNTRY, aCountry); } } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 81b884efec3b..2c71dfa2e380 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3449,7 +3449,7 @@ void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShap void XMLShapeExport::ImpExport3DShape( const uno::Reference< drawing::XShape >& xShape, - XmlShapeType eShapeType, XMLShapeExportFlags /* nFeatures = SEF_DEFAULT */) + XmlShapeType eShapeType) { const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index d0bb1d2d9809..dd9625b1c882 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2483,12 +2483,11 @@ void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, sal_uInt16 nValuePrefix, - const OUString& sValue, - bool bOmitEmpty) + const OUString& sValue) { OUString sQValue = GetExport().GetNamespaceMap().GetQNameByKey( nValuePrefix, sValue, false ); - ProcessString( eName, sQValue, bOmitEmpty ); + ProcessString( eName, sQValue ); } /// export a string attribute |