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

Change-Id: I0c2d06e03f2fbb15ddb35e3d24f1cf2f926dc4dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105676
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Philipp Hofer 2020-11-12 12:59:30 +01:00 committed by Christian Lohmaier
parent 36074893c8
commit 7721e7a797
8 changed files with 43 additions and 72 deletions

View file

@ -20,10 +20,7 @@
#ifndef INCLUDED_HWPFILTER_SOURCE_DATECODE_H
#define INCLUDED_HWPFILTER_SOURCE_DATECODE_H
const hchar defaultform[] =
{
'1', 0x9165, 32, '2', 0xB6A9, 32, '3', 0xB7A9, 0
};
const hchar defaultform[] = { '1', 0x9165, 32, '2', 0xB6A9, 32, '3', 0xB7A9, 0 };
#endif

View file

@ -32,13 +32,9 @@ HWPFont::HWPFont()
}
}
HWPFont::~HWPFont() {}
HWPFont::~HWPFont()
{
}
void HWPFont::AddFont(int lang, const char *font)
void HWPFont::AddFont(int lang, const char* font)
{
int nfonts;
@ -53,8 +49,7 @@ void HWPFont::AddFont(int lang, const char *font)
nFonts[lang]++;
}
const char *HWPFont::GetFontName(int lang, int id)
const char* HWPFont::GetFontName(int lang, int id)
{
if (lang < 0 || lang >= NLanguage)
return nullptr;
@ -63,16 +58,15 @@ const char *HWPFont::GetFontName(int lang, int id)
return fontnames[lang].get() + id * FONTNAMELEN;
}
static char buffer[FONTNAMELEN];
void HWPFont::Read(HWPFile & hwpf)
void HWPFont::Read(HWPFile& hwpf)
{
int lang = 0;
short nfonts = 0;
//printf("HWPFont::Read : lang = %d\n",NLanguage);
for(lang = 0; lang < NLanguage; lang++)
//printf("HWPFont::Read : lang = %d\n",NLanguage);
for (lang = 0; lang < NLanguage; lang++)
{
hwpf.Read2b(&nfonts, 1);
if (nfonts <= 0 || nfonts >= MAXFONTS)

View file

@ -26,12 +26,9 @@ HStream::HStream()
{
}
void HStream::addData(const byte *buf, size_t aToAdd)
{
seq.insert(seq.end(), buf, buf + aToAdd);
}
void HStream::addData(const byte* buf, size_t aToAdd) { seq.insert(seq.end(), buf, buf + aToAdd); }
size_t HStream::readBytes(byte * buf, size_t aToRead)
size_t HStream::readBytes(byte* buf, size_t aToRead)
{
auto size = seq.size();
if (aToRead >= (size - pos))
@ -50,9 +47,6 @@ size_t HStream::skipBytes(size_t aToSkip)
return aToSkip;
}
size_t HStream::available() const
{
return seq.size() - pos;
}
size_t HStream::available() const { return seq.size() - pos; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -26,19 +26,20 @@
#include "hstyle.h"
enum
{ MAXSTYLENAME = 20 };
{
MAXSTYLENAME = 20
};
#define DATA static_cast<StyleData *>(style)
namespace {
#define DATA static_cast<StyleData*>(style)
namespace
{
struct StyleData
{
char name[MAXSTYLENAME + 1];
CharShape cshape;
ParaShape pshape;
};
}
static char buffer[MAXSTYLENAME + 1];
@ -49,23 +50,20 @@ HWPStyle::HWPStyle()
style = nullptr;
}
HWPStyle::~HWPStyle()
{
delete[]DATA;
delete[] DATA;
nstyles = 0;
}
char *HWPStyle::GetName(int n) const
char* HWPStyle::GetName(int n) const
{
if (n < 0 || n >= nstyles)
return nullptr;
return DATA[n].name;
}
void HWPStyle::SetName(int n, char const *name)
void HWPStyle::SetName(int n, char const* name)
{
if (n < 0 || n >= nstyles)
return;
@ -87,16 +85,14 @@ void HWPStyle::SetName(int n, char const *name)
DATA[n].name[0] = 0;
}
CharShape *HWPStyle::GetCharShape(int n) const
CharShape* HWPStyle::GetCharShape(int n) const
{
if (n < 0 || n >= nstyles)
return nullptr;
return &DATA[n].cshape;
}
void HWPStyle::SetCharShape(int n, CharShape const * cshapep)
void HWPStyle::SetCharShape(int n, CharShape const* cshapep)
{
if (n >= 0 && n < nstyles)
{
@ -107,16 +103,14 @@ void HWPStyle::SetCharShape(int n, CharShape const * cshapep)
}
}
ParaShape *HWPStyle::GetParaShape(int n) const
ParaShape* HWPStyle::GetParaShape(int n) const
{
if (n < 0 || n >= nstyles)
return nullptr;
return &DATA[n].pshape;
}
void HWPStyle::SetParaShape(int n, ParaShape const * pshapep)
void HWPStyle::SetParaShape(int n, ParaShape const* pshapep)
{
if (n >= 0 && n < nstyles)
{
@ -127,8 +121,7 @@ void HWPStyle::SetParaShape(int n, ParaShape const * pshapep)
}
}
void HWPStyle::Read(HWPFile & hwpf)
void HWPStyle::Read(HWPFile& hwpf)
{
CharShape cshape;
ParaShape pshape;

View file

@ -22,7 +22,7 @@
#include <memory>
#ifdef _WIN32
# include <objidl.h>
#include <objidl.h>
#endif
class HWPFile;
@ -32,8 +32,8 @@ class HWPFile;
struct EmPicture
{
size_t size;
char name[16];
char type[16];
char name[16];
char type[16];
std::unique_ptr<uchar[]> data;
explicit EmPicture(size_t size);
@ -48,7 +48,7 @@ struct HyperText
{
kchar filename[256];
hchar bookmark[16];
char macro[325];
char macro[325];
uchar type;
char reserve[3];
bool Read(HWPFile& hwpf);
@ -58,10 +58,10 @@ struct HyperText
*/
struct OlePicture
{
int size;
int size;
uint signature;
#ifdef _WIN32
IStorage *pis;
IStorage* pis;
#endif
explicit OlePicture(int tsize);
~OlePicture(void);

View file

@ -18,9 +18,9 @@
*/
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <crtdbg.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <crtdbg.h>
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -23,17 +23,17 @@
class mgcLinearSystemD
{
public:
static std::unique_ptr<std::unique_ptr<double[]>[]> NewMatrix (int N);
static std::unique_ptr<double[]> NewVector (int N);
static std::unique_ptr<std::unique_ptr<double[]>[]> NewMatrix(int N);
static std::unique_ptr<double[]> NewVector(int N);
static bool Solve (int N, std::unique_ptr<std::unique_ptr<double[]>[]> const & A, double* b);
// Input:
// A[N][N] coefficient matrix, entries are A[row][col]
// b[N] vector, entries are b[row]
// Output:
// return value is TRUE if successful, FALSE if pivoting failed
// A[N][N] is inverse matrix
// b[N] is solution x to Ax = b
static bool Solve(int N, std::unique_ptr<std::unique_ptr<double[]>[]> const& A, double* b);
// Input:
// A[N][N] coefficient matrix, entries are A[row][col]
// b[N] vector, entries are b[row]
// Output:
// return value is TRUE if successful, FALSE if pivoting failed
// A[N][N] is inverse matrix
// b[N] is solution x to Ax = b
};
#endif

View file

@ -4813,7 +4813,6 @@ hwpfilter/source/attributes.cxx
hwpfilter/source/attributes.hxx
hwpfilter/source/cspline.cxx
hwpfilter/source/cspline.h
hwpfilter/source/datecode.h
hwpfilter/source/drawdef.h
hwpfilter/source/drawing.h
hwpfilter/source/fontmap.cxx
@ -4825,7 +4824,6 @@ hwpfilter/source/hbox.cxx
hwpfilter/source/hbox.h
hwpfilter/source/hcode.cxx
hwpfilter/source/hcode.h
hwpfilter/source/hfont.cxx
hwpfilter/source/hfont.h
hwpfilter/source/hgzip.cxx
hwpfilter/source/hgzip.h
@ -4835,12 +4833,9 @@ hwpfilter/source/hiodev.cxx
hwpfilter/source/hiodev.h
hwpfilter/source/hpara.cxx
hwpfilter/source/hpara.h
hwpfilter/source/hstream.cxx
hwpfilter/source/hstream.hxx
hwpfilter/source/hstyle.cxx
hwpfilter/source/hstyle.h
hwpfilter/source/htags.cxx
hwpfilter/source/htags.h
hwpfilter/source/hutil.cxx
hwpfilter/source/hutil.h
hwpfilter/source/hwpeq.cxx
@ -4856,9 +4851,7 @@ hwpfilter/source/mapping.h
hwpfilter/source/mzstring.cxx
hwpfilter/source/mzstring.h
hwpfilter/source/nodes.h
hwpfilter/source/precompile.h
hwpfilter/source/solver.cxx
hwpfilter/source/solver.h
i18nlangtag/qa/cppunit/test_languagetag.cxx
i18nlangtag/source/isolang/inunx.cxx
i18nlangtag/source/isolang/inwnt.cxx