summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/print
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-12 17:12:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 19:22:21 +0200
commiteaf0c263eb1a72a58d2a67cc0506ab022d7c4be4 (patch)
tree4c732e95b560235e83c6de4b5b96260b638fa88d /vcl/unx/generic/print
parent921ae49cd7e332d7e1ad702efe2198b2780cc829 (diff)
loplugin:staticconstfield improvements
And fix ScXMLCachedRowAttrAccess::Cache which was never setting its mnTab field, and hence would never be hit. And fix oox::xls::CellBlockBuffer, which was never setting mnCurrRow. Change-Id: I2c46aa050b9ebe3c2dc2e52579555f97945dd61c Reviewed-on: https://gerrit.libreoffice.org/61772 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic/print')
-rw-r--r--vcl/unx/generic/print/bitmap_gfx.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/vcl/unx/generic/print/bitmap_gfx.cxx b/vcl/unx/generic/print/bitmap_gfx.cxx
index 04ce1fd3ba96..613920aaed27 100644
--- a/vcl/unx/generic/print/bitmap_gfx.cxx
+++ b/vcl/unx/generic/print/bitmap_gfx.cxx
@@ -278,8 +278,8 @@ private:
mpTable; // LZW compression data
LZWCTreeNode* mpPrefix; // the compression is as same as the TIFF compression
static constexpr sal_uInt16 gnDataSize = 8;
- sal_uInt16 const mnClearCode;
- sal_uInt16 const mnEOICode;
+ static constexpr sal_uInt16 gnClearCode = 1 << gnDataSize;
+ static constexpr sal_uInt16 gnEOICode = gnClearCode + 1;
sal_uInt16 mnTableSize;
sal_uInt16 mnCodeSize;
sal_uInt32 mnOffset;
@@ -298,9 +298,7 @@ public:
LZWEncoder::LZWEncoder(osl::File* pOutputFile) :
Ascii85Encoder (pOutputFile),
mpPrefix(nullptr),
- mnClearCode(1 << gnDataSize),
- mnEOICode(mnClearCode + 1),
- mnTableSize(mnEOICode + 1),
+ mnTableSize(gnEOICode + 1),
mnCodeSize(gnDataSize + 1),
mnOffset(32), // free bits in dwShift
mdwShift(0)
@@ -313,7 +311,7 @@ LZWEncoder::LZWEncoder(osl::File* pOutputFile) :
mpTable[i].mnValue = static_cast<sal_uInt8>(mpTable[i].mnCode);
}
- WriteBits( mnClearCode, mnCodeSize );
+ WriteBits( gnClearCode, mnCodeSize );
}
LZWEncoder::~LZWEncoder()
@@ -321,7 +319,7 @@ LZWEncoder::~LZWEncoder()
if (mpPrefix)
WriteBits (mpPrefix->mnCode, mnCodeSize);
- WriteBits (mnEOICode, mnCodeSize);
+ WriteBits (gnEOICode, mnCodeSize);
}
void
@@ -369,13 +367,13 @@ LZWEncoder::EncodeByte (sal_uInt8 nByte )
if (mnTableSize == 409)
{
- WriteBits (mnClearCode, mnCodeSize);
+ WriteBits (gnClearCode, mnCodeSize);
- for (i = 0; i < mnClearCode; i++)
+ for (i = 0; i < gnClearCode; i++)
mpTable[i].mpFirstChild = nullptr;
mnCodeSize = gnDataSize + 1;
- mnTableSize = mnEOICode + 1;
+ mnTableSize = gnEOICode + 1;
}
else
{