diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-28 18:01:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-29 12:14:22 +0200 |
commit | e593b623dad9456d3452c4c537479596bcd0b00b (patch) | |
tree | d9d21031cdd75df25749de8c6ae5b9c0afb1c196 /hwpfilter | |
parent | a612d738a8c909e18ed89675432ca42b376ef624 (diff) |
loplugin:stringloop in various
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3
Reviewed-on: https://gerrit.libreoffice.org/58250
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index e8a5582f5ec9..b3e8ba9f7d8b 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -34,6 +34,7 @@ #include <iostream> #include <locale.h> #include <sal/types.h> +#include <rtl/ustrbuf.hxx> // To be shorten source code by realking #define hconv(x) hstr2ucsstr(x).c_str() @@ -4350,7 +4351,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) sprintf(buf, "0 0 %d %d", WTSM(drawobj->extent.w) , WTSM(drawobj->extent.h) ); padd("svg:viewBox", sXML_CDATA, ascii(buf) ); - OUString oustr; + OUStringBuffer oustr; if ((drawobj->u.freeform.npt > 2) && (static_cast<size_t>(drawobj->u.freeform.npt) < @@ -4400,7 +4401,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) sprintf(buf, "M%d %dC%d %d", WTSM(xarr[0]), WTSM(yarr[0]), WTSM(xarr[0] + xb[0]/3), WTSM(yarr[0] + yb[0]/3) ); - oustr += ascii(buf); + oustr.append(ascii(buf)); for( i = 1 ; i < n ; i++ ){ if( i == n -1 ){ @@ -4415,7 +4416,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) WTSM(xarr[i] + xb[i]/3), WTSM(yarr[i] + yb[i]/3) ); } - oustr += ascii(buf); + oustr.append(ascii(buf)); } delete[] tarr; delete[] xarr; @@ -4428,7 +4429,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) delete[] darr; } - padd("svg:d", sXML_CDATA, oustr); + padd("svg:d", sXML_CDATA, oustr.makeStringAndClear()); rstartEl("draw:path", mxList.get()); mxList->clear(); @@ -4463,19 +4464,19 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) sprintf(buf, "0 0 %d %d", WTSM(drawobj->extent.w), WTSM(drawobj->extent.h)); padd("svg:viewBox", sXML_CDATA, ascii(buf) ); - OUString oustr; + OUStringBuffer oustr; if (drawobj->u.freeform.npt > 0) { sprintf(buf, "%d,%d", WTSM(drawobj->u.freeform.pt[0].x), WTSM(drawobj->u.freeform.pt[0].y)); - oustr += ascii(buf); + oustr.append(ascii(buf)); int i; for (i = 1; i < drawobj->u.freeform.npt ; i++) { sprintf(buf, " %d,%d", WTSM(drawobj->u.freeform.pt[i].x), WTSM(drawobj->u.freeform.pt[i].y)); - oustr += ascii(buf); + oustr.append(ascii(buf)); } if( drawobj->u.freeform.pt[0].x == drawobj->u.freeform.pt[i-1].x && drawobj->u.freeform.pt[0].y == drawobj->u.freeform.pt[i-1].y ) @@ -4483,7 +4484,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) bIsPolygon = true; } } - padd("draw:points", sXML_CDATA, oustr); + padd("draw:points", sXML_CDATA, oustr.makeStringAndClear()); if( drawobj->property.fill_color <= 0xffffff || drawobj->property.pattern_type != 0) |