summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-17 14:35:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-17 16:51:59 +0100
commit810e5008e75e54241e056de2129886689d7c21eb (patch)
tree588b47a18dd8760b55b8c8ea101ba35d82c2ef52 /vcl/unx/generic
parentbe050c18eada0f6b483cbfccc0df91ff3837f773 (diff)
Comment non-obvious Ascii85Encoder::ConvertToAscii85 code
(see e.g. the "ASCII85Encode Filter" section on p. 129 of the PostScript Language Reference Manual, 2nd ed., Addison-Wesley 1990) Change-Id: Icfb6d64f67e40053ae8a0f292dd52bd72178ef36 Reviewed-on: https://gerrit.libreoffice.org/66522 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/print/bitmap_gfx.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/unx/generic/print/bitmap_gfx.cxx b/vcl/unx/generic/print/bitmap_gfx.cxx
index 613920aaed27..fffe137f7981 100644
--- a/vcl/unx/generic/print/bitmap_gfx.cxx
+++ b/vcl/unx/generic/print/bitmap_gfx.cxx
@@ -170,6 +170,7 @@ Ascii85Encoder::PutEOD ()
void
Ascii85Encoder::ConvertToAscii85 ()
{
+ // Add (4 - mnByte) zero padding bytes:
if (mnByte < 4)
std::memset (mpByteBuffer + mnByte, 0, (4 - mnByte) * sizeof(sal_uInt8));
@@ -199,6 +200,8 @@ Ascii85Encoder::ConvertToAscii85 ()
nByteValue /= 85;
mpFileBuffer [mnOffset + 0] = (nByteValue % 85) + 33;
+ // Ignore the last (4 - mnByte) generated characters that correspond to the (4 - mnByte)
+ // zero padding bytes:
mnColumn += (mnByte + 1);
mnOffset += (mnByte + 1);