From f90c2001eb8f6d41e90fa347bf5a707bbefb6f43 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 19 Oct 2018 16:55:19 +0100 Subject: pvs-studio: Expression '!bWasSetTypeAttribute' is always true. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I605bbc117426bba3dae9a8ec3ffc45967edbf7c4 Reviewed-on: https://gerrit.libreoffice.org/62060 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/style/numehelp.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index b678d559a277..db9e1d8dac6e 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -105,11 +105,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp case util::NumberFormat::SCIENTIFIC: case util::NumberFormat::FRACTION: { - if (!bWasSetTypeAttribute) - { - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); - bWasSetTypeAttribute = true; - } + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); + bWasSetTypeAttribute = true; SAL_FALLTHROUGH; } case util::NumberFormat::PERCENT: @@ -374,11 +371,8 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( case util::NumberFormat::SCIENTIFIC: case util::NumberFormat::FRACTION: { - if (!bWasSetTypeAttribute) - { - pExport->AddAttribute(sAttrValType, XML_FLOAT); - bWasSetTypeAttribute = true; - } + pExport->AddAttribute(sAttrValType, XML_FLOAT); + bWasSetTypeAttribute = true; SAL_FALLTHROUGH; } case util::NumberFormat::PERCENT: -- cgit