diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:10:40 +0100 |
commit | 55f07d4daa76503530d96b9c20b53c59bcd5bcf9 (patch) | |
tree | 7ad8a720341e38258dab12597d25616c3bff8807 /vcl/source/font | |
parent | e235da515af0e2a5d5a0cf80773943b65fdb8f7b (diff) |
More loplugin:cstylecast: vcl
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: I363c01a1ae9e863fca4fb4589829492d7280d711
Diffstat (limited to 'vcl/source/font')
-rw-r--r-- | vcl/source/font/PhysicalFontFace.cxx | 4 | ||||
-rw-r--r-- | vcl/source/font/font.cxx | 6 | ||||
-rw-r--r-- | vcl/source/font/fontcharmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/fontmetric.cxx | 2 | ||||
-rw-r--r-- | vcl/source/font/fontselect.cxx | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index 40acbb8fb99c..04ebff2a8ffb 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -116,11 +116,11 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt // if not bold or requiring emboldening prefer light fonts to bold fonts FontWeight ePatternWeight = rFSD.mbEmbolden ? WEIGHT_NORMAL : rFSD.GetWeight(); - int nReqWeight = (int)ePatternWeight; + int nReqWeight = static_cast<int>(ePatternWeight); if ( ePatternWeight > WEIGHT_MEDIUM ) nReqWeight += 100; - int nGivenWeight = (int)GetWeight(); + int nGivenWeight = static_cast<int>(GetWeight()); if( GetWeight() > WEIGHT_MEDIUM ) nGivenWeight += 100; diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index c6351c228097..5c59f344f87c 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -369,7 +369,7 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) rImplFont.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet()); ReadPair( rIStm, rImplFont.maAverageFontSize ); - rIStm.ReadUInt16( nTmp16 ); rImplFont.SetCharSet( (rtl_TextEncoding) nTmp16 ); + rIStm.ReadUInt16( nTmp16 ); rImplFont.SetCharSet( static_cast<rtl_TextEncoding>(nTmp16) ); rIStm.ReadUInt16( nTmp16 ); rImplFont.SetFamilyType( (FontFamily) nTmp16 ); rIStm.ReadUInt16( nTmp16 ); rImplFont.SetPitch( (FontPitch) nTmp16 ); rIStm.ReadUInt16( nTmp16 ); rImplFont.SetWeight( (FontWeight) nTmp16 ); @@ -419,7 +419,7 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) rOStm.WriteUInt16( rImplFont.meUnderline ); rOStm.WriteUInt16( rImplFont.meStrikeout ); rOStm.WriteUInt16( rImplFont.GetItalicNoAsk() ); - rOStm.WriteUInt16( (sal_uInt16)rImplFont.maLanguageTag.getLanguageType( false) ); + rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplFont.maLanguageTag.getLanguageType( false)) ); rOStm.WriteUInt16( rImplFont.GetWidthTypeNoAsk() ); rOStm.WriteInt16( rImplFont.mnOrientation ); @@ -431,7 +431,7 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) // new in version 2 rOStm.WriteUChar( (sal_uChar)rImplFont.meRelief ); - rOStm.WriteUInt16( (sal_uInt16)rImplFont.maCJKLanguageTag.getLanguageType( false) ); + rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplFont.maCJKLanguageTag.getLanguageType( false)) ); rOStm.WriteBool( rImplFont.mbVertical ); rOStm.WriteUInt16( (sal_uInt16)rImplFont.meEmphasisMark ); diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 8da0e78c05c0..faf3c906bca7 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -203,7 +203,7 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) pStartGlyphs[i] = (cMinChar + nGlyphDelta) & 0xFFFF; } else { // update the glyphid-array with the glyphs in this range - pStartGlyphs[i] = -(int)aGlyphIdArray.size(); + pStartGlyphs[i] = -static_cast<int>(aGlyphIdArray.size()); const unsigned char* pGlyphIdPtr = pOffsetBase + 2*i + nRangeOffset; const size_t nRemainingSize = pEndValidArea - pGlyphIdPtr; const size_t nMaxPossibleRecords = nRemainingSize/2; diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx index cd0b9f8557e9..1351b9167d4b 100644 --- a/vcl/source/font/fontmetric.cxx +++ b/vcl/source/font/fontmetric.cxx @@ -188,7 +188,7 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData ) : FontAttributes( rFontSelData ) , mnHeight ( rFontSelData.mnHeight ) , mnWidth ( rFontSelData.mnWidth ) - , mnOrientation( (short)(rFontSelData.mnOrientation) ) + , mnOrientation( static_cast<short>(rFontSelData.mnOrientation) ) , mnAscent( 0 ) , mnDescent( 0 ) , mnIntLeading( 0 ) diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx index cefdcb178b7a..927e1106c5b6 100644 --- a/vcl/source/font/fontselect.cxx +++ b/vcl/source/font/fontselect.cxx @@ -52,7 +52,7 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont rFont.GetFontAttributes( *this ); // normalize orientation between 0 and 3600 - if( 3600 <= (unsigned)mnOrientation ) + if( 3600 <= static_cast<unsigned>(mnOrientation) ) { if( mnOrientation >= 0 ) mnOrientation %= 3600; @@ -118,7 +118,7 @@ size_t FontSelectPatternAttributes::hashCode() const nHash += 19 * GetWeight(); nHash += 29 * GetItalic(); nHash += 37 * mnOrientation; - nHash += 41 * (sal_uInt16)meLanguage; + nHash += 41 * static_cast<sal_uInt16>(meLanguage); if( mbVertical ) nHash += 53; return nHash; |