From 535aa95014b4f30ba5f06a563c35db6c98cca9d9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 25 Feb 2016 13:59:56 +0200 Subject: loplugin:unuseddefaultparams in xmloff/ Change-Id: Ia504a4e96a4ebc8404fe6881e0f77fba29cd00ae --- xmloff/inc/txtflde.hxx | 3 +-- xmloff/source/core/xmlexp.cxx | 35 ++++++++------------------------- xmloff/source/draw/shapeexport.cxx | 10 +++++----- xmloff/source/draw/shapeimport.cxx | 4 ++-- xmloff/source/forms/propertyexport.cxx | 8 +++----- xmloff/source/forms/propertyexport.hxx | 5 +---- xmloff/source/script/XMLEventExport.cxx | 5 ++--- xmloff/source/style/XMLPageExport.cxx | 4 ++-- xmloff/source/style/xmlaustp.cxx | 5 ++--- xmloff/source/style/xmlexppr.cxx | 4 ++-- xmloff/source/style/xmlprmap.cxx | 4 +--- xmloff/source/text/txtflde.cxx | 5 ++--- xmloff/source/text/txtimp.cxx | 4 ++-- xmloff/source/text/txtparae.cxx | 13 ++---------- 14 files changed, 35 insertions(+), 74 deletions(-) (limited to 'xmloff') diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 53ddb9ee015e..00f723e97393 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -268,8 +268,7 @@ protected: 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 - sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + bool bOmitEmpty = false); /// omit attribute, if value is empty /// export a string attribute, omit if default diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 8ebfcf13e607..e81167ce9568 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -900,22 +900,22 @@ uno::Sequence< OUString > SAL_CALL SvXMLExport::getSupportedServiceNames( ) } OUString -SvXMLExport::EnsureNamespace(OUString const & i_rNamespace, - OUString const & i_rPreferredPrefix) +SvXMLExport::EnsureNamespace(OUString const & i_rNamespace) { + OUString const aPreferredPrefix("gen"); OUString sPrefix; sal_uInt16 nKey( _GetNamespaceMap().GetKeyByName( i_rNamespace ) ); if( XML_NAMESPACE_UNKNOWN == nKey ) { // There is no prefix for the namespace, so // we have to generate one and have to add it. - sPrefix = i_rPreferredPrefix; + sPrefix = aPreferredPrefix; nKey = _GetNamespaceMap().GetKeyByPrefix( sPrefix ); sal_Int32 n( 0 ); OUStringBuffer buf; while( nKey != USHRT_MAX ) { - buf.append( i_rPreferredPrefix ); + buf.append( aPreferredPrefix ); buf.append( ++n ); sPrefix = buf.makeStringAndClear(); nKey = _GetNamespaceMap().GetKeyByPrefix( sPrefix ); @@ -1007,8 +1007,7 @@ void SvXMLExport::AddAttribute( const OUString& rQName, } void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, - const css::lang::Locale& rLocale, bool bWriteEmpty, - enum ::xmloff::token::XMLTokenEnum eClass ) + const css::lang::Locale& rLocale, bool bWriteEmpty ) { if (rLocale.Variant.isEmpty()) { @@ -1017,26 +1016,8 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref // to convert to LanguageTag first. Also catches the case of empty // locale denoting system locale. xmloff::token::XMLTokenEnum eLanguage, eCountry; - switch (eClass) - { - default: - case XML_LANGUAGE: - eLanguage = XML_LANGUAGE; - eCountry = XML_COUNTRY; - break; - case XML_LANGUAGE_ASIAN: - eLanguage = XML_LANGUAGE_ASIAN; - eCountry = XML_COUNTRY_ASIAN; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - case XML_LANGUAGE_COMPLEX: - eLanguage = XML_LANGUAGE_COMPLEX; - eCountry = XML_COUNTRY_COMPLEX; - if (nPrefix == XML_NAMESPACE_FO) - nPrefix = XML_NAMESPACE_STYLE; - break; - } + eLanguage = XML_LANGUAGE; + eCountry = XML_COUNTRY; if (bWriteEmpty || !rLocale.Language.isEmpty()) AddAttribute( nPrefix, eLanguage, rLocale.Language); if (bWriteEmpty || !rLocale.Country.isEmpty()) @@ -1045,7 +1026,7 @@ void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPref else { LanguageTag aLanguageTag( rLocale); - AddLanguageTagAttributes( nPrefix, nPrefixRfc, aLanguageTag, bWriteEmpty, eClass); + AddLanguageTagAttributes( nPrefix, nPrefixRfc, aLanguageTag, bWriteEmpty); } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index aea70327844b..81b884efec3b 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -189,14 +189,14 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, mrExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_SD_GRAPHICS_ID, - OUString(XML_STYLE_FAMILY_SD_GRAPHICS_NAME), + XML_STYLE_FAMILY_SD_GRAPHICS_NAME, GetPropertySetMapper(), - OUString(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)); + XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX); mrExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_SD_PRESENTATION_ID, - OUString(XML_STYLE_FAMILY_SD_PRESENTATION_NAME), + XML_STYLE_FAMILY_SD_PRESENTATION_NAME, GetPropertySetMapper(), - OUString(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)); + XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX); maCurrentInfo = maShapeInfos.end(); @@ -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 */, awt::Point* /*pRefPoint = NULL */) + XmlShapeType eShapeType, XMLShapeExportFlags /* nFeatures = SEF_DEFAULT */) { const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 80d269e09383..f75da95b5393 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -1096,9 +1096,9 @@ void XMLShapeImportHelper::endPage( css::uno::Reference< css::drawing::XShapes > } /** defines if the import should increment the progress bar or not */ -void XMLShapeImportHelper::enableHandleProgressBar( bool bEnable ) +void XMLShapeImportHelper::enableHandleProgressBar() { - mpImpl->mbHandleProgressBar = bEnable; + mpImpl->mbHandleProgressBar = true; } bool XMLShapeImportHelper::IsHandleProgressBarEnabled() const diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index 1f145898f2e2..f230863a88ea 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -472,10 +472,10 @@ namespace xmloff } void OPropertyExport::exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const sal_Char* _pAttributeName, - const OUString& _rPropertyName, - const sal_Unicode _aQuoteCharacter) + const OUString& _rPropertyName) { const sal_Unicode _aListSeparator = ','; + const sal_Unicode _aQuoteCharacter = '"'; DBG_CHECK_PROPERTY( _rPropertyName, Sequence< OUString > ); Sequence< OUString > aItems; @@ -497,10 +497,8 @@ namespace xmloff ++pItems ) { - OSL_ENSURE(!_aQuoteCharacter || (-1 == pItems->indexOf(_aQuoteCharacter)), + OSL_ENSURE(-1 == pItems->indexOf(_aQuoteCharacter), "OPropertyExport::exportStringSequenceAttribute: there is an item which contains the quote character!"); - OSL_ENSURE(_aQuoteCharacter || (-1 == pItems->indexOf(_aListSeparator)), - "OPropertyExport::exportStringSequenceAttribute: no quote character, but there is an item containing the separator character!"); if (bQuote) sFinalList += sQuote; diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx index 6ebdb3211f5e..7db076e5e299 100644 --- a/xmloff/source/forms/propertyexport.hxx +++ b/xmloff/source/forms/propertyexport.hxx @@ -296,14 +296,11 @@ namespace xmloff the name of the attribute to add. Must not contain any namespace (it's added automatically) @param _pPropertyName the name of the property to ask the object for - @param _aQuoteCharacter - the character to use to quote the sequence elements with. May be 0, in this case no quoting happens */ void exportStringSequenceAttribute( const sal_uInt16 _nAttributeNamespaceKey, const sal_Char* _pAttributeName, - const OUString& _rPropertyName, - const sal_Unicode _aQuoteCharacter = '"'); + const OUString& _rPropertyName); /** determines whether the given property is to be exported diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index f2b91227768c..5d7cdee48304 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -159,13 +159,12 @@ void XMLEventExport::Export( Reference & rAccess, } } -void XMLEventExport::ExportExt( Reference & rAccess, - bool bWhitespace ) +void XMLEventExport::ExportExt( Reference & rAccess ) { // set bExtNamespace flag to use XML_NAMESPACE_OFFICE_EXT namespace // for events element (not for child elements) bExtNamespace = true; - Export(rAccess, bWhitespace); + Export(rAccess); bExtNamespace = false; // reset for future Export calls } diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 7713b664cefa..5463fc18d17f 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -162,8 +162,8 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) : xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper( xPageMasterPropSetMapper, rExp); - rExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_PAGE_MASTER, OUString( XML_STYLE_FAMILY_PAGE_MASTER_NAME ), - xPageMasterExportPropMapper, OUString( XML_STYLE_FAMILY_PAGE_MASTER_PREFIX ), false ); + rExport.GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_PAGE_MASTER, XML_STYLE_FAMILY_PAGE_MASTER_NAME, + xPageMasterExportPropMapper, XML_STYLE_FAMILY_PAGE_MASTER_PREFIX, false ); Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(), UNO_QUERY ); diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index 4e7d1adeda26..fecc47acdce1 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -280,11 +280,10 @@ void SvXMLAutoStylePoolP::AddFamily( sal_Int32 nFamily, const OUString& rStrName, SvXMLExportPropertyMapper* pMapper, - const OUString& aStrPrefix, - bool bAsFamily ) + const OUString& aStrPrefix ) { rtl::Reference xTmp = pMapper; - AddFamily( nFamily, rStrName, xTmp, aStrPrefix, bAsFamily ); + AddFamily( nFamily, rStrName, xTmp, aStrPrefix ); } void SvXMLAutoStylePoolP::AddFamily( diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index a204b3e17d1b..870e19cbdcfc 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -576,9 +576,9 @@ std::vector SvXMLExportPropertyMapper::Filter( } std::vector SvXMLExportPropertyMapper::FilterDefaults( - const uno::Reference& rPropSet, bool bEnableFoFontFamily ) const + const uno::Reference& rPropSet ) const { - return _Filter(rPropSet, true, bEnableFoFontFamily); + return _Filter(rPropSet, true, false/*bEnableFoFontFamily*/); } vector SvXMLExportPropertyMapper::_Filter( diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index 7c3cdaf3c4a3..94208eb47dce 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -184,12 +184,10 @@ sal_uInt32 XMLPropertySetMapper::GetEntryFlags( sal_Int32 nIndex ) const return mpImpl->maMapEntries[nIndex].nType & ~MID_FLAG_MASK; } -sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex, bool bWithFlags ) const +sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex ) const { assert((0 <= nIndex) && (nIndex < static_cast(mpImpl->maMapEntries.size()))); sal_uInt32 nType = mpImpl->maMapEntries[nIndex].nType; - if( !bWithFlags ) - nType = nType & MID_FLAG_MASK; return nType; } diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index a7a78eb8f58c..d0bb1d2d9809 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2484,12 +2484,11 @@ void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName, sal_uInt16 nValuePrefix, const OUString& sValue, - bool bOmitEmpty, - sal_uInt16 nPrefix) + bool bOmitEmpty) { OUString sQValue = GetExport().GetNamespaceMap().GetQNameByKey( nValuePrefix, sValue, false ); - ProcessString( eName, sQValue, bOmitEmpty, nPrefix ); + ProcessString( eName, sQValue, bOmitEmpty ); } /// export a string attribute diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 542147dcae11..4b8ff8272bdc 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2434,9 +2434,9 @@ XMLPropStyleContext* XMLTextImportHelper::FindPageMaster( } -void XMLTextImportHelper::PushListContext(XMLTextListBlockContext *i_pListBlock) +void XMLTextImportHelper::PushListContext() { - GetTextListHelper().PushListContext(i_pListBlock); + GetTextListHelper().PushListContext(static_cast(nullptr)); } void XMLTextImportHelper::PopListContext() diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 89ca1966b59e..7758c14d5ee9 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -586,8 +586,7 @@ static bool lcl_validPropState( const XMLPropertyState& rState ) void XMLTextParagraphExport::Add( sal_uInt16 nFamily, MultiPropertySetHelper& rPropSetHelper, - const Reference < XPropertySet > & rPropSet, - const XMLPropertyState** ppAddStates) + const Reference < XPropertySet > & rPropSet) { rtl::Reference < SvXMLExportPropertyMapper > xPropMapper; switch( nFamily ) @@ -599,14 +598,6 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily, DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" ); vector< XMLPropertyState > xPropStates(xPropMapper->Filter( rPropSet )); - if( ppAddStates ) - { - while( *ppAddStates ) - { - xPropStates.push_back( **ppAddStates ); - ++ppAddStates; - } - } if( rPropSetHelper.hasProperty( NUMBERING_RULES_AUTO ) ) { @@ -3394,7 +3385,7 @@ void XMLTextParagraphExport::exportTextRange( } void XMLTextParagraphExport::exportText( const OUString& rText, - bool& rPrevCharIsSpace, TextPNS /*eExtensionNS*/ ) + bool& rPrevCharIsSpace ) { sal_Int32 nExpStartPos = 0; sal_Int32 nEndPos = rText.getLength(); -- cgit