From c90da566ed1026a70217ac8a52a90e5df5c3026e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Jul 2018 15:34:35 +0200 Subject: loplugin:returnconstant in xmloff Change-Id: Ia837a93ae817df282096abb80efcbd6922867b25 Reviewed-on: https://gerrit.libreoffice.org/58335 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/xmloff/styleexp.hxx | 2 +- xmloff/source/style/styleexp.cxx | 3 +-- xmloff/source/transform/ChartOOoTContext.cxx | 6 +++--- xmloff/source/transform/EventOOoTContext.cxx | 6 +++--- xmloff/source/transform/TransformerBase.cxx | 11 +++++------ xmloff/source/transform/TransformerBase.hxx | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/xmloff/styleexp.hxx b/include/xmloff/styleexp.hxx index fb48166e14df..0418aaebc8e5 100644 --- a/include/xmloff/styleexp.hxx +++ b/include/xmloff/styleexp.hxx @@ -93,7 +93,7 @@ public: // bool bUsed, sal_uInt16 nFamily = 0, // const OUString* pPrefix = 0); - bool exportDefaultStyle( + void exportDefaultStyle( const css::uno::Reference< css::beans::XPropertySet > & xPropSet, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper ); diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index fa8ff9c8a46a..40334fc30be1 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -381,7 +381,7 @@ bool XMLStyleExport::exportStyle( return true; } -bool XMLStyleExport::exportDefaultStyle( +void XMLStyleExport::exportDefaultStyle( const Reference< XPropertySet >& xPropSet, const OUString& rXMLFamily, const rtl::Reference < SvXMLExportPropertyMapper >& rPropMapper ) @@ -404,7 +404,6 @@ bool XMLStyleExport::exportDefaultStyle( rPropMapper->exportXML( GetExport(), aPropStates, SvXmlExportFlags::IGN_WS ); } - return true; } void XMLStyleExport::exportStyleFamily( diff --git a/xmloff/source/transform/ChartOOoTContext.cxx b/xmloff/source/transform/ChartOOoTContext.cxx index 86d3e4841c7f..b6de37a48d46 100644 --- a/xmloff/source/transform/ChartOOoTContext.cxx +++ b/xmloff/source/transform/ChartOOoTContext.cxx @@ -101,9 +101,9 @@ void XMLChartOOoTransformerContext::StartElement( OUString aAttrValue( rAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); - if( GetTransformer().AddNamespacePrefix( aAttrValue, - nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + GetTransformer().AddNamespacePrefix( aAttrValue, + nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue ); } break; case XML_ATACTION_REMOVE: diff --git a/xmloff/source/transform/EventOOoTContext.cxx b/xmloff/source/transform/EventOOoTContext.cxx index 7b0af9b7fd8b..bc9b70b3019f 100644 --- a/xmloff/source/transform/EventOOoTContext.cxx +++ b/xmloff/source/transform/EventOOoTContext.cxx @@ -170,9 +170,9 @@ void XMLEventOOoTransformerContext::StartElement( OUString aAttrValue( rAttrValue ); sal_uInt16 nValPrefix = static_cast((*aIter).second.m_nParam1); - if( GetTransformer().AddNamespacePrefix( aAttrValue, - nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + GetTransformer().AddNamespacePrefix( aAttrValue, + nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue ); } break; case XML_ATACTION_MACRO_LOCATION: diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index fd0f3ea903e6..148230a179b1 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -633,8 +633,8 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( static_cast( bRename ? (*aIter).second.m_nParam2 : (*aIter).second.m_nParam1); - if( AddNamespacePrefix( aAttrValue, nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + AddNamespacePrefix( aAttrValue, nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue ); } break; case XML_ATACTION_ADD_APP_NAMESPACE_PREFIX: @@ -646,8 +646,8 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList( nValPrefix = XML_NAMESPACE_OOOC; else if( IsXMLToken( GetClass(), XML_TEXT ) ) nValPrefix = XML_NAMESPACE_OOOW; - if( AddNamespacePrefix( aAttrValue, nValPrefix ) ) - pMutableAttrList->SetValueByIndex( i, aAttrValue ); + AddNamespacePrefix( aAttrValue, nValPrefix ); + pMutableAttrList->SetValueByIndex( i, aAttrValue ); } break; case XML_ATACTION_RENAME_REMOVE_NAMESPACE_PREFIX: @@ -1200,11 +1200,10 @@ bool XMLTransformerBase::NegPercent( OUString& rValue ) return bRet; } -bool XMLTransformerBase::AddNamespacePrefix( OUString& rName, +void XMLTransformerBase::AddNamespacePrefix( OUString& rName, sal_uInt16 nPrefix ) const { rName = GetNamespaceMap().GetQNameByKey( nPrefix, rName, false ); - return true; } bool XMLTransformerBase::RemoveNamespacePrefix( OUString& rName, diff --git a/xmloff/source/transform/TransformerBase.hxx b/xmloff/source/transform/TransformerBase.hxx index 429d27a06fd4..7aded1f949d1 100644 --- a/xmloff/source/transform/TransformerBase.hxx +++ b/xmloff/source/transform/TransformerBase.hxx @@ -138,7 +138,7 @@ public: static bool DecodeStyleName( OUString& rName ); static bool NegPercent( OUString& rValue ); - bool AddNamespacePrefix( OUString& rName, + void AddNamespacePrefix( OUString& rName, sal_uInt16 nPrefix ) const; bool RemoveNamespacePrefix( OUString& rName, sal_uInt16 nPrefixOnly=0xffffU ) const; -- cgit