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

More loplugin:cstylecast: xmlscript

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: If9a6160a75ae56f563a098a5569af64eb8fab7d7
üst e5262ed7
......@@ -56,7 +56,7 @@ public:
sal_Int32 BSeqInputStream::readBytes(
Sequence< sal_Int8 > & rData, sal_Int32 nBytesToRead )
{
nBytesToRead = ((nBytesToRead > (sal_Int32)_seq.size() - _nPos)
nBytesToRead = ((nBytesToRead > static_cast<sal_Int32>(_seq.size()) - _nPos)
? _seq.size() - _nPos
: nBytesToRead);
......
......@@ -39,7 +39,7 @@ void XMLElement::addSubElement( Reference< xml::sax::XAttributeList > const & xE
Reference< xml::sax::XAttributeList > const & XMLElement::getSubElement( sal_Int32 nIndex )
{
return _subElems[ (size_t)nIndex ];
return _subElems[ static_cast<size_t>(nIndex) ];
}
void XMLElement::dumpSubElements( Reference< xml::sax::XDocumentHandler > const & xOut )
......@@ -69,13 +69,13 @@ sal_Int16 XMLElement::getLength()
OUString XMLElement::getNameByIndex( sal_Int16 nPos )
{
OSL_ASSERT( (size_t)nPos < _attrNames.size() );
OSL_ASSERT( static_cast<size_t>(nPos) < _attrNames.size() );
return _attrNames[ nPos ];
}
OUString XMLElement::getTypeByIndex( sal_Int16 nPos )
{
OSL_ASSERT( (size_t)nPos < _attrNames.size() );
OSL_ASSERT( static_cast<size_t>(nPos) < _attrNames.size() );
// xxx todo
return OUString();
}
......@@ -88,7 +88,7 @@ OUString XMLElement::getTypeByName( OUString const & /*rName*/ )
OUString XMLElement::getValueByIndex( sal_Int16 nPos )
{
OSL_ASSERT( (size_t)nPos < _attrNames.size() );
OSL_ASSERT( static_cast<size_t>(nPos) < _attrNames.size() );
return _attrValues[ nPos ];
}
......
......@@ -569,7 +569,7 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles )
sal_Int16 nEcho = 0;
if (readProp( "EchoChar" ) >>= nEcho)
{
sal_Unicode cEcho = (sal_Unicode)nEcho;
sal_Unicode cEcho = static_cast<sal_Unicode>(nEcho);
addAttribute( XMLNS_DIALOGS_PREFIX ":echochar", OUString( &cEcho, 1 ) );
}
readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
......
......@@ -1046,7 +1046,7 @@ void TextFieldElement::endElement()
sal_Int16 nChar = 0;
if(!aValue.isEmpty())
{
nChar = (sal_Int16)aValue[ 0 ];
nChar = static_cast<sal_Int16>(aValue[ 0 ]);
}
xControlModel->setPropertyValue( "EchoChar", makeAny( nChar ) );
}
......
......@@ -303,13 +303,13 @@ void StyleElement::importFontStyle(
// dialog:font-height %numeric; #IMPLIED
if (getStringAttr( &aValue, "font-height", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Height = (sal_Int16)toInt32( aValue );
_descr.Height = static_cast<sal_Int16>(toInt32( aValue ));
bFontImport = true;
}
// dialog:font-width %numeric; #IMPLIED
if (getStringAttr(&aValue, "font-width", _xAttributes, m_xImport->XMLNS_DIALOGS_UID ))
{
_descr.Width = (sal_Int16)toInt32( aValue );
_descr.Width = static_cast<sal_Int16>(toInt32( aValue ));
bFontImport = true;
}
// dialog:font-stylename CDATA #IMPLIED
......@@ -763,7 +763,7 @@ bool ImportContext::importShortProperty(
_pImport->XMLNS_DIALOGS_UID, rAttrName ) );
if (!aValue.isEmpty())
{
_xControlModel->setPropertyValue( rPropName, makeAny( (sal_Int16)toInt32( aValue ) ) );
_xControlModel->setPropertyValue( rPropName, makeAny( static_cast<sal_Int16>(toInt32( aValue )) ) );
return true;
}
return false;
......
......@@ -181,7 +181,7 @@ Reference< xml::input::XElement > LibrariesElement::startChildElement(
void LibrariesElement::endElement()
{
sal_Int32 nLibCount = mxImport->mpLibArray->mnLibCount = (sal_Int32)mLibDescriptors.size();
sal_Int32 nLibCount = mxImport->mpLibArray->mnLibCount = static_cast<sal_Int32>(mLibDescriptors.size());
mxImport->mpLibArray->mpLibs.reset( new LibDescriptor[ nLibCount ] );
for( sal_Int32 i = 0 ; i < nLibCount ; i++ )
......
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