diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-02 09:36:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-02 10:46:46 +0200 |
commit | 268a49f473c1830be269a7db5f561e3681134bbd (patch) | |
tree | 259debcc224b3f211125ca6615b4fc25b2dcdeb2 /emfio/source | |
parent | a282c9700806bc17710e8b2186b306d2a90928ee (diff) |
loplugin:reducevarscope in desktop..emfio
Change-Id: I25ca760ae15114ada621d928997a7117401c75d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103811
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'emfio/source')
-rw-r--r-- | emfio/source/reader/emfreader.cxx | 10 | ||||
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx index 2c932a440eeb..b47d0c86496f 100644 --- a/emfio/source/reader/emfreader.cxx +++ b/emfio/source/reader/emfreader.cxx @@ -1202,15 +1202,13 @@ namespace emfio case EMR_EXTCREATEPEN : { - sal_Int32 elpHatch; - sal_uInt32 offBmi, cbBmi, offBits, cbBits, nStyle, nWidth, nBrushStyle, elpNumEntries; - Color aColorRef; - mpInputStream->ReadUInt32( nIndex ); if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { + sal_uInt32 offBmi, cbBmi, offBits, cbBits, nStyle, nWidth, nBrushStyle, elpNumEntries; + sal_Int32 elpHatch; mpInputStream->ReadUInt32( offBmi ).ReadUInt32( cbBmi ).ReadUInt32( offBits ).ReadUInt32( cbBits ). ReadUInt32( nStyle ).ReadUInt32( nWidth ).ReadUInt32( nBrushStyle ); - aColorRef = ReadColor(); + Color aColorRef = ReadColor(); mpInputStream->ReadInt32( elpHatch ).ReadUInt32( elpNumEntries ); LineInfo aLineInfo; @@ -1292,10 +1290,10 @@ namespace emfio case EMR_CREATEBRUSHINDIRECT : { - sal_uInt32 nStyle; mpInputStream->ReadUInt32( nIndex ); if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 ) { + sal_uInt32 nStyle; mpInputStream->ReadUInt32( nStyle ); CreateObjectIndexed(nIndex, std::make_unique<WinMtfFillStyle>( ReadColor(), ( nStyle == BS_HOLLOW ) )); } diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index c18189cc9734..27c42bdc0171 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -1108,7 +1108,6 @@ namespace emfio if ( Application::GetDefaultDevice()->IsFontAvailable( GetFont().GetFamilyName() ) ) { Point aPt; - OUString aString; sal_uInt32 nStringLen, nDXCount; std::unique_ptr<long[]> pDXAry; SvMemoryStream aMemoryStream( nEscLen ); @@ -1123,8 +1122,7 @@ namespace emfio if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) ) { - - aString = read_uInt16s_ToOUString(aMemoryStream, nStringLen); + OUString aString = read_uInt16s_ToOUString(aMemoryStream, nStringLen); aMemoryStream.ReadUInt32( nDXCount ); if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) ) nDXCount = 0; @@ -1309,9 +1307,9 @@ namespace emfio // The image size is not known so normalize the calculated bounds so that the // resulting image is not too big - const double fMaxWidth = static_cast<double>(aMaxWidth); if (aPlaceableBound.GetWidth() > aMaxWidth) { + const double fMaxWidth = static_cast<double>(aMaxWidth); double fRatio = aPlaceableBound.GetWidth() / fMaxWidth; aPlaceableBound = tools::Rectangle( |