Kaydet (Commit) bd60974b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

clang-analyzer-deadcode.DeadStores

Change-Id: Ia381f1b7558e2882a9dc5b8f6e127d24a4b841c3
üst 4c8fa775
...@@ -134,7 +134,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp ...@@ -134,7 +134,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_CURRENCY); rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_CURRENCY);
if (!rCurrency.isEmpty()) if (!rCurrency.isEmpty())
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CURRENCY, rCurrency); rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_CURRENCY, rCurrency);
bWasSetTypeAttribute = true;
} }
if (bExportValue) if (bExportValue)
...@@ -149,11 +148,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp ...@@ -149,11 +148,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
case util::NumberFormat::DATE: case util::NumberFormat::DATE:
case util::NumberFormat::DATETIME: case util::NumberFormat::DATETIME:
{ {
if (!bWasSetTypeAttribute) rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_DATE);
{
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_DATE);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
if ( rXMLExport.SetNullDateOnUnitConverter() ) if ( rXMLExport.SetNullDateOnUnitConverter() )
...@@ -167,11 +162,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp ...@@ -167,11 +162,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
break; break;
case util::NumberFormat::TIME: case util::NumberFormat::TIME:
{ {
if (!bWasSetTypeAttribute) rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TIME);
{
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_TIME);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
OUStringBuffer sBuffer; OUStringBuffer sBuffer;
...@@ -182,11 +173,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp ...@@ -182,11 +173,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
break; break;
case util::NumberFormat::LOGICAL: case util::NumberFormat::LOGICAL:
{ {
if (!bWasSetTypeAttribute) rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_BOOLEAN);
{
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_BOOLEAN);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
double fTempValue = rValue; double fTempValue = rValue;
...@@ -215,16 +202,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp ...@@ -215,16 +202,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(SvXMLExport& rXMLExp
break; break;
case util::NumberFormat::TEXT: 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); OUString sValue( ::rtl::math::doubleToUString( rValue,
if (bExportValue) rtl_math_StringFormat_Automatic,
{ rtl_math_DecimalPlaces_Max, '.', true));
OUString sValue( ::rtl::math::doubleToUString( rValue, rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sValue);
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true));
rXMLExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_VALUE, sValue);
}
} }
} }
break; break;
...@@ -417,7 +401,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( ...@@ -417,7 +401,6 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
pExport->AddAttribute(sAttrValType, XML_CURRENCY); pExport->AddAttribute(sAttrValType, XML_CURRENCY);
if (!rCurrency.isEmpty()) if (!rCurrency.isEmpty())
pExport->AddAttribute(sAttrCurrency, rCurrency); pExport->AddAttribute(sAttrCurrency, rCurrency);
bWasSetTypeAttribute = true;
} }
if (bExportValue) if (bExportValue)
...@@ -432,11 +415,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( ...@@ -432,11 +415,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
case util::NumberFormat::DATE: case util::NumberFormat::DATE:
case util::NumberFormat::DATETIME: case util::NumberFormat::DATETIME:
{ {
if (!bWasSetTypeAttribute) pExport->AddAttribute(sAttrValType, XML_DATE);
{
pExport->AddAttribute(sAttrValType, XML_DATE);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
if ( pExport->SetNullDateOnUnitConverter() ) if ( pExport->SetNullDateOnUnitConverter() )
...@@ -450,11 +429,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( ...@@ -450,11 +429,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
break; break;
case util::NumberFormat::TIME: case util::NumberFormat::TIME:
{ {
if (!bWasSetTypeAttribute) pExport->AddAttribute(sAttrValType, XML_TIME);
{
pExport->AddAttribute(sAttrValType, XML_TIME);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
OUStringBuffer sBuffer; OUStringBuffer sBuffer;
...@@ -465,11 +440,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( ...@@ -465,11 +440,7 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
break; break;
case util::NumberFormat::LOGICAL: case util::NumberFormat::LOGICAL:
{ {
if (!bWasSetTypeAttribute) pExport->AddAttribute(sAttrValType, XML_BOOLEAN);
{
pExport->AddAttribute(sAttrValType, XML_BOOLEAN);
bWasSetTypeAttribute = true;
}
if (bExportValue) if (bExportValue)
{ {
double fTempValue = rValue; double fTempValue = rValue;
...@@ -498,16 +469,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes( ...@@ -498,16 +469,13 @@ void XMLNumberFormatAttributesExportHelper::WriteAttributes(
break; break;
case util::NumberFormat::TEXT: case util::NumberFormat::TEXT:
{ {
if (!bWasSetTypeAttribute) pExport->AddAttribute(sAttrValType, XML_FLOAT);
if (bExportValue)
{ {
pExport->AddAttribute(sAttrValType, XML_FLOAT); OUString sValue( ::rtl::math::doubleToUString( rValue,
if (bExportValue) rtl_math_StringFormat_Automatic,
{ rtl_math_DecimalPlaces_Max, '.', true));
OUString sValue( ::rtl::math::doubleToUString( rValue, pExport->AddAttribute(sAttrValue, sValue);
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true));
pExport->AddAttribute(sAttrValue, sValue);
}
} }
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment