From 9fd89a5952a48b473cee03a2681eb5d4cd6d1742 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hryniuk Date: Sun, 4 Jan 2015 22:50:05 +0100 Subject: fdo#39440 reduce scope of local variables Beside scope changes, it fixes lack of initialization in a few places. Change-Id: Ia09fdb9845d8ac17256330a5ec5168401c84f0f2 Reviewed-on: https://gerrit.libreoffice.org/13755 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- filter/source/graphicfilter/epict/epict.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'filter') diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 4d33b4e8663e..aa8d045fbf41 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -335,7 +335,6 @@ void PictWriter::WritePolygon(const Polygon & rPoly) { sal_uInt16 nDataSize,i,nSize; short nMinX = 0, nMinY = 0, nMaxX = 0, nMaxY = 0; - short nx,ny; Polygon aPoly(rPoly); nSize=aPoly.GetSize(); @@ -354,8 +353,8 @@ void PictWriter::WritePolygon(const Polygon & rPoly) aSrcMapMode, aTargetMapMode ); - nx = (short) aPoint.X(); - ny = (short) aPoint.Y(); + short nx = (short) aPoint.X(); + short ny = (short) aPoint.Y(); if ( i==0 || nMinX>nx ) nMinX=nx; @@ -1308,21 +1307,18 @@ void PictWriter::SetAttrForText() void PictWriter::WriteTextArray(Point & rPoint, const OUString& rString, const long* pDXAry) { - bool bDelta; - Point aPt; - if ( pDXAry == NULL ) WriteOpcode_Text( rPoint, rString, false ); else { - bDelta = false; + bool bDelta = false; sal_Int32 nLen = rString.getLength(); for ( sal_Int32 i = 0; i < nLen; i++ ) { sal_Unicode c = rString[ i ]; if ( c && ( c != 0x20 ) ) { - aPt = rPoint; + Point aPt = rPoint; if ( i > 0 ) aPt.X() += pDXAry[ i - 1 ]; -- cgit