loplugin:nullptr (automatic rewrite)

Change-Id: Idec97093ca48c14b825c7b87ec050cc99aadc526
This commit is contained in:
Stephan Bergmann 2015-11-10 10:16:36 +01:00
parent 2df257e95e
commit c3dcdeb1d2
21 changed files with 418 additions and 418 deletions

View File

@ -85,7 +85,7 @@ HWPDOFuncType HWPDOFuncTbl[] =
HWPDOFreeFormFunc,
};
static HMemIODev *hmem = 0;
static HMemIODev *hmem = NULL;
static int count = 0;
@ -299,7 +299,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
hdo->property.contrast = 0;
hdo->property.greyscale = 0;
}
hdo->property.pPara = 0L;
hdo->property.pPara = NULL;
if( ( size > common_size ) && (hdo->property.flag & HWPDO_FLAG_AS_TEXTBOX) )
{
@ -392,7 +392,7 @@ static HWPDrawingObject *LoadDrawingObject(void)
return head;
}
else
return 0;
return NULL;
}
@ -423,7 +423,7 @@ static bool LoadDrawingObjectBlock(Picture * pic)
return false;
pic->picinfo.picdraw.hdo = LoadDrawingObject();
if (pic->picinfo.picdraw.hdo == 0)
if (pic->picinfo.picdraw.hdo == NULL)
return false;
return true;
}
@ -557,7 +557,7 @@ int cmd, void *argp, int argv)
{
case OBJFUNC_LOAD:
{
hdo->u.freeform.pt = 0;
hdo->u.freeform.pt = NULL;
if (ReadSizeField(4) < 4)
return OBJRET_FILE_ERROR;
if (!hmem->read4b(hdo->u.freeform.npt))
@ -625,7 +625,7 @@ static void FreeParaList(HWPPara * para)
static HWPPara *LoadParaList()
{
if (!hmem)
return 0;
return NULL;
HWPFile *hwpf = GetCurrentDoc();
HIODev *hio = hwpf->SetIODevice(hmem);
@ -635,7 +635,7 @@ static HWPPara *LoadParaList()
hwpf->ReadParaList(plist);
hwpf->SetIODevice(hio);
return plist.size()? plist.front() : 0;
return plist.size()? plist.front() : NULL;
}

View File

@ -570,7 +570,7 @@ void Formula::makeBlock(Node *res)
int Formula::parse()
{
Node *res = 0L;
Node *res = nullptr;
if( !eq ) return 0;
if( isHwpEQ ){
MzString a;
@ -611,7 +611,7 @@ int Formula::parse()
if( buf[0] != '\0' )
res = mainParse( a.c_str() );
else
res = 0L;
res = nullptr;
free(buf);
}
else{
@ -659,7 +659,7 @@ void Formula::trim()
if( buf[0] != '\0' )
strcpy(eq, buf);
else
eq = 0L;
eq = nullptr;
free(buf);
}

View File

@ -40,7 +40,7 @@ std::list<Node*> nodelist;
void yyerror(const char *);
Node *top=0L;
Node *top=nullptr;
int Node::count = 0;
@ -525,7 +525,7 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
YYSTYPE yyval; /* the variable used to return */
yyval.dval = 0;
yyval.dval = nullptr;
/* semantic values from the action */
/* routines */
@ -1226,12 +1226,12 @@ yyerrhandle:
Node *mainParse(const char *_code)
{
initFlex( _code );
top = 0L;
top = nullptr;
yyparse();
if( top )
return top;
else
return 0L;
return nullptr;
}
void yyerror(const char * /*err*/)
@ -1244,7 +1244,7 @@ void yyerror(const char * /*err*/)
nodelist.pop_front();
delete pNode;
}
top = 0L;
top = nullptr;
}
#ifndef PARSE_DEBUG

View File

@ -76,7 +76,7 @@ SkipData::SkipData(hchar hch)
: HBox(hch)
, data_block_len(0)
, dummy(0)
, data_block(0)
, data_block(nullptr)
{
}
@ -90,11 +90,11 @@ SkipData::~SkipData()
FieldCode::FieldCode()
: HBox(CH_FIELD)
, location_info(0)
, str1(NULL)
, str2(NULL)
, str3(NULL)
, bin(NULL)
, m_pDate(NULL)
, str1(nullptr)
, str2(nullptr)
, str3(nullptr)
, bin(nullptr)
, m_pDate(nullptr)
{
reserved1 = new char[4];
reserved2 = new char[22];
@ -316,8 +316,8 @@ FBox::FBox(hchar hch)
, pgy(0)
, pgno(0)
, showpg(0)
, prev(NULL)
, next(NULL)
, prev(nullptr)
, next(nullptr)
{
}
@ -341,9 +341,9 @@ TxtBox::TxtBox()
, type(0)
, nCell(0)
, protect(0)
, cell(0)
, m_pTable(NULL)
, plists(NULL)
, cell(nullptr)
, m_pTable(nullptr)
, plists(nullptr)
{
reserved[0] = reserved[1] = 0;
}
@ -385,7 +385,7 @@ Picture::Picture()
, cap_pos(0)
, num(0)
, pictype(0)
, follow(0)
, follow(nullptr)
, ishyper(false)
{
}
@ -525,7 +525,7 @@ static const hchar *GetOutlineStyleChars(int style)
};
if (style >= OLSTY_BULLET1 && style <= OLSTY_BULLET5)
return out_bul_style_entry[style - OLSTY_BULLET1];
return NULL;
return nullptr;
}

View File

@ -28,7 +28,7 @@ HWPFont::HWPFont()
for (int ii = 0; ii < NLanguage; ii++)
{
nFonts[ii] = 0;
fontnames[ii] = NULL;
fontnames[ii] = nullptr;
}
}
@ -61,9 +61,9 @@ int HWPFont::AddFont(int lang, const char *font)
const char *HWPFont::GetFontName(int lang, int id)
{
if (!(lang >= 0 && lang < NLanguage))
return 0;
return nullptr;
if (id < 0 || nFonts[lang] <= id)
return 0;
return nullptr;
return fontnames[lang] + id * FONTNAMELEN;
}

View File

@ -71,7 +71,7 @@ gz_stream *gz_open(HStream & _stream)
s->z_err = Z_OK;
s->z_eof = 0;
s->crc = crc32(0L, Z_NULL, 0);
s->msg = NULL;
s->msg = nullptr;
s->transparent = 0;
s->mode = 'r';
@ -134,7 +134,7 @@ local int destroy(gz_stream * s)
TRYFREE(s->msg);
if (s->stream.state != NULL)
if (s->stream.state != nullptr)
{
err = inflateEnd(&(s->stream));
}
@ -160,7 +160,7 @@ int gz_read(gz_stream * file, voidp buf, unsigned len)
gz_stream *s = file;
Bytef *start = static_cast<Bytef *>(buf); /* starting point for crc computation */
Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
if (s == NULL)
if (s == nullptr)
return Z_STREAM_ERROR;
if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)
@ -245,7 +245,7 @@ int gz_flush(gz_stream * file, int flush)
bool done = false;
gz_stream *s = file;
if (s == NULL || s->mode != 'w')
if (s == nullptr || s->mode != 'w')
return Z_STREAM_ERROR;
s->stream.avail_in = 0; /* should be zero already anyway */
@ -307,7 +307,7 @@ int gz_close(gz_stream * file)
// int err;
gz_stream *s = file;
if (s == NULL)
if (s == nullptr)
return Z_STREAM_ERROR;
#if 0
if (s->mode == 'w')

View File

@ -56,7 +56,7 @@ HWPInfo::HWPInfo()
, compressed(0)
, reserved3(0)
, info_block_len(0)
, info_block(NULL)
, info_block(nullptr)
{
back_info.isset = false;
memset(reserved1, 0, sizeof(reserved1));
@ -67,7 +67,7 @@ HWPInfo::HWPInfo()
HWPInfo::~HWPInfo()
{
delete[] info_block;
info_block = 0;
info_block = nullptr;
}

View File

@ -122,7 +122,7 @@ HStreamIODev::~HStreamIODev()
void HStreamIODev::init()
{
_gzfp = NULL;
_gzfp = nullptr;
compressed = false;
}
@ -148,7 +148,7 @@ void HStreamIODev::close()
this->flush();
if (_gzfp)
gz_close(_gzfp);
_gzfp = NULL;
_gzfp = nullptr;
}
@ -163,12 +163,12 @@ bool HStreamIODev::setCompressed(bool flag)
{
compressed = flag;
if (flag)
return 0 != (_gzfp = gz_open(*_stream));
return nullptr != (_gzfp = gz_open(*_stream));
else if (_gzfp)
{
gz_flush(_gzfp, Z_FINISH);
gz_close(_gzfp);
_gzfp = 0;
_gzfp = nullptr;
}
return true;
}
@ -278,7 +278,7 @@ HMemIODev::~HMemIODev()
void HMemIODev::init()
{
ptr = 0;
ptr = nullptr;
length = 0;
pos = 0;
}

View File

@ -67,7 +67,7 @@ bool LineInfo::Read(HWPFile & hwpf, HWPPara *pPara)
}
HWPPara::HWPPara()
: _next(NULL)
: _next(nullptr)
, reuse_shape(0)
, nch(0)
, nline(0)
@ -78,9 +78,9 @@ HWPPara::HWPPara()
, ctrlflag(0)
, pstyno(0)
, pno(0)
, linfo(NULL)
, cshapep(NULL)
, hhstr(NULL)
, linfo(nullptr)
, cshapep(nullptr)
, hhstr(nullptr)
{
memset(&cshape, 0, sizeof(cshape));
memset(&pshape, 0, sizeof(pshape));
@ -186,11 +186,11 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
hhstr = ::comphelper::newArray_null<HBox *>(nch);
if (!hhstr) { return false; }
for (ii = 0; ii < nch; ii++)
hhstr[ii] = 0;
hhstr[ii] = nullptr;
ii = 0;
while (ii < nch)
{
if (0 == (hhstr[ii] = readHBox(hwpf)))
if (nullptr == (hhstr[ii] = readHBox(hwpf)))
return false;
if (hhstr[ii]->hh == CH_END_PARA)
break;
@ -218,12 +218,12 @@ HBox *HWPPara::readHBox(HWPFile & hwpf)
{
hchar hh;
if (!hwpf.Read2b(hh))
return 0;
return nullptr;
HBox *hbox = 0;
HBox *hbox = nullptr;
if (hwpf.State() != HWP_NoError)
return 0;
return nullptr;
if (hh > 31 || hh == CH_END_PARA)
hbox = new HBox(hh);
@ -310,7 +310,7 @@ HBox *HWPPara::readHBox(HWPFile & hwpf)
{
delete hbox;
return 0;
return nullptr;
}
if( hh == CH_TEXT_BOX || hh == CH_PICTURE || hh == CH_LINE )
{

View File

@ -42,7 +42,7 @@ static char buffer[MAXSTYLENAME + 1];
HWPStyle::HWPStyle()
{
nstyles = 0;
style = 0;
style = nullptr;
}
@ -58,7 +58,7 @@ HWPStyle::~HWPStyle()
char *HWPStyle::GetName(int n) const
{
if (!(n >= 0 && n < nstyles))
return 0;
return nullptr;
return DATA[n].name;
}
@ -78,7 +78,7 @@ void HWPStyle::SetName(int n, char *name)
CharShape *HWPStyle::GetCharShape(int n) const
{
if (!(n >= 0 && n < nstyles))
return 0;
return nullptr;
return &DATA[n].cshape;
}
@ -98,7 +98,7 @@ void HWPStyle::SetCharShape(int n, CharShape * cshapep)
ParaShape *HWPStyle::GetParaShape(int n) const
{
if (!(n >= 0 && n < nstyles))
return 0;
return nullptr;
return &DATA[n].pshape;
}

View File

@ -49,7 +49,7 @@ EmPicture::EmPicture(size_t tsize)
: size(tsize >= 32 ? tsize - 32 : 0)
{
if (size == 0)
data = 0;
data = nullptr;
else
data = new uchar[size];
}
@ -79,7 +79,7 @@ bool EmPicture::Read(HWPFile & hwpf)
OlePicture::OlePicture(int tsize)
: signature(0)
, pis(NULL)
, pis(nullptr)
{
size = tsize - 4;
if (size <= 0)
@ -139,7 +139,7 @@ bool OlePicture::Read(HWPFile & hwpf)
}
unlink(tname);
#else
if (pis == 0 || hwpf.ReadBlock(pis, size) == 0)
if (pis == nullptr || hwpf.ReadBlock(pis, size) == 0)
return false;
#endif

View File

@ -58,7 +58,7 @@ using namespace std;
enum { SCRIPT_NONE, SCRIPT_SUB, SCRIPT_SUP, SCRIPT_ALL};
static int eq_word(MzString& outs, istream *strm, int script = SCRIPT_NONE);
static bool eq_sentence(MzString& outs, istream *strm, const char *end = 0);
static bool eq_sentence(MzString& outs, istream *strm, const char *end = nullptr);
struct hwpeq {
const char *key; // hwp math keyword
@ -75,316 +75,316 @@ static const hwpeq eq_tbl[] = {
{ "<=", "\\leq ", 0, 0 },
{ "==", "\\equiv ", 0, 0 },
{ ">=", "\\geq ", 0, 0 },
{ "Pr", NULL, 0, 0 },
{ "Pr", nullptr, 0, 0 },
{ "^", "^", 1, 0 },
{ "_", "_", 1, 0 },
{ "`", "\\;", 0, 0 },
{ "acute", NULL, 1, 0 },
{ "aleph", NULL, 0, 0 },
{ "alpha", NULL, 0, EQ_CASE },
{ "amalg", NULL, 0, 0 },
{ "and", NULL, 0, 0 },
{ "angle", NULL, 0, 0 },
{ "angstrom", NULL, 0, 0 },
{ "approx", NULL, 0, 0 },
{ "arc", NULL, 0, 0 },
{ "arccos", NULL, 0, 0 },
{ "arch", NULL, 0, 0 },
{ "arcsin", NULL, 0, 0 },
{ "arctan", NULL, 0, 0 },
{ "arg", NULL, 0, 0 },
{ "acute", nullptr, 1, 0 },
{ "aleph", nullptr, 0, 0 },
{ "alpha", nullptr, 0, EQ_CASE },
{ "amalg", nullptr, 0, 0 },
{ "and", nullptr, 0, 0 },
{ "angle", nullptr, 0, 0 },
{ "angstrom", nullptr, 0, 0 },
{ "approx", nullptr, 0, 0 },
{ "arc", nullptr, 0, 0 },
{ "arccos", nullptr, 0, 0 },
{ "arch", nullptr, 0, 0 },
{ "arcsin", nullptr, 0, 0 },
{ "arctan", nullptr, 0, 0 },
{ "arg", nullptr, 0, 0 },
{ "assert", "\\vdash", 0, 0 },
{ "ast", NULL, 0, 0 },
{ "asymp", NULL, 0, 0 },
{ "atop", NULL, 1, EQ_ATOP },
{ "backslash", NULL, 0, 0 },
{ "bar", NULL, 1, 0 },
{ "because", NULL, 0, 0 },
{ "beta", NULL, 0, EQ_CASE },
{ "big", NULL, 0, EQ_CASE },
{ "bigcap", NULL, 0, 0 },
{ "bigcirc", NULL, 0, 0 },
{ "bigcup", NULL, 0, 0 },
{ "bigg", NULL, 0, EQ_CASE },
{ "bigodiv", NULL, 0, 0 },
{ "bigodot", NULL, 0, 0 },
{ "bigominus", NULL, 0, 0 },
{ "bigoplus", NULL, 0, 0 },
{ "bigotimes", NULL, 0, 0 },
{ "bigsqcap", NULL, 0, 0 },
{ "bigsqcup", NULL, 0, 0 },
{ "biguplus", NULL, 0, 0 },
{ "bigvee", NULL, 0, 0 },
{ "bigwedge", NULL, 0, 0 },
{ "binom", NULL, 2, 0 },
{ "bmatrix", NULL, 0, EQ_ENV },
{ "bold", NULL, 0, 0 },
{ "bot", NULL, 0, 0 },
{ "breve", NULL, 1, 0 },
{ "buildrel", NULL, 0, 0 }, // LATER
{ "bullet", NULL, 0, 0 },
{ "cap", NULL, 0, 0 },
{ "cases", NULL, 0, EQ_ENV },
{ "ccol", NULL, 0, 0 }, /* Center vertically */
{ "cdot", NULL, 0, 0 },
{ "cdots", NULL, 0, 0 },
{ "check", NULL, 1, 0 },
{ "chi", NULL, 0, EQ_CASE },
{ "choose", NULL, 0, EQ_ATOP },
{ "circ", NULL, 0, 0 },
{ "col", NULL, 0, 0 }, // LATER
{ "cong", NULL, 0, 0 },
{ "coprod", NULL, 0, 0 },
{ "cos", NULL, 0, 0 },
{ "cosec", NULL, 0, 0 },
{ "cosh", NULL, 0, 0 },
{ "cot", NULL, 0, 0 },
{ "coth", NULL, 0, 0 },
{ "cpile", NULL, 0, 0 }, // LATER
{ "csc", NULL, 0, 0 },
{ "cup", NULL, 0, 0 },
{ "dagger", NULL, 0, 0 },
{ "dashv", NULL, 0, 0 },
{ "ddagger", NULL, 0, 0 },
{ "ddot", NULL, 1, 0 },
{ "ddots", NULL, 0, 0 },
{ "def", NULL, 0, 0 },
{ "deg", NULL, 0, 0 },
{ "del", NULL, 0, 0 },
{ "delta", NULL, 0, EQ_CASE },
{ "diamond", NULL, 0, 0 },
{ "dim", NULL, 0, 0 },
{ "div", NULL, 0, 0 },
{ "divide", NULL, 0, 0 },
{ "dline", NULL, 0, 0 },
{ "dmatrix", NULL, 0, EQ_ENV },
{ "dot", NULL, 1, 0 },
{ "doteq", NULL, 0, 0 },
{ "dotsaxis", NULL, 0, 0 },
{ "dotsdiag", NULL, 0, 0 },
{ "ast", nullptr, 0, 0 },
{ "asymp", nullptr, 0, 0 },
{ "atop", nullptr, 1, EQ_ATOP },
{ "backslash", nullptr, 0, 0 },
{ "bar", nullptr, 1, 0 },
{ "because", nullptr, 0, 0 },
{ "beta", nullptr, 0, EQ_CASE },
{ "big", nullptr, 0, EQ_CASE },
{ "bigcap", nullptr, 0, 0 },
{ "bigcirc", nullptr, 0, 0 },
{ "bigcup", nullptr, 0, 0 },
{ "bigg", nullptr, 0, EQ_CASE },
{ "bigodiv", nullptr, 0, 0 },
{ "bigodot", nullptr, 0, 0 },
{ "bigominus", nullptr, 0, 0 },
{ "bigoplus", nullptr, 0, 0 },
{ "bigotimes", nullptr, 0, 0 },
{ "bigsqcap", nullptr, 0, 0 },
{ "bigsqcup", nullptr, 0, 0 },
{ "biguplus", nullptr, 0, 0 },
{ "bigvee", nullptr, 0, 0 },
{ "bigwedge", nullptr, 0, 0 },
{ "binom", nullptr, 2, 0 },
{ "bmatrix", nullptr, 0, EQ_ENV },
{ "bold", nullptr, 0, 0 },
{ "bot", nullptr, 0, 0 },
{ "breve", nullptr, 1, 0 },
{ "buildrel", nullptr, 0, 0 }, // LATER
{ "bullet", nullptr, 0, 0 },
{ "cap", nullptr, 0, 0 },
{ "cases", nullptr, 0, EQ_ENV },
{ "ccol", nullptr, 0, 0 }, /* Center vertically */
{ "cdot", nullptr, 0, 0 },
{ "cdots", nullptr, 0, 0 },
{ "check", nullptr, 1, 0 },
{ "chi", nullptr, 0, EQ_CASE },
{ "choose", nullptr, 0, EQ_ATOP },
{ "circ", nullptr, 0, 0 },
{ "col", nullptr, 0, 0 }, // LATER
{ "cong", nullptr, 0, 0 },
{ "coprod", nullptr, 0, 0 },
{ "cos", nullptr, 0, 0 },
{ "cosec", nullptr, 0, 0 },
{ "cosh", nullptr, 0, 0 },
{ "cot", nullptr, 0, 0 },
{ "coth", nullptr, 0, 0 },
{ "cpile", nullptr, 0, 0 }, // LATER
{ "csc", nullptr, 0, 0 },
{ "cup", nullptr, 0, 0 },
{ "dagger", nullptr, 0, 0 },
{ "dashv", nullptr, 0, 0 },
{ "ddagger", nullptr, 0, 0 },
{ "ddot", nullptr, 1, 0 },
{ "ddots", nullptr, 0, 0 },
{ "def", nullptr, 0, 0 },
{ "deg", nullptr, 0, 0 },
{ "del", nullptr, 0, 0 },
{ "delta", nullptr, 0, EQ_CASE },
{ "diamond", nullptr, 0, 0 },
{ "dim", nullptr, 0, 0 },
{ "div", nullptr, 0, 0 },
{ "divide", nullptr, 0, 0 },
{ "dline", nullptr, 0, 0 },
{ "dmatrix", nullptr, 0, EQ_ENV },
{ "dot", nullptr, 1, 0 },
{ "doteq", nullptr, 0, 0 },
{ "dotsaxis", nullptr, 0, 0 },
{ "dotsdiag", nullptr, 0, 0 },
{ "dotslow", "\\ldots", 0, 0 },
{ "dotsvert", "\\vdots", 0, 0 },
{ "downarrow", NULL, 0, EQ_CASE },
{ "downarrow", nullptr, 0, EQ_CASE },
{ "dsum", "+", 0, 0 },
{ "dyad", NULL, 0, 0 }, // LATER
{ "ell", NULL, 0, 0 },
{ "emptyset", NULL, 0, 0 },
{ "epsilon", NULL, 0, EQ_CASE },
{ "eqalign", NULL, 0, EQ_ENV },
{ "equiv", NULL, 0, 0 },
{ "eta", NULL, 0, EQ_CASE },
{ "exarrow", NULL, 0, 0 },
{ "dyad", nullptr, 0, 0 }, // LATER
{ "ell", nullptr, 0, 0 },
{ "emptyset", nullptr, 0, 0 },
{ "epsilon", nullptr, 0, EQ_CASE },
{ "eqalign", nullptr, 0, EQ_ENV },
{ "equiv", nullptr, 0, 0 },
{ "eta", nullptr, 0, EQ_CASE },
{ "exarrow", nullptr, 0, 0 },
{ "exist", "\\exists", 0, 0 },
{ "exists", NULL, 0, 0 },
{ "exp", NULL, 0, EQ_CASE },
{ "for", NULL, 0, 0 },
{ "forall", NULL, 0, 0 },
{ "exists", nullptr, 0, 0 },
{ "exp", nullptr, 0, EQ_CASE },
{ "for", nullptr, 0, 0 },
{ "forall", nullptr, 0, 0 },
{ "from", "_", 1, 0 },
{ "gamma", NULL, 0, EQ_CASE },
{ "gcd", NULL, 0, 0 },
{ "gamma", nullptr, 0, EQ_CASE },
{ "gcd", nullptr, 0, 0 },
{ "ge", "\\geq", 0, 0 },
{ "geq", NULL, 0, 0 },
{ "ggg", NULL, 0, 0 },
{ "grad", NULL, 0, 0 },
{ "grave", NULL, 1, 0 },
{ "geq", nullptr, 0, 0 },
{ "ggg", nullptr, 0, 0 },
{ "grad", nullptr, 0, 0 },
{ "grave", nullptr, 1, 0 },
{ "hat", "\\widehat", 1, 0 },
{ "hbar", NULL, 0, 0 },
{ "hom", NULL, 0, 0 },
{ "hookleft", NULL, 0, 0 },
{ "hookright", NULL, 0, 0 },
{ "identical", NULL, 0, 0 }, // LATER
{ "if", NULL, 0, 0 },
{ "imag", NULL, 0, 0 },
{ "image", NULL, 0, 0 },
{ "imath", NULL, 0, 0 },
{ "in", NULL, 0, 0 },
{ "hbar", nullptr, 0, 0 },
{ "hom", nullptr, 0, 0 },
{ "hookleft", nullptr, 0, 0 },
{ "hookright", nullptr, 0, 0 },
{ "identical", nullptr, 0, 0 }, // LATER
{ "if", nullptr, 0, 0 },
{ "imag", nullptr, 0, 0 },
{ "image", nullptr, 0, 0 },
{ "imath", nullptr, 0, 0 },
{ "in", nullptr, 0, 0 },
{ "inf", "\\infty", 0, 0 },
{ "infinity", "\\infty", 0, 0 },
{ "infty", NULL, 0, 0 },
{ "int", NULL, 0, 0 },
{ "infty", nullptr, 0, 0 },
{ "int", nullptr, 0, 0 },
{ "integral", "\\int", 0, 0 },
{ "inter", "\\bigcap", 0, 0 },
{ "iota", NULL, 0, EQ_CASE },
{ "iso", NULL, 0, 0 }, // ams
{ "it", NULL, 0, 0 },
{ "jmath", NULL, 0, 0 },
{ "kappa", NULL, 0, EQ_CASE },
{ "ker", NULL, 0, 0 },
{ "lambda", NULL, 0, EQ_CASE },
{ "land", NULL, 0, 0 }, // LATER
{ "langle", NULL, 0, 0 },
{ "iota", nullptr, 0, EQ_CASE },
{ "iso", nullptr, 0, 0 }, // ams
{ "it", nullptr, 0, 0 },
{ "jmath", nullptr, 0, 0 },
{ "kappa", nullptr, 0, EQ_CASE },
{ "ker", nullptr, 0, 0 },
{ "lambda", nullptr, 0, EQ_CASE },
{ "land", nullptr, 0, 0 }, // LATER
{ "langle", nullptr, 0, 0 },
{ "larrow", "\\leftarrow", 0, EQ_CASE },
{ "lbrace", NULL, 0, 0 },
{ "lbrace", nullptr, 0, 0 },
{ "lbrack", "[", 0, 0 },
{ "lceil", NULL, 0, 0 },
{ "lcol", NULL, 0, 0 }, // LATER
{ "ldots", NULL, 0, 0 },
{ "le", NULL, 0, 0 },
{ "left", NULL, 0, 0 },
{ "leftarrow", NULL, 0, EQ_CASE },
{ "leq", NULL, 0, 0 },
{ "lfloor", NULL, 0, 0 },
{ "lg", NULL, 0, 0 },
{ "lim", NULL, 0, EQ_CASE },
{ "lceil", nullptr, 0, 0 },
{ "lcol", nullptr, 0, 0 }, // LATER
{ "ldots", nullptr, 0, 0 },
{ "le", nullptr, 0, 0 },
{ "left", nullptr, 0, 0 },
{ "leftarrow", nullptr, 0, EQ_CASE },
{ "leq", nullptr, 0, 0 },
{ "lfloor", nullptr, 0, 0 },
{ "lg", nullptr, 0, 0 },
{ "lim", nullptr, 0, EQ_CASE },
{ "line", "\\vert", 0, 0 },
{ "liter", "\\ell", 0, 0 },
{ "lll", NULL, 0, 0 }, // ams
{ "ln", NULL, 0, 0 },
{ "log", NULL, 0, 0 },
{ "lll", nullptr, 0, 0 }, // ams
{ "ln", nullptr, 0, 0 },
{ "log", nullptr, 0, 0 },
{ "lor", "\\vee", 0, 0 },
{ "lparen", "(", 0, 0 },
{ "lpile", NULL, 0, 0 }, // LATER
{ "lpile", nullptr, 0, 0 }, // LATER
{ "lrarrow", "\\leftrightarrow", 0, EQ_CASE },
{ "lrharpoons", "\\leftrightharpoons",0, 0 },
{ "mapsto", NULL, 0, 0 },
{ "mapsto", nullptr, 0, 0 },
{ "massert", "\\dashv", 0, 0 },
{ "matrix", NULL, 0, EQ_ENV },
{ "max", NULL, 0, 0 },
{ "mho", NULL, 0, 0 }, // ams
{ "min", NULL, 0, 0 },
{ "minusplus", NULL, 0, 0 },
{ "matrix", nullptr, 0, EQ_ENV },
{ "max", nullptr, 0, 0 },
{ "mho", nullptr, 0, 0 }, // ams
{ "min", nullptr, 0, 0 },
{ "minusplus", nullptr, 0, 0 },
{ "mit", "", 0, 0 }, // font
{ "mod", "\\bmod", 0, 0 },
{ "models", NULL, 0, 0 },
{ "msangle", NULL, 0, 0 }, // LATER
{ "mu", NULL, 0, EQ_CASE },
{ "nabla", NULL, 0, 0 },
{ "ne", NULL, 0, 0 },
{ "nearrow", NULL, 0, 0 },
{ "neg", NULL, 0, 0 },
{ "neq", NULL, 0, 0 },
{ "nequiv", NULL, 0, 0 },
{ "ni", NULL, 0, 0 },
{ "not", NULL, 0, 0 },
{ "notin", NULL, 0, 0 },
{ "nu", NULL, 0, EQ_CASE },
{ "nwarrow", NULL, 0, 0 },
{ "odiv", NULL, 0, 0 },
{ "odot", NULL, 0, 0 },
{ "oint", NULL, 0, 0 },
{ "omega", NULL, 0, EQ_CASE },
{ "omicron", NULL, 0, EQ_CASE },
{ "ominus", NULL, 0, 0 },
{ "oplus", NULL, 0, 0 },
{ "or ", NULL, 0, 0 },
{ "oslash", NULL, 0, 0 },
{ "otimes", NULL, 0, 0 },
{ "over", NULL, 1, EQ_ATOP },
{ "overline", NULL, 1, 0 },
{ "models", nullptr, 0, 0 },
{ "msangle", nullptr, 0, 0 }, // LATER
{ "mu", nullptr, 0, EQ_CASE },
{ "nabla", nullptr, 0, 0 },
{ "ne", nullptr, 0, 0 },
{ "nearrow", nullptr, 0, 0 },
{ "neg", nullptr, 0, 0 },
{ "neq", nullptr, 0, 0 },
{ "nequiv", nullptr, 0, 0 },
{ "ni", nullptr, 0, 0 },
{ "not", nullptr, 0, 0 },
{ "notin", nullptr, 0, 0 },
{ "nu", nullptr, 0, EQ_CASE },
{ "nwarrow", nullptr, 0, 0 },
{ "odiv", nullptr, 0, 0 },
{ "odot", nullptr, 0, 0 },
{ "oint", nullptr, 0, 0 },
{ "omega", nullptr, 0, EQ_CASE },
{ "omicron", nullptr, 0, EQ_CASE },
{ "ominus", nullptr, 0, 0 },
{ "oplus", nullptr, 0, 0 },
{ "or ", nullptr, 0, 0 },
{ "oslash", nullptr, 0, 0 },
{ "otimes", nullptr, 0, 0 },
{ "over", nullptr, 1, EQ_ATOP },
{ "overline", nullptr, 1, 0 },
{ "owns", "\\ni", 0, 0 },
{ "parallel", NULL, 0, 0 },
{ "partial", NULL, 0, 0 },
{ "phantom", NULL, 0, 0 },
{ "phi", NULL, 0, EQ_CASE },
{ "pi", NULL, 0, EQ_CASE },
{ "pile", NULL, 0, 0 }, // LATER
{ "parallel", nullptr, 0, 0 },
{ "partial", nullptr, 0, 0 },
{ "phantom", nullptr, 0, 0 },
{ "phi", nullptr, 0, EQ_CASE },
{ "pi", nullptr, 0, EQ_CASE },
{ "pile", nullptr, 0, 0 }, // LATER
{ "plusminus", "\\pm", 0, 0 },
{ "pmatrix", NULL, 0, EQ_ENV },
{ "prec", NULL, 0, 0 },
{ "prep", NULL, 0, 0 },
{ "prime", NULL, 0, 0 },
{ "prod", NULL, 0, 0 },
{ "propto", NULL, 0, 0 },
{ "psi", NULL, 0, EQ_CASE },
{ "rangle", NULL, 0, 0 },
{ "pmatrix", nullptr, 0, EQ_ENV },
{ "prec", nullptr, 0, 0 },
{ "prep", nullptr, 0, 0 },
{ "prime", nullptr, 0, 0 },
{ "prod", nullptr, 0, 0 },
{ "propto", nullptr, 0, 0 },
{ "psi", nullptr, 0, EQ_CASE },
{ "rangle", nullptr, 0, 0 },
{ "rarrow", "\\rightarrow", 0, EQ_CASE },
{ "rbrace", "]", 0, 0 },
{ "rbrace", NULL, 0, 0 },
{ "rceil", NULL, 0, 0 },
{ "rcol", NULL, 0, 0 }, // LATER
{ "rbrace", nullptr, 0, 0 },
{ "rceil", nullptr, 0, 0 },
{ "rcol", nullptr, 0, 0 }, // LATER
{ "real", "\\Re", 0, 0 },
{ "reimage", NULL, 0, 0 },
{ "rel", NULL, 0, 0 },
{ "rfloor", NULL, 0, 0 },
{ "rho", NULL, 0, EQ_CASE },
{ "right", NULL, 0, 0 },
{ "rightarrow", NULL, 0, EQ_CASE },
{ "rlharpoons", NULL, 0, 0 },
{ "rm", NULL, 0, 0 },
{ "reimage", nullptr, 0, 0 },
{ "rel", nullptr, 0, 0 },
{ "rfloor", nullptr, 0, 0 },
{ "rho", nullptr, 0, EQ_CASE },
{ "right", nullptr, 0, 0 },
{ "rightarrow", nullptr, 0, EQ_CASE },
{ "rlharpoons", nullptr, 0, 0 },
{ "rm", nullptr, 0, 0 },
{ "root", "\\sqrt", 1, 0 },
{ "rparen", ")", 0, 0 },
{ "rpile", NULL, 0, 0 }, // LATER
{ "rtangle", NULL, 0, 0 },
{ "sangle", NULL, 0, 0 },
{ "scale", NULL, 0, 0 },
{ "searrow", NULL, 0, 0 },
{ "sec", NULL, 0, 0 },
{ "sigma", NULL, 0, EQ_CASE },
{ "sim", NULL, 0, 0 },
{ "simeq", NULL, 0, 0 },
{ "sin", NULL, 0, 0 },
{ "sinh", NULL, 0, 0 },
{ "slash", NULL, 0, 0 },
{ "smallint", NULL, 0, 0 },
{ "smallinter", NULL, 0, 0 },
{ "smalloint", NULL, 0, 0 },
{ "smallprod", NULL, 0, 0 },
{ "smallsum", NULL, 0, 0 },
{ "smallunion", NULL, 0, 0 },
{ "smcoprod", NULL, 0, 0 },
{ "sqcap", NULL, 0, 0 },
{ "sqcup", NULL, 0, 0 },
{ "sqrt", NULL, 1, 0 },
{ "sqsubset", NULL, 0, 0 },
{ "sqsubseteq", NULL, 0, 0 },
{ "sqsupset", NULL, 0, 0 },
{ "sqsupseteq", NULL, 0, 0 },
{ "star", NULL, 0, 0 },
{ "rpile", nullptr, 0, 0 }, // LATER
{ "rtangle", nullptr, 0, 0 },
{ "sangle", nullptr, 0, 0 },
{ "scale", nullptr, 0, 0 },
{ "searrow", nullptr, 0, 0 },
{ "sec", nullptr, 0, 0 },
{ "sigma", nullptr, 0, EQ_CASE },
{ "sim", nullptr, 0, 0 },
{ "simeq", nullptr, 0, 0 },
{ "sin", nullptr, 0, 0 },
{ "sinh", nullptr, 0, 0 },
{ "slash", nullptr, 0, 0 },
{ "smallint", nullptr, 0, 0 },
{ "smallinter", nullptr, 0, 0 },
{ "smalloint", nullptr, 0, 0 },
{ "smallprod", nullptr, 0, 0 },
{ "smallsum", nullptr, 0, 0 },
{ "smallunion", nullptr, 0, 0 },
{ "smcoprod", nullptr, 0, 0 },
{ "sqcap", nullptr, 0, 0 },
{ "sqcup", nullptr, 0, 0 },
{ "sqrt", nullptr, 1, 0 },
{ "sqsubset", nullptr, 0, 0 },
{ "sqsubseteq", nullptr, 0, 0 },
{ "sqsupset", nullptr, 0, 0 },
{ "sqsupseteq", nullptr, 0, 0 },
{ "star", nullptr, 0, 0 },
{ "sub", "_", 0, 0 },
{ "subset", NULL, 0, 0 },
{ "subseteq", NULL, 0, 0 },
{ "succ", NULL, 0, 0 },
{ "sum", NULL, 0, 0 },
{ "subset", nullptr, 0, 0 },
{ "subseteq", nullptr, 0, 0 },
{ "succ", nullptr, 0, 0 },
{ "sum", nullptr, 0, 0 },
{ "sup", "^", 0, 0 },
{ "superset", NULL, 0, 0 },
{ "supset", NULL, 0, 0 },
{ "supseteq", NULL, 0, 0 },
{ "swarrow", NULL, 0, 0 },
{ "tan", NULL, 0, 0 },
{ "tanh", NULL, 0, 0 },
{ "tau", NULL, 0, EQ_CASE },
{ "therefore", NULL, 0, 0 },
{ "theta", NULL, 0, EQ_CASE },
{ "superset", nullptr, 0, 0 },
{ "supset", nullptr, 0, 0 },
{ "supseteq", nullptr, 0, 0 },
{ "swarrow", nullptr, 0, 0 },
{ "tan", nullptr, 0, 0 },
{ "tanh", nullptr, 0, 0 },
{ "tau", nullptr, 0, EQ_CASE },
{ "therefore", nullptr, 0, 0 },
{ "theta", nullptr, 0, EQ_CASE },
{ "tilde", "\\widetilde", 1, 0 },
{ "times", NULL, 0, 0 },
{ "times", nullptr, 0, 0 },
{ "to", "^", 1, 0 },
{ "top", NULL, 0, 0 },
{ "triangle", NULL, 0, 0 },
{ "triangled", NULL, 0, 0 },
{ "trianglel", NULL, 0, 0 },
{ "triangler", NULL, 0, 0 },
{ "triangleu", NULL, 0, 0 },
{ "top", nullptr, 0, 0 },
{ "triangle", nullptr, 0, 0 },
{ "triangled", nullptr, 0, 0 },
{ "trianglel", nullptr, 0, 0 },
{ "triangler", nullptr, 0, 0 },
{ "triangleu", nullptr, 0, 0 },
{ "udarrow", "\\updownarrow",0, EQ_CASE },
{ "under", "\\underline", 1, 0 },
{ "underline", "\\underline", 1, 0 },
{ "union", "\\bigcup", 0, 0 },
{ "uparrow", NULL, 0, EQ_CASE },
{ "uplus", NULL, 0, 0 },
{ "upsilon", NULL, 0, EQ_CASE },
{ "varepsilon", NULL, 0, 0 },
{ "varphi", NULL, 0, 0 },
{ "varpi", NULL, 0, 0 },
{ "varrho", NULL, 0, 0 },
{ "varsigma", NULL, 0, 0 },
{ "vartheta", NULL, 0, 0 },
{ "varupsilon", NULL, 0, 0 },
{ "vdash", NULL, 0, 0 },
{ "vdots", NULL, 0, 0 },
{ "vec", NULL, 1, 0 },
{ "vee", NULL, 0, 0 },
{ "vert", NULL, 0, 0 },
{ "wedge", NULL, 0, 0 },
{ "wp", NULL, 0, 0 },
{ "xi", NULL, 0, EQ_CASE },
{ "xor", NULL, 0, 0 },
{ "zeta", NULL, 0, EQ_CASE }
{ "uparrow", nullptr, 0, EQ_CASE },
{ "uplus", nullptr, 0, 0 },
{ "upsilon", nullptr, 0, EQ_CASE },
{ "varepsilon", nullptr, 0, 0 },
{ "varphi", nullptr, 0, 0 },
{ "varpi", nullptr, 0, 0 },
{ "varrho", nullptr, 0, 0 },
{ "varsigma", nullptr, 0, 0 },
{ "vartheta", nullptr, 0, 0 },
{ "varupsilon", nullptr, 0, 0 },
{ "vdash", nullptr, 0, 0 },
{ "vdots", nullptr, 0, 0 },
{ "vec", nullptr, 1, 0 },
{ "vee", nullptr, 0, 0 },
{ "vert", nullptr, 0, 0 },
{ "wedge", nullptr, 0, 0 },
{ "wp", nullptr, 0, 0 },
{ "xi", nullptr, 0, EQ_CASE },
{ "xor", nullptr, 0, 0 },
{ "zeta", nullptr, 0, EQ_CASE }
};
static const hwpeq *lookup_eqn(char *str)
{
static const int eqCount = SAL_N_ELEMENTS(eq_tbl);
int l = 0, r = eqCount;
const hwpeq *result = 0;
const hwpeq *result = nullptr;
while( l < r ) {
const int m = (l + r) / 2;
@ -449,14 +449,14 @@ struct eq_stack {
MzString token;
istream *strm;
eq_stack() { strm = 0; };
eq_stack() { strm = nullptr; };
bool state(istream *s) {
if( strm != s) { white = 0; token = 0; }
if( strm != s) { white = nullptr; token = nullptr; }
return token.length() != 0;
}
};
static eq_stack *stk = 0;
static eq_stack *stk = nullptr;
void push_token(MzString &white, MzString &token, istream *strm)
{
@ -480,13 +480,13 @@ static int next_token(MzString &white, MzString &token, istream *strm)
if( stk->state(strm) ) {
white = stk->white;
token = stk->token;
stk->token = 0;
stk->white = 0;
stk->token = nullptr;
stk->white = nullptr;
return token.length();
}
token = 0;
white = 0;
token = nullptr;
white = nullptr;
if( !strm->good() || (ch = strm->get()) == EOF )
return 0;
@ -545,7 +545,7 @@ static int read_white_space(MzString& outs, istream *strm)
if( stk->state(strm) ) {
outs << stk->white;
stk->white = 0;
stk->white = nullptr;
result = stk->token[0];
}
else {
@ -611,7 +611,7 @@ static int eq_word(MzString& outs, istream *strm, int status)
else
script_status = SCRIPT_NONE;
if( 0 != (eq = lookup_eqn(keyword)) ) {
if( nullptr != (eq = lookup_eqn(keyword)) ) {
int nargs = eq->nargs;
while( nargs-- ) {
const int ch = read_white_space(state, strm);
@ -662,7 +662,7 @@ static bool eq_sentence(MzString& outs, istream *strm, const char *end)
multiline = true;
outs << state;
}
state = 0;
state = nullptr;
read_white_space(outs, strm);
}
outs << state;
@ -679,8 +679,8 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
if( sentinel && (result == 1) && strchr(sentinel, token[0]) )
break;
make_keyword(key, token);
const hwpeq *eq = 0;
if( (eq = lookup_eqn(key)) != 0 ) {
const hwpeq *eq = nullptr;
if( (eq = lookup_eqn(key)) != nullptr ) {
if( eq->latex )
strcpy(key, eq->latex);
else {
@ -734,7 +734,7 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
void eq2latex(MzString& outs, char *s)
{
assert(s);
if( stk == 0 )
if( stk == nullptr )
stk = new eq_stack;
MzString tstr;
@ -745,12 +745,12 @@ void eq2latex(MzString& outs, char *s)
if( eqnarray )
outs << "\\begin{array}{rllll}" << ENDL;
eq2ltxconv(outs, &strm, 0);
eq2ltxconv(outs, &strm, nullptr);
outs << ENDL;
if( eqnarray )
outs << "\\end{array}" << ENDL;
delete stk;
stk = 0;
stk = nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -36,7 +36,7 @@
#include <osl/diagnose.h>
HWPFile *HWPFile::cur_doc = 0;
HWPFile *HWPFile::cur_doc = nullptr;
static int ccount = 0;
static int pcount = 0;
static int datecodecount = 0;
@ -48,10 +48,10 @@ HWPFile::HWPFile()
, linenumber(0)
, info_block_len(0)
, error_code(HWP_NoError)
, oledata(0)
, oledata(nullptr)
, m_nCurrentPage(1)
, m_nMaxSettedPage(0)
, hiodev(0)
, hiodev(nullptr)
, currenthyper(0)
{
SetCurrentDoc(this);
@ -387,7 +387,7 @@ ColumnDef *HWPFile::GetColumnDef(int num)
if( it != columnlist.end() )
return (*it)->coldef;
else
return 0;
return nullptr;
}
/* Index of @return starts from 1 */
int HWPFile::GetPageMasterNum(int page)
@ -413,7 +413,7 @@ HyperText *HWPFile::GetHyperText()
}
currenthyper++;
return it != hyperlist.end() ? *it : NULL;
return it != hyperlist.end() ? *it : nullptr;
}
EmPicture *HWPFile::GetEmPicture(Picture * pic)
@ -428,7 +428,7 @@ EmPicture *HWPFile::GetEmPicture(Picture * pic)
for (; it != emblist.end(); ++it)
if (strcmp(name, (*it)->name) == 0)
return *it;
return 0;
return nullptr;
}
EmPicture *HWPFile::GetEmPictureByName(char * name)
@ -441,7 +441,7 @@ EmPicture *HWPFile::GetEmPictureByName(char * name)
for (; it != emblist.end(); ++it)
if (strcmp(name, (*it)->name) == 0)
return *it;
return 0;
return nullptr;
}
@ -455,7 +455,7 @@ void HWPFile::AddBox(FBox * box)
box->prev->next = box;
}
else
box->prev = 0;
box->prev = nullptr;
blist.push_back(box);
}
@ -469,7 +469,7 @@ ParaShape *HWPFile::getParaShape(int index)
break;
}
return it != pslist.end() ? *it : NULL;
return it != pslist.end() ? *it : nullptr;
}
@ -482,7 +482,7 @@ CharShape *HWPFile::getCharShape(int index)
break;
}
return it != cslist.end() ? *it : 0;
return it != cslist.end() ? *it : nullptr;
}
@ -495,7 +495,7 @@ FBoxStyle *HWPFile::getFBoxStyle(int index)
break;
}
return it != fbslist.end() ? *it : 0;
return it != fbslist.end() ? *it : nullptr;
}
DateCode *HWPFile::getDateCode(int index)
@ -507,7 +507,7 @@ DateCode *HWPFile::getDateCode(int index)
break;
}
return it != datecodes.end() ? *it : NULL;
return it != datecodes.end() ? *it : nullptr;
}
HeaderFooter *HWPFile::getHeaderFooter(int index)
@ -519,7 +519,7 @@ HeaderFooter *HWPFile::getHeaderFooter(int index)
break;
}
return it != headerfooters.end() ? *it : NULL;
return it != headerfooters.end() ? *it : nullptr;
}
ShowPageNum *HWPFile::getPageNumber(int index)
@ -531,7 +531,7 @@ ShowPageNum *HWPFile::getPageNumber(int index)
break;
}
return it != pagenumbers.end() ? *it : NULL;
return it != pagenumbers.end() ? *it : nullptr;
}
@ -544,7 +544,7 @@ Table *HWPFile::getTable(int index)
break;
}
return it != tables.end() ? *it : NULL;
return it != tables.end() ? *it : nullptr;
}
void HWPFile::AddParaShape(ParaShape * pshape)

View File

@ -73,7 +73,7 @@ struct ColumnInfo{
ColumnInfo(int num){
start_page = num;
bIsSet = false;
coldef = 0;
coldef = NULL;
}
};

View File

@ -359,7 +359,7 @@ bool TxtBox::Read(HWPFile & hwpf)
delete[] pArr;
}
else
m_pTable = 0L;
m_pTable = nullptr;
return !hwpf.State();
}
@ -443,7 +443,7 @@ bool Picture::Read(HWPFile & hwpf)
style.cell = picinfo.picdraw.hdo;
delete hmem;
hmem = 0;
hmem = nullptr;
}
else
{

View File

@ -73,7 +73,7 @@
rendEl("text:span"); \
tstart = false
static hchar *field = 0L;
static hchar *field = nullptr;
static char buf[1024];
namespace
@ -98,7 +98,7 @@ struct HwpReaderPrivate
bInBody = false;
bInHeader = false;
nPnPos = 0;
pPn = 0L;
pPn = nullptr;
}
bool bFirstPara;
@ -118,7 +118,7 @@ HwpReader::HwpReader()
HwpReader::~HwpReader()
{
rList = 0;
rList = nullptr;
delete d;
}
@ -523,7 +523,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
}
else
{
EmPicture *emp = 0L;
EmPicture *emp = nullptr;
if ( strlen( prop->szPatternFile ) > 3)
emp = hwpfile.GetEmPictureByName(prop->szPatternFile);
if( emp )
@ -933,13 +933,13 @@ struct PageSetting
{
PageSetting()
{
header = 0L;
header_odd = 0L;
header_even = 0L;
footer = 0L;
footer_odd = 0L;
footer_even = 0L;
pagenumber=0L;
header = nullptr;
header_odd = nullptr;
header_even = nullptr;
footer = nullptr;
footer_odd = nullptr;
footer_even = nullptr;
pagenumber=nullptr;
bIsSet = false;
}
HeaderFooter *header ;
@ -976,8 +976,8 @@ void HwpReader::makeMasterStyles()
{
case 0 :
pSet[hf->m_nPageNumber].header = hf;
pSet[hf->m_nPageNumber].header_even = 0L;
pSet[hf->m_nPageNumber].header_odd = 0L;
pSet[hf->m_nPageNumber].header_even = nullptr;
pSet[hf->m_nPageNumber].header_odd = nullptr;
break;
case 1:
pSet[hf->m_nPageNumber].header_even = hf;
@ -985,7 +985,7 @@ void HwpReader::makeMasterStyles()
{
pSet[hf->m_nPageNumber].header_odd =
pSet[hf->m_nPageNumber].header;
pSet[hf->m_nPageNumber].header = 0L;
pSet[hf->m_nPageNumber].header = nullptr;
}
break;
case 2:
@ -994,7 +994,7 @@ void HwpReader::makeMasterStyles()
{
pSet[hf->m_nPageNumber].header_even =
pSet[hf->m_nPageNumber].header;
pSet[hf->m_nPageNumber].header = 0L;
pSet[hf->m_nPageNumber].header = nullptr;
}
break;
}
@ -1005,8 +1005,8 @@ void HwpReader::makeMasterStyles()
{
case 0 :
pSet[hf->m_nPageNumber].footer = hf;
pSet[hf->m_nPageNumber].footer_even = 0L;
pSet[hf->m_nPageNumber].footer_odd = 0L;
pSet[hf->m_nPageNumber].footer_even = nullptr;
pSet[hf->m_nPageNumber].footer_odd = nullptr;
break;
case 1:
pSet[hf->m_nPageNumber].footer_even = hf;
@ -1014,7 +1014,7 @@ void HwpReader::makeMasterStyles()
{
pSet[hf->m_nPageNumber].footer_odd =
pSet[hf->m_nPageNumber].footer;
pSet[hf->m_nPageNumber].footer = 0L;
pSet[hf->m_nPageNumber].footer = nullptr;
}
break;
case 2:
@ -1023,15 +1023,15 @@ void HwpReader::makeMasterStyles()
{
pSet[hf->m_nPageNumber].footer_even =
pSet[hf->m_nPageNumber].footer;
pSet[hf->m_nPageNumber].footer = 0L;
pSet[hf->m_nPageNumber].footer = nullptr;
}
break;
}
}
}
PageSetting *pPrevSet = 0L;
PageSetting *pPage = 0L;
PageSetting *pPrevSet = nullptr;
PageSetting *pPage = nullptr;
for( i = 1; i <= nMax ; i++ )
{
@ -1062,13 +1062,13 @@ void HwpReader::makeMasterStyles()
{
pSet[i].header_even = pSet[i].header;
pSet[i].header_odd = pSet[i].header;
pSet[i].header = 0L;
pSet[i].header = nullptr;
}
if( pSet[i].pagenumber->where == 8 && pSet[i].footer )
{
pSet[i].footer_even = pSet[i].footer;
pSet[i].footer_odd = pSet[i].footer;
pSet[i].footer = 0L;
pSet[i].footer = nullptr;
}
}
@ -1127,7 +1127,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->header->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
rendEl("style:header");
}
if( pPage->header_even )
@ -1142,7 +1142,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->header_even->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
rendEl("style:header");
}
@ -1159,7 +1159,7 @@ void HwpReader::makeMasterStyles()
d->pPn = pPage->pagenumber;
d->nPnPos = 3;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
}
rendEl("text:p");
@ -1177,7 +1177,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->header_odd->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
rendEl("style:header-left");
}
@ -1194,7 +1194,7 @@ void HwpReader::makeMasterStyles()
d->pPn = pPage->pagenumber;
d->nPnPos = 1;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
}
rendEl("text:p");
@ -1211,7 +1211,7 @@ void HwpReader::makeMasterStyles()
{
d->pPn = pPage->pagenumber;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
}
rendEl("text:p");
rendEl("style:header");
@ -1228,7 +1228,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->footer->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
rendEl("style:footer");
}
if( pPage->footer_even )
@ -1243,7 +1243,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->footer_even->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
rendEl("style:footer");
}
@ -1260,7 +1260,7 @@ void HwpReader::makeMasterStyles()
d->pPn = pPage->pagenumber;
d->nPnPos = 3;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
}
rendEl("text:p");
@ -1278,7 +1278,7 @@ void HwpReader::makeMasterStyles()
}
parsePara(pPage->footer_odd->plist.front());
d->bInHeader = false;
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
rendEl("style:footer-left");
}
@ -1295,7 +1295,7 @@ void HwpReader::makeMasterStyles()
d->pPn = pPage->pagenumber;
d->nPnPos = 1;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
d->nPnPos = 0;
}
rendEl("text:p");
@ -1312,7 +1312,7 @@ void HwpReader::makeMasterStyles()
{
d->pPn = pPage->pagenumber;
makeShowPageNum();
d->pPn = 0L;
d->pPn = nullptr;
}
rendEl("text:p");
rendEl("style:footer");
@ -2959,7 +2959,7 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart)
if( hbox->type[0] == 4 && hbox->type[1] == 0 )
{
makeFieldCode(str, hbox);
field = 0L;
field = nullptr;
}
infield = false;
str.clear();
@ -3663,7 +3663,7 @@ void HwpReader::makeFormula(TxtBox * hbox)
{
char mybuf[3000];
HWPPara* pPar;
CharShape *cshape = 0;
CharShape *cshape = nullptr;
int n, c, res;
hchar dest[3];
@ -4360,11 +4360,11 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
double *yarr = new double[n+1];
double *tarr = new double[n+1];
double *xb = 0L;
double *yb = 0L;
double *xb = nullptr;
double *yb = nullptr;
double *carr = 0L;
double *darr = 0L;
double *carr = nullptr;
double *darr = nullptr;
for( i = 0 ; i < n ; i++ ){
@ -4380,18 +4380,18 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox)
PeriodicSpline(n, tarr, xarr, xb, carr, darr);
// prevent memory leak
delete[] carr;
carr = 0;
carr = nullptr;
delete[] darr;
darr = 0;
darr = nullptr;
PeriodicSpline(n, tarr, yarr, yb, carr, darr);
}
else{
NaturalSpline(n, tarr, xarr, xb, carr, darr);
// prevent memory leak
delete[] carr;
carr = 0;
carr = nullptr;
delete[] darr;
darr = 0;
darr = nullptr;
NaturalSpline(n, tarr, yarr, yb, carr, darr);
}

View File

@ -296,7 +296,7 @@ extern "C"
{
SAL_DLLPUBLIC_EXPORT void * SAL_CALL hwp_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * )
{
void * pRet = 0;
void * pRet = nullptr;
if (pServiceManager )
{

View File

@ -185,7 +185,7 @@ struct yy_buffer_state
#define YY_BUFFER_EOF_PENDING 2
};
static YY_BUFFER_STATE yy_current_buffer = 0;
static YY_BUFFER_STATE yy_current_buffer = nullptr;
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
@ -1595,7 +1595,7 @@ static int yy_get_next_buffer()
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
b->yy_ch_buf = nullptr;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@ -1898,7 +1898,7 @@ yy_size_t size;
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
return nullptr;
b = static_cast<YY_BUFFER_STATE>(yy_flex_alloc( sizeof( struct yy_buffer_state ) ));
if ( ! b )
@ -1907,7 +1907,7 @@ yy_size_t size;
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_input_file = nullptr;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = false;
b->yy_at_bol = 1;

View File

@ -54,7 +54,7 @@ MzString::MzString()
{
Length = 0;
Allocated = 0;
Data = 0;
Data = nullptr;
}
@ -79,7 +79,7 @@ MzString &MzString::operator = (MzString &s)
MzString &MzString::operator = (const char *s)
{
if (s == NULL)
if (s == nullptr)
s = "";
int n = strlen(s);
if (allocate(n))
@ -122,7 +122,7 @@ void MzString::append(const char *s)
int MzString::compare(const char *s)
{
if (!Data) return -1;
if (s==NULL) return 1;
if (s==nullptr) return 1;
Data[Length] = 0;
return strcmp(Data, s);

View File

@ -64,9 +64,9 @@ class Node{
public:
Node(int _id) : id(_id)
{
value = 0L;
child = 0L;
next = 0L;
value = NULL;
child = NULL;
next = NULL;
#ifdef NODE_DEBUG
count++;
printf("Node count : [%d]\n",count);
@ -77,8 +77,8 @@ public:
if( value ) free( value );
// if( child ) delete child;
// if( next ) delete next;
next = 0L;
child = 0L;
next = NULL;
child = NULL;
#ifdef NODE_DEBUG
count--;
printf("Node count : [%d]\n",count);

View File

@ -25,7 +25,7 @@ double** mgcLinearSystemD::NewMatrix (int N)
{
double** A = new double*[N];
if ( !A )
return 0;
return nullptr;
for (int row = 0; row < N; row++)
{
@ -35,7 +35,7 @@ double** mgcLinearSystemD::NewMatrix (int N)
for (int i = 0; i < row; i++)
delete[] A[i];
delete[] A;
return 0;
return nullptr;
}
for (int col = 0; col < N; col++)
A[row][col] = 0;
@ -54,7 +54,7 @@ double* mgcLinearSystemD::NewVector (int N)
{
double* B = new double[N];
if ( !B )
return 0;
return nullptr;
for (int row = 0; row < N; row++)
B[row] = 0;