diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:17:24 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:17:24 +0100 |
commit | acd1696a066b8fa6fb94a0613939565799413769 (patch) | |
tree | 31dac1c3922fe467e1771f514c3cca3d2e552ae3 /sax/source | |
parent | 681783c9adf85bde36348f11c03d3a483bf545be (diff) |
More loplugin:cstylecast: sax
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: Ide5941d633fb3bf930b790d644154829b77ad117
Diffstat (limited to 'sax/source')
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 8 | ||||
-rw-r--r-- | sax/source/tools/converter.cxx | 14 | ||||
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index f84a7301dcfe..a9d8f280706c 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -141,7 +141,7 @@ public: bool bNormalizeWhitespace); sal_uInt32 GetLastColumnCount() const throw() - { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); } + { return static_cast<sal_uInt32>(nCurrentPos - nLastLineFeedPos); } /// @throws SAXException inline void startDocument(); @@ -380,7 +380,7 @@ inline bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, break; default: { - pTarget[rPos] = (sal_Int8)c; + pTarget[rPos] = static_cast<sal_Int8>(c); rPos ++; } break; @@ -388,8 +388,8 @@ inline bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr, } else { - pTarget[rPos] = (sal_Int8)c; - if ((sal_Int8)c == LINEFEED) + pTarget[rPos] = static_cast<sal_Int8>(c); + if (static_cast<sal_Int8>(c) == LINEFEED) nLastLineFeedPos = rPos; rPos ++; } diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index b824015d1126..d5618128a231 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -96,7 +96,7 @@ bool Converter::convertMeasure( sal_Int32& rValue, { // TODO: check overflow! nDiv *= 10; - nVal += ( ((double)(rString[nPos] - '0')) / nDiv ); + nVal += ( static_cast<double>(rString[nPos] - '0') / nDiv ); nPos++; } } @@ -255,12 +255,12 @@ bool Converter::convertMeasure( sal_Int32& rValue, if( bNeg ) nVal = -nVal; - if( nVal <= (double)nMin ) + if( nVal <= static_cast<double>(nMin) ) rValue = nMin; - else if( nVal >= (double)nMax ) + else if( nVal >= static_cast<double>(nMax) ) rValue = nMax; else - rValue = (sal_Int32)nVal; + rValue = static_cast<sal_Int32>(nVal); return true; } @@ -511,15 +511,15 @@ void Converter::convertColor( OUStringBuffer& rBuffer, sal_Int32 nColor ) { rBuffer.append( '#' ); - sal_uInt8 nCol = (sal_uInt8)(nColor >> 16); + sal_uInt8 nCol = static_cast<sal_uInt8>(nColor >> 16); rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); - nCol = (sal_uInt8)(nColor >> 8); + nCol = static_cast<sal_uInt8>(nColor >> 8); rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); - nCol = (sal_uInt8)nColor; + nCol = static_cast<sal_uInt8>(nColor); rBuffer.append( sal_Unicode( aHexTab[ nCol >> 4 ] ) ); rBuffer.append( sal_Unicode( aHexTab[ nCol & 0xf ] ) ); } diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 06fe66270b12..fa91125b2245 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -249,7 +249,7 @@ sal_Int32 FastTokenHandlerBase::getTokenFromChars( nLen = strlen( pToken ); if( pTokenHandler ) - nRet = pTokenHandler->getTokenDirect( pToken, (sal_Int32) nLen ); + nRet = pTokenHandler->getTokenDirect( pToken, static_cast<sal_Int32>(nLen) ); else { // heap allocate, copy & then free |