[Libreoffice-commits] core.git: 2 commits - filter/source
Caolán McNamara
caolanm at redhat.com
Mon Mar 13 09:27:27 UTC 2017
filter/source/graphicfilter/ios2met/ios2met.cxx | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit d4b89fdb51c0936c50457a2f1e8f6b38d5dd7eb2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 13 09:26:36 2017 +0000
this is a swap
Change-Id: Iaf6310055b60da772187fdbeaca74d6eb296cfca
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 83bd93a..0faf7c3 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -26,6 +26,7 @@
#include <vcl/lineinfo.hxx>
#include <math.h>
+#include <algorithm>
#include <memory>
class FilterConfigItem;
@@ -2301,16 +2302,16 @@ 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_uInt8 nTemp;
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) {
sal_uLong j = nAlign + i - p->nMapPos;
- nTemp=pBuf[j]; pBuf[j]=pBuf[j+2]; pBuf[j+2]=nTemp;
+ std::swap(pBuf[j], pBuf[j+2]);
}
- i+=3; if (i+2>=nBytesPerLine) {
+ i+=3;
+ if (i+2>=nBytesPerLine) {
nAlign+=nBytesPerLine;
i=0;
}
commit 44e0bbee08bc4df85236935fb7769d5434e5f5ee
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 13 09:24:50 2017 +0000
improve scoping
Change-Id: Ibb1625ff974cc1a35e5547b6ce88bf13d186d4bb
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 48dde58..83bd93a 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) {
More information about the Libreoffice-commits
mailing list