summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:24:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:24:56 +0100
commit2e1559cd85d2f1b4e308d63d34bf3632ba4b6d4b (patch)
tree298e5b99f9f2dc45b90dd8b6b9472dea5f7ca40d /embeddedobj
parent126f10840b0e5930be57cb55262789e85bff9b21 (diff)
More loplugin:cstylecast: embeddedobj
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: I16cbffa66d6b9bcc4ca68f0dd8f6bf3f4966a77f
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/source/msole/olepersist.cxx10
-rw-r--r--embeddedobj/source/msole/olevisual.cxx2
-rw-r--r--embeddedobj/source/msole/ownview.cxx16
3 files changed, 14 insertions, 14 deletions
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 44a9667c4240..b60c0299a561 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -309,7 +309,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
nRead = xInStream->readBytes( aHeadData, 4 );
sal_uInt32 nLen = 0;
if ( nRead == 4 && aHeadData.getLength() == 4 )
- nLen = ( ( ( (sal_uInt32)aHeadData[3] * 0x100 + (sal_uInt32)aHeadData[2] ) * 0x100 ) + (sal_uInt32)aHeadData[1] ) * 0x100 + (sal_uInt32)aHeadData[0];
+ nLen = ( ( ( static_cast<sal_uInt32>(aHeadData[3]) * 0x100 + static_cast<sal_uInt32>(aHeadData[2]) ) * 0x100 ) + static_cast<sal_uInt32>(aHeadData[1]) ) * 0x100 + static_cast<sal_uInt32>(aHeadData[0]);
if ( nLen > 4 )
{
xInStream->skipBytes( nLen - 4 );
@@ -322,7 +322,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
// check whether the first bytes represent the size
sal_uInt32 nSize = 0;
for ( sal_Int32 nInd = 3; nInd >= 0; nInd-- )
- nSize = ( nSize << 8 ) + (sal_uInt8)aData[nInd];
+ nSize = ( nSize << 8 ) + static_cast<sal_uInt8>(aData[nInd]);
if ( nSize == xSeek->getLength() - 4 )
nHeaderOffset = 4;
@@ -441,7 +441,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
// write width
for ( nIndex = 0; nIndex < 4; nIndex++ )
{
- aData[nIndex] = (sal_Int8)( aSize.Width % 0x100 );
+ aData[nIndex] = static_cast<sal_Int8>( aSize.Width % 0x100 );
aSize.Width /= 0x100;
}
xTempOutStream->writeBytes( aData );
@@ -449,7 +449,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
// write height
for ( nIndex = 0; nIndex < 4; nIndex++ )
{
- aData[nIndex] = (sal_Int8)( aSize.Height % 0x100 );
+ aData[nIndex] = static_cast<sal_Int8>( aSize.Height % 0x100 );
aSize.Height /= 0x100;
}
xTempOutStream->writeBytes( aData );
@@ -472,7 +472,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea
}
for ( sal_Int32 nInd = 0; nInd < 4; nInd++ )
{
- aData[nInd] = (sal_Int8)( ( (sal_uInt64) nLength ) % 0x100 );
+ aData[nInd] = static_cast<sal_Int8>( static_cast<sal_uInt64>(nLength) % 0x100 );
nLength /= 0x100;
}
xTempSeek->seek( 36 );
diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx
index 820e39c2f7f0..8e1d7bc8d6e7 100644
--- a/embeddedobj/source/msole/olevisual.cxx
+++ b/embeddedobj/source/msole/olevisual.cxx
@@ -69,7 +69,7 @@ embed::VisualRepresentation OleEmbeddedObject::GetVisualRepresentationInNativeFo
cppu::UnoType<uno::Sequence< sal_Int8 >>::get() );
}
- sal_Int32 nStreamLength = (sal_Int32)xSeekable->getLength();
+ sal_Int32 nStreamLength = static_cast<sal_Int32>(xSeekable->getLength());
uno::Sequence< sal_Int8 > aRepresent( nStreamLength );
xInStream->readBytes( aRepresent, nStreamLength );
aVisualRepr.Data <<= aRepresent;
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index a22411f6342c..cff8b66ea56b 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -309,10 +309,10 @@ bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io::XI
if ( xInStream->readBytes( aReadSeq, 4 ) != 4 )
return false;
- sal_uInt32 nUrlSize = (sal_uInt8)aReadSeq[0]
- + (sal_uInt8)aReadSeq[1] * 0x100
- + (sal_uInt8)aReadSeq[2] * 0x10000
- + (sal_uInt8)aReadSeq[3] * 0x1000000;
+ sal_uInt32 nUrlSize = static_cast<sal_uInt8>(aReadSeq[0])
+ + static_cast<sal_uInt8>(aReadSeq[1]) * 0x100
+ + static_cast<sal_uInt8>(aReadSeq[2]) * 0x10000
+ + static_cast<sal_uInt8>(aReadSeq[3]) * 0x1000000;
sal_Int64 nTargetPos = xSeekable->getPosition() + nUrlSize;
xSeekable->seek( nTargetPos );
@@ -321,10 +321,10 @@ bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io::XI
if ( xInStream->readBytes( aReadSeq, 4 ) != 4 )
return false;
- sal_uInt32 nDataSize = (sal_uInt8)aReadSeq[0]
- + (sal_uInt8)aReadSeq[1] * 0x100
- + (sal_uInt8)aReadSeq[2] * 0x10000
- + (sal_uInt8)aReadSeq[3] * 0x1000000;
+ sal_uInt32 nDataSize = static_cast<sal_uInt8>(aReadSeq[0])
+ + static_cast<sal_uInt8>(aReadSeq[1]) * 0x100
+ + static_cast<sal_uInt8>(aReadSeq[2]) * 0x10000
+ + static_cast<sal_uInt8>(aReadSeq[3]) * 0x1000000;
aReadSeq.realloc( 32000 );
sal_uInt32 nRead = 0;