summaryrefslogtreecommitdiff
path: root/xmloff/source/forms
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:09:29 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:09:29 +0100
commitdec5264878903ee010e9a6296357750f6c69c844 (patch)
treee987833003c31730486c95e82b6cc97b960de1a2 /xmloff/source/forms
parentab279d30de4188baa4b33688aaed96072f3b4818 (diff)
More loplugin:cstylecast: xmloff
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ic872cef7bb9982305528ec3ce12a1871f055b752
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r--xmloff/source/forms/controlpropertyhdl.cxx6
-rw-r--r--xmloff/source/forms/elementexport.cxx2
-rw-r--r--xmloff/source/forms/elementimport.cxx10
-rw-r--r--xmloff/source/forms/formenums.cxx6
-rw-r--r--xmloff/source/forms/layerexport.cxx4
-rw-r--r--xmloff/source/forms/propertyexport.cxx2
-rw-r--r--xmloff/source/forms/propertyimport.cxx14
7 files changed, 22 insertions, 22 deletions
diff --git a/xmloff/source/forms/controlpropertyhdl.cxx b/xmloff/source/forms/controlpropertyhdl.cxx
index 1fe91cd88fd2..ba5a27f8661d 100644
--- a/xmloff/source/forms/controlpropertyhdl.cxx
+++ b/xmloff/source/forms/controlpropertyhdl.cxx
@@ -279,7 +279,7 @@ namespace xmloff
bool const bSuccess = ::sax::Converter::convertMeasure(
nWidth, _rStrImpValue, util::MeasureUnit::POINT);
if (bSuccess)
- _rValue <<= (sal_Int16)nWidth;
+ _rValue <<= static_cast<sal_Int16>(nWidth);
return bSuccess;
}
@@ -311,7 +311,7 @@ namespace xmloff
if (bSucces)
{
fValue *= 10;
- _rValue <<= (float)fValue;
+ _rValue <<= static_cast<float>(fValue);
}
return bSucces;
@@ -325,7 +325,7 @@ namespace xmloff
if (bSuccess)
{
OUStringBuffer sValue;
- ::sax::Converter::convertDouble(sValue, ((double)fAngle) / 10);
+ ::sax::Converter::convertDouble(sValue, static_cast<double>(fAngle) / 10);
_rStrExpValue = sValue.makeStringAndClear();
}
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index ba1eb56f5d79..ccc088d3f3a8 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1300,7 +1300,7 @@ namespace xmloff
sal_Int32 nItems = aItems.getLength();
sal_Int32 nValues = aValues.getLength();
- sal_Int16 nMaxLen = (sal_Int16)std::max(nItems, nValues);
+ sal_Int16 nMaxLen = static_cast<sal_Int16>(std::max(nItems, nValues));
for (sal_Int16 i=0; i<nMaxLen; ++i )
{
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 74775302105e..193e771bdc4b 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -1208,9 +1208,9 @@ namespace xmloff
OSL_ENSURE(_rValue.getLength() == 1, "OPasswordImport::handleAttribute: invalid echo char attribute!");
// we ourself should not have written values other than of length 1
if (_rValue.getLength() >= 1)
- aEchoChar.Value <<= (sal_Int16)_rValue[0];
+ aEchoChar.Value <<= static_cast<sal_Int16>(_rValue[0]);
else
- aEchoChar.Value <<= (sal_Int16)0;
+ aEchoChar.Value <<= sal_Int16(0);
implPushBackPropertyValue(aEchoChar);
return true;
}
@@ -1243,7 +1243,7 @@ namespace xmloff
// create and store a new PropertyValue
PropertyValue aNewValue;
aNewValue.Name = pProperty->sPropertyName;
- aNewValue.Value <<= (sal_Int16)::cppu::any2bool(aBooleanValue);
+ aNewValue.Value <<= static_cast<sal_Int16>(::cppu::any2bool(aBooleanValue));
implPushBackPropertyValue(aNewValue);
}
@@ -1714,7 +1714,7 @@ namespace xmloff
OSL_ENSURE((m_aListSource.size() + m_nEmptyListItems) == (m_aValueList.size() + m_nEmptyValueItems),
"OListAndComboImport::implSelectCurrentItem: inconsistence between labels and values!");
- sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.size() - 1 + m_nEmptyListItems);
+ sal_Int16 nItemNumber = static_cast<sal_Int16>(m_aListSource.size() - 1 + m_nEmptyListItems);
m_aSelectedSeq.push_back(nItemNumber);
}
@@ -1723,7 +1723,7 @@ namespace xmloff
OSL_ENSURE((m_aListSource.size() + m_nEmptyListItems) == (m_aValueList.size() + m_nEmptyValueItems),
"OListAndComboImport::implDefaultSelectCurrentItem: inconsistence between labels and values!");
- sal_Int16 nItemNumber = (sal_Int16)(m_aListSource.size() - 1 + m_nEmptyListItems);
+ sal_Int16 nItemNumber = static_cast<sal_Int16>(m_aListSource.size() - 1 + m_nEmptyListItems);
m_aDefaultSelectedSeq.push_back(nItemNumber);
}
diff --git a/xmloff/source/forms/formenums.cxx b/xmloff/source/forms/formenums.cxx
index 86e23a4220ab..f8a1feb08201 100644
--- a/xmloff/source/forms/formenums.cxx
+++ b/xmloff/source/forms/formenums.cxx
@@ -106,9 +106,9 @@ const SvXMLEnumMapEntry<TriState> aCheckStateMap[] =
};
const SvXMLEnumMapEntry<sal_Int16> aTextAlignMap[] =
{
- { XML_START, (sal_uInt16)awt::TextAlign::LEFT },
- { XML_CENTER, (sal_uInt16)awt::TextAlign::CENTER },
- { XML_END, (sal_uInt16)awt::TextAlign::RIGHT },
+ { XML_START, sal_uInt16(awt::TextAlign::LEFT) },
+ { XML_CENTER, sal_uInt16(awt::TextAlign::CENTER) },
+ { XML_END, sal_uInt16(awt::TextAlign::RIGHT) },
{ XML_JUSTIFY, -1 },
{ XML_JUSTIFIED, -1 },
{ XML_TOKEN_INVALID, 0 }
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index 455940c553aa..78c54829edd6 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -470,8 +470,8 @@ namespace xmloff
{
OUString sControlId = "control";
- size_t nKnownControlCount = ::std::accumulate( _rAllPagesControlIds.begin(), _rAllPagesControlIds.end(), (size_t)0, AccumulateSize() );
- sControlId += OUString::number( (sal_Int32)nKnownControlCount + 1 );
+ size_t nKnownControlCount = ::std::accumulate( _rAllPagesControlIds.begin(), _rAllPagesControlIds.end(), size_t(0), AccumulateSize() );
+ sControlId += OUString::number( static_cast<sal_Int32>(nKnownControlCount) + 1 );
#ifdef DBG_UTIL
// Check if the id is already used. It shouldn't, as we currently have no mechanism for removing entries
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 5bc13cded759..2f611bc61f8b 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -360,7 +360,7 @@ namespace xmloff
// let the formatter of the export context build a string
OUStringBuffer sBuffer;
- SvXMLUnitConverter::convertEnum(sBuffer, (sal_uInt16)nCurrentValue, _pValueMap);
+ SvXMLUnitConverter::convertEnum(sBuffer, static_cast<sal_uInt16>(nCurrentValue), _pValueMap);
AddAttribute(_nNamespaceKey, _pAttributeName, sBuffer.makeStringAndClear());
}
diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx
index 9bced59ecdd0..0851edf31519 100644
--- a/xmloff/source/forms/propertyimport.cxx
+++ b/xmloff/source/forms/propertyimport.cxx
@@ -76,7 +76,7 @@ namespace
css::util::Date lcl_getDate( double _nValue )
{
- Date aToolsDate((sal_uInt32)_nValue);
+ Date aToolsDate(static_cast<sal_uInt32>(_nValue));
css::util::Date aDate;
::utl::typeConvert(aToolsDate, aDate);
return aDate;
@@ -114,7 +114,7 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType,
append(OUStringToOString(_rReadCharacters, RTL_TEXTENCODING_ASCII_US)).
append("\" into an integer!").getStr());
if (TypeClass_SHORT == _rExpectedType.getTypeClass())
- aReturn <<= (sal_Int16)nValue;
+ aReturn <<= static_cast<sal_Int16>(nValue);
else
aReturn <<= nValue;
break;
@@ -129,11 +129,11 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType,
if (bEnumAsInt)
if (TypeClass_SHORT == _rExpectedType.getTypeClass())
- aReturn <<= (sal_Int16)nEnumValue;
+ aReturn <<= static_cast<sal_Int16>(nEnumValue);
else
- aReturn <<= (sal_Int32)nEnumValue;
+ aReturn <<= static_cast<sal_Int32>(nEnumValue);
else
- aReturn = ::cppu::int2enum((sal_Int32)nEnumValue, _rExpectedType);
+ aReturn = ::cppu::int2enum(static_cast<sal_Int32>(nEnumValue), _rExpectedType);
}
break;
case TypeClass_HYPER:
@@ -182,14 +182,14 @@ Any PropertyConversion::convertString( const css::uno::Type& _rExpectedType,
{
case TYPE_DATE:
{
- OSL_ENSURE(((sal_uInt32)nValue) - nValue == 0,
+ OSL_ENSURE((static_cast<sal_uInt32>(nValue)) - nValue == 0,
"PropertyConversion::convertString: a Date value with a fractional part?");
aReturn <<= lcl_getDate(nValue);
}
break;
case TYPE_TIME:
{
- OSL_ENSURE(((sal_uInt32)nValue) == 0,
+ OSL_ENSURE((static_cast<sal_uInt32>(nValue)) == 0,
"PropertyConversion::convertString: a tools::Time value with more than a fractional part?");
aReturn <<= lcl_getTime(nValue);
}