diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-07 15:27:20 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-07 15:43:47 +0200 |
commit | bd60974b0a420e02fe21dbee2e50623191d0cbb1 (patch) | |
tree | 7b8f5f2c0d3afb08a056aefbd9a52ca5f9763853 | |
parent | 4c8fa775c54eb3b70972e7055dd0a2d6b760bbe1 (diff) |
clang-analyzer-deadcode.DeadStores
Change-Id: Ia381f1b7558e2882a9dc5b8f6e127d24a4b841c3
-rw-r--r-- | xmloff/source/style/numehelp.cxx | 68 |
1 files changed, 18 insertions, 50 deletions
diff --git a/xmloff/source/style/numehelp.cxx b/xmloff/source/style/numehelp.cxx index def5eec8db00..ca01ffeba1a8 100644 --- a/xmloff/source/style/numehelp.cxx +++ b/xmloff/source/style/numehelp.cxx @@ -134,7 +134,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_CURRENCY); if (!rCurrency.isEmpty()) rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CURRENCY, rCurrency); - bWasSetTypeAttribute = true; } if (bExportValue) @@ -149,11 +148,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp case util::NumberFormat::DATE: case util::NumberFormat::DATETIME: { - if (!bWasSetTypeAttribute) - { - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_DATE); - bWasSetTypeAttribute = true; - } + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_DATE); if (bExportValue) { if ( rXMLExport.SetNullDateOnUnitConverter() ) @@ -167,11 +162,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp break; case util::NumberFormat::TIME: { - if (!bWasSetTypeAttribute) - { - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TIME); - bWasSetTypeAttribute = true; - } + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TIME); if (bExportValue) { OUStringBuffer sBuffer; @@ -182,11 +173,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp break; case util::NumberFormat::LOGICAL: { - if (!bWasSetTypeAttribute) - { - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_BOOLEAN); - bWasSetTypeAttribute = true; - } + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_BOOLEAN); if (bExportValue) { double fTempValue = rValue; @@ -215,16 +202,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp break; case util::NumberFormat::TEXT: { - if (!bWasSetTypeAttribute) + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); + if (bExportValue) { - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT); - if (bExportValue) - { - OUString sValue( ::rtl::math::doubleToUString( rValue, - rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true)); - rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sValue); - } + OUString sValue( ::rtl::math::doubleToUString( rValue, + rtl_math_StringFormat_Automatic, + rtl_math_DecimalPlaces_Max, '.', true)); + rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sValue); } } break; @@ -417,7 +401,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( pExport->AddAttribute(sAttrValType, XML_CURRENCY); if (!rCurrency.isEmpty()) pExport->AddAttribute(sAttrCurrency, rCurrency); - bWasSetTypeAttribute = true; } if (bExportValue) @@ -432,11 +415,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( case util::NumberFormat::DATE: case util::NumberFormat::DATETIME: { - if (!bWasSetTypeAttribute) - { - pExport->AddAttribute(sAttrValType, XML_DATE); - bWasSetTypeAttribute = true; - } + pExport->AddAttribute(sAttrValType, XML_DATE); if (bExportValue) { if ( pExport->SetNullDateOnUnitConverter() ) @@ -450,11 +429,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( break; case util::NumberFormat::TIME: { - if (!bWasSetTypeAttribute) - { - pExport->AddAttribute(sAttrValType, XML_TIME); - bWasSetTypeAttribute = true; - } + pExport->AddAttribute(sAttrValType, XML_TIME); if (bExportValue) { OUStringBuffer sBuffer; @@ -465,11 +440,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( break; case util::NumberFormat::LOGICAL: { - if (!bWasSetTypeAttribute) - { - pExport->AddAttribute(sAttrValType, XML_BOOLEAN); - bWasSetTypeAttribute = true; - } + pExport->AddAttribute(sAttrValType, XML_BOOLEAN); if (bExportValue) { double fTempValue = rValue; @@ -498,16 +469,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( break; case util::NumberFormat::TEXT: { - if (!bWasSetTypeAttribute) + pExport->AddAttribute(sAttrValType, XML_FLOAT); + if (bExportValue) { - pExport->AddAttribute(sAttrValType, XML_FLOAT); - if (bExportValue) - { - OUString sValue( ::rtl::math::doubleToUString( rValue, - rtl_math_StringFormat_Automatic, - rtl_math_DecimalPlaces_Max, '.', true)); - pExport->AddAttribute(sAttrValue, sValue); - } + OUString sValue( ::rtl::math::doubleToUString( rValue, + rtl_math_StringFormat_Automatic, + rtl_math_DecimalPlaces_Max, '.', true)); + pExport->AddAttribute(sAttrValue, sValue); } } break; |