tdf#123936 Formatting files in module filter with clang-format

Change-Id: I787835eb102868bbd52cdb1c9999b5dad553947f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105669
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
This commit is contained in:
Philipp Hofer
2020-11-12 12:57:13 +01:00
committed by Christian Lohmaier
parent 302d64cb3c
commit e8e093f14b
5 changed files with 23 additions and 31 deletions

View File

@@ -15,11 +15,10 @@
class GDIMetaFile; class GDIMetaFile;
class SvStream; class SvStream;
namespace pict { namespace pict
{
/// Function to access PictReader::ReadPict for unit testing. /// Function to access PictReader::ReadPict for unit testing.
void ReadPictFile(SvStream &rStreamPict, GDIMetaFile& rGDIMetaFile); void ReadPictFile(SvStream& rStreamPict, GDIMetaFile& rGDIMetaFile);
} }
#endif // INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_HXX #endif // INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_HXX

View File

@@ -25,7 +25,8 @@
#define MAX_TABLE_SIZE 4096 #define MAX_TABLE_SIZE 4096
struct LZWTableEntry { struct LZWTableEntry
{
sal_uInt16 nPrevCode; sal_uInt16 nPrevCode;
sal_uInt16 nDataCount; sal_uInt16 nDataCount;
sal_uInt8 nData; sal_uInt8 nData;
@@ -33,26 +34,24 @@ struct LZWTableEntry {
class SvStream; class SvStream;
class LZWDecompressor { class LZWDecompressor
{
public: public:
LZWDecompressor(); LZWDecompressor();
~LZWDecompressor(); ~LZWDecompressor();
void StartDecompression(SvStream & rIStream); void StartDecompression(SvStream& rIStream);
sal_uInt64 Decompress(sal_uInt8 * pTarget, sal_uInt32 nMaxCount); // Returns the number of written bytes. If < nMaxCount there is
// Returns the number of written bytes. If < nMaxCount there is // no more data to be unpacked or an error occurred.
// no more data to be unpacked or an error occurred. sal_uInt64 Decompress(sal_uInt8* pTarget, sal_uInt32 nMaxCount);
private: private:
sal_uInt16 GetNextCode(); sal_uInt16 GetNextCode();
void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData); void AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData);
void DecompressSome(); void DecompressSome();
SvStream * pIStream; SvStream* pIStream;
std::array<LZWTableEntry, MAX_TABLE_SIZE> pTable; std::array<LZWTableEntry, MAX_TABLE_SIZE> pTable;
sal_uInt16 nTableSize; sal_uInt16 nTableSize;
@@ -62,15 +61,13 @@ private:
sal_uInt16 nOldCode; sal_uInt16 nOldCode;
std::array<sal_uInt8, MAX_TABLE_SIZE> pOutBuf; std::array<sal_uInt8, MAX_TABLE_SIZE> pOutBuf;
sal_uInt8 * pOutBufData; sal_uInt8* pOutBufData;
sal_uInt16 nOutBufDataLen; sal_uInt16 nOutBufDataLen;
sal_uInt8 nInputBitsBuf; sal_uInt8 nInputBitsBuf;
sal_uInt16 nInputBitsBufSize; sal_uInt16 nInputBitsBufSize;
}; };
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -19,21 +19,21 @@
#include <filter/msfilter/dffrecordheader.hxx> #include <filter/msfilter/dffrecordheader.hxx>
bool ReadDffRecordHeader( SvStream& rIn, DffRecordHeader& rRec ) bool ReadDffRecordHeader(SvStream& rIn, DffRecordHeader& rRec)
{ {
rRec.nFilePos = rIn.Tell(); rRec.nFilePos = rIn.Tell();
sal_uInt16 nTmp(0); sal_uInt16 nTmp(0);
rIn.ReadUInt16( nTmp ); rIn.ReadUInt16(nTmp);
rRec.nImpVerInst = nTmp; rRec.nImpVerInst = nTmp;
rRec.nRecVer = sal::static_int_cast< sal_uInt8 >(nTmp & 0x000F); rRec.nRecVer = sal::static_int_cast<sal_uInt8>(nTmp & 0x000F);
rRec.nRecInstance = nTmp >> 4; rRec.nRecInstance = nTmp >> 4;
rIn.ReadUInt16( rRec.nRecType ); rIn.ReadUInt16(rRec.nRecType);
rIn.ReadUInt32( rRec.nRecLen ); rIn.ReadUInt32(rRec.nRecLen);
// preserving overflow, optimally we would check // preserving overflow, optimally we would check
// the record size against the parent header // the record size against the parent header
if ( rRec.nRecLen > ( SAL_MAX_UINT32 - rRec.nFilePos ) ) if (rRec.nRecLen > (SAL_MAX_UINT32 - rRec.nFilePos))
rIn.SetError( SVSTREAM_FILEFORMAT_ERROR ); rIn.SetError(SVSTREAM_FILEFORMAT_ERROR);
return rIn.good(); return rIn.good();
} }

View File

@@ -26,9 +26,9 @@
namespace svgi namespace svgi
{ {
/// Creates a XDocumentHandler that serializes directly to an XOutputStream /// Creates a XDocumentHandler that serializes directly to an XOutputStream
css::uno::Reference< css::xml::sax::XDocumentHandler> css::uno::Reference<css::xml::sax::XDocumentHandler>
createSerializer(const css::uno::Reference<css::io::XOutputStream>& ); createSerializer(const css::uno::Reference<css::io::XOutputStream>&);
} }
#endif // INCLUDED_FILTER_SOURCE_SVG_TEST_ODFSERIALIZER_HXX #endif // INCLUDED_FILTER_SOURCE_SVG_TEST_ODFSERIALIZER_HXX

View File

@@ -4138,7 +4138,6 @@ filter/source/graphicfilter/ipbm/ipbm.cxx
filter/source/graphicfilter/ipcd/ipcd.cxx filter/source/graphicfilter/ipcd/ipcd.cxx
filter/source/graphicfilter/ipcx/ipcx.cxx filter/source/graphicfilter/ipcx/ipcx.cxx
filter/source/graphicfilter/ipict/ipict.cxx filter/source/graphicfilter/ipict/ipict.cxx
filter/source/graphicfilter/ipict/ipict.hxx
filter/source/graphicfilter/ipict/shape.cxx filter/source/graphicfilter/ipict/shape.cxx
filter/source/graphicfilter/ipict/shape.hxx filter/source/graphicfilter/ipict/shape.hxx
filter/source/graphicfilter/ipsd/ipsd.cxx filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -4148,10 +4147,8 @@ filter/source/graphicfilter/itiff/ccidecom.cxx
filter/source/graphicfilter/itiff/ccidecom.hxx filter/source/graphicfilter/itiff/ccidecom.hxx
filter/source/graphicfilter/itiff/itiff.cxx filter/source/graphicfilter/itiff/itiff.cxx
filter/source/graphicfilter/itiff/lzwdecom.cxx filter/source/graphicfilter/itiff/lzwdecom.cxx
filter/source/graphicfilter/itiff/lzwdecom.hxx
filter/source/msfilter/countryid.cxx filter/source/msfilter/countryid.cxx
filter/source/msfilter/dffpropset.cxx filter/source/msfilter/dffpropset.cxx
filter/source/msfilter/dffrecordheader.cxx
filter/source/msfilter/escherex.cxx filter/source/msfilter/escherex.cxx
filter/source/msfilter/eschesdo.cxx filter/source/msfilter/eschesdo.cxx
filter/source/msfilter/eschesdo.hxx filter/source/msfilter/eschesdo.hxx
@@ -4186,7 +4183,6 @@ filter/source/svg/svgfontexport.hxx
filter/source/svg/svgwriter.cxx filter/source/svg/svgwriter.cxx
filter/source/svg/svgwriter.hxx filter/source/svg/svgwriter.hxx
filter/source/svg/test/odfserializer.cxx filter/source/svg/test/odfserializer.cxx
filter/source/svg/test/odfserializer.hxx
filter/source/t602/t602filter.cxx filter/source/t602/t602filter.cxx
filter/source/t602/t602filter.hxx filter/source/t602/t602filter.hxx
filter/source/textfilterdetect/filterdetect.cxx filter/source/textfilterdetect/filterdetect.cxx