diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-13 09:24:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-13 09:24:50 +0000 |
commit | 44e0bbee08bc4df85236935fb7769d5434e5f5ee (patch) | |
tree | 9eb8493275c94dccc74e2847b3df4906c4805b59 | |
parent | 07679362a1efae9cd81e6c0ace8c198efa3b2b77 (diff) |
improve scoping
Change-Id: Ibb1625ff974cc1a35e5547b6ce88bf13d186d4bb
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 48dde583f22c..83bd93a3d290 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -2301,14 +2301,13 @@ void OS2METReader::ReadImageData(sal_uInt16 nDataID, sal_uInt16 nDataLen) std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[nDataLen]); pOS2MET->ReadBytes(pBuf.get(), nDataLen); if (p->nBitsPerPixel==24) { - sal_uLong i, j, nAlign, nBytesPerLine; sal_uInt8 nTemp; - nBytesPerLine=(p->nWidth*3+3)&0xfffffffc; - nAlign=p->nMapPos-(p->nMapPos % nBytesPerLine); - i=0; + sal_uLong nBytesPerLine = (p->nWidth * 3 + 3) & 0xfffffffc; + sal_uLong nAlign = p->nMapPos - (p->nMapPos % nBytesPerLine); + sal_uLong i=0; while (nAlign+i+2<p->nMapPos+nDataLen) { if (nAlign+i>=p->nMapPos) { - j=nAlign+i-p->nMapPos; + sal_uLong j = nAlign + i - p->nMapPos; nTemp=pBuf[j]; pBuf[j]=pBuf[j+2]; pBuf[j+2]=nTemp; } i+=3; if (i+2>=nBytesPerLine) { |