diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-08 15:58:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-08 15:58:55 +0200 |
commit | 3e3a37ebdc14f709fc970b291a9869bac6f9ba35 (patch) | |
tree | 75000a6abab0b0dc8df7d9260adea5bf5d44b67e /vcl/generic | |
parent | 57cfc82a14f8af97b7c7ae03681457d2491cc8fc (diff) |
Call WritePS with length argument, where known
...which also avoids clang-analyzer-deadcode.DeadStores on the final update of
the length variable when assembling the data prior to the call
Change-Id: I046b1fa253e1d26a09c5095516e336b471b2e2f0
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/print/bitmap_gfx.cxx | 6 | ||||
-rw-r--r-- | vcl/generic/print/common_gfx.cxx | 8 | ||||
-rw-r--r-- | vcl/generic/print/glyphset.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/print/printerjob.cxx | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/vcl/generic/print/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx index a5c9699c9542..317b24e2e044 100644 --- a/vcl/generic/print/bitmap_gfx.cxx +++ b/vcl/generic/print/bitmap_gfx.cxx @@ -489,7 +489,7 @@ PrinterGfx::DrawPS1GrayImage (const PrinterBmp& rBitmap, const Rectangle& rArea) nChar += psp::appendStr (" string readhexstring pop}\n", pGrayImage + nChar); nChar += psp::appendStr ("image\n", pGrayImage + nChar); - WritePS (mpPageBody, pGrayImage); + WritePS (mpPageBody, pGrayImage, nChar); // image body std::unique_ptr<HexEncoder> xEncoder(new HexEncoder (mpPageBody)); @@ -540,7 +540,7 @@ PrinterGfx::writePS2ImageHeader (const Rectangle& rArea, psp::ImageType nType) nChar += psp::getValueOf (nCompressType, pImage + nChar); nChar += psp::appendStr (" psp_imagedict image\n", pImage + nChar); - WritePS (mpPageBody, pImage); + WritePS (mpPageBody, pImage, nChar); } void @@ -573,7 +573,7 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp& rBitmap, psp::ImageType nType) nChar += psp::appendStr ("\npsp_lzwstring\n", pImage + nChar); else nChar += psp::appendStr ("\npsp_ascii85string\n", pImage + nChar); - WritePS (mpPageBody, pImage); + WritePS (mpPageBody, pImage, nChar); std::unique_ptr<ByteEncoder> xEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody) : new Ascii85Encoder(mpPageBody)); diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index 58a11ca268cd..6ec58b6f883f 100644 --- a/vcl/generic/print/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -802,7 +802,7 @@ PrinterGfx::PSSetFont () nChar += psp::appendStr (" 0 0] makefont setfont\n", pSetFont + nChar); } - WritePS (mpPageBody, pSetFont); + WritePS (mpPageBody, pSetFont, nChar); } } @@ -827,7 +827,7 @@ PrinterGfx::PSRotate (sal_Int32 nAngle) nChar += psp::getValueOf (nTenthAngle, pRotate + nChar); nChar += psp::appendStr (" rotate\n", pRotate + nChar); - WritePS (mpPageBody, pRotate); + WritePS (mpPageBody, pRotate, nChar); } void @@ -994,7 +994,7 @@ PrinterGfx::PSScale (double fScaleX, double fScaleY) nChar += psp::getValueOfDouble (pScale + nChar, fScaleY, 5); nChar += psp::appendStr (" scale\n", pScale + nChar); - WritePS (mpPageBody, pScale); + WritePS (mpPageBody, pScale, nChar); } /* psshowtext helper routines: draw an hex string for show/xshow */ @@ -1044,7 +1044,7 @@ PrinterGfx::PSDeltaArray (const sal_Int32 *pArray, sal_Int16 nEntries) } nChar += psp::appendStr (" 0]\n", pPSArray + nChar); - WritePS (mpPageBody, pPSArray); + WritePS (mpPageBody, pPSArray, nChar); } /* the DrawText equivalent, pDeltaArray may be NULL. For Type1 fonts or single byte diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx index cf6d28956bf7..0c835e86e2a9 100644 --- a/vcl/generic/print/glyphset.cxx +++ b/vcl/generic/print/glyphset.cxx @@ -408,7 +408,7 @@ GlyphSet::PSDefineReencodedFont (osl::File* pOutFile, sal_Int32 nGlyphSetID) nSize += psp::appendStr (" psp_definefont\n", pEncodingVector + nSize); - psp::WritePS (pOutFile, pEncodingVector); + psp::WritePS (pOutFile, pEncodingVector, nSize); } OString @@ -672,7 +672,7 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx) } nSize += psp::appendStr ("] def\n", pEncodingVector + nSize); - psp::WritePS (pOutFile, pEncodingVector); + psp::WritePS (pOutFile, pEncodingVector, nSize); PSDefineReencodedFont (pOutFile, nGlyphSetID); } diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx index 887ca331cfe6..fd42783b9b67 100644 --- a/vcl/generic/print/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -627,7 +627,7 @@ PrinterJob::StartPage (const JobData& rJobSetup) nChar += psp::getValueOf (mnHeightPt - mnTMarginPt, pBBox + nChar); nChar += psp::appendStr ("\n", pBBox + nChar); - WritePS (pPageHeader, pBBox); + WritePS (pPageHeader, pBBox, nChar); /* #i7262# #i65491# write setup only before first page * (to %%Begin(End)Setup, instead of %%Begin(End)PageSetup) @@ -666,7 +666,7 @@ PrinterJob::EndPage () nChar = psp::appendStr ("grestore grestore\n", pTrailer); nChar += psp::appendStr ("showpage\n", pTrailer + nChar); nChar += psp::appendStr ("%%PageTrailer\n\n", pTrailer + nChar); - WritePS (pPageBody, pTrailer); + WritePS (pPageBody, pTrailer, nChar); // this page is done for now, close it to avoid having too many open fd's @@ -814,7 +814,7 @@ bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob, bool bWr pTranslate + nChar); } - WritePS (pFile, pTranslate); + WritePS (pFile, pTranslate, nChar); return bSuccess; } |