Kaydet (Commit) 552efce6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some more loplugin:cstylecast: hwpfilter

Change-Id: I0ba3fe95ab6ef317166b286531a718287308f62f
üst b7c27fef
...@@ -660,10 +660,10 @@ yynewstate: ...@@ -660,10 +660,10 @@ yynewstate:
yyfree_stacks = 1; yyfree_stacks = 1;
#endif #endif
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss, (char *)yyss1, __yy_memcpy (yyss, yyss1,
size * (unsigned int) sizeof (*yyssp)); size * (unsigned int) sizeof (*yyssp));
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs, (char *)yyvs1, __yy_memcpy (yyvs, yyvs1,
size * (unsigned int) sizeof (*yyvsp)); size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED #ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
......
...@@ -247,7 +247,7 @@ int HStreamIODev::skipBlock(int size) ...@@ -247,7 +247,7 @@ int HStreamIODev::skipBlock(int size)
HMemIODev::HMemIODev(char *s, int len) HMemIODev::HMemIODev(char *s, int len)
{ {
init(); init();
ptr = (uchar *) s; ptr = reinterpret_cast<uchar *>(s);
length = len; length = len;
} }
......
...@@ -432,7 +432,7 @@ bool Picture::Read(HWPFile & hwpf) ...@@ -432,7 +432,7 @@ bool Picture::Read(HWPFile & hwpf)
hwpf.Read1b(follow, follow_block_size); hwpf.Read1b(follow, follow_block_size);
if (pictype == PICTYPE_DRAW) if (pictype == PICTYPE_DRAW)
{ {
hmem = new HMemIODev((char *) follow, follow_block_size); hmem = new HMemIODev(reinterpret_cast<char *>(follow), follow_block_size);
LoadDrawingObjectBlock(this); LoadDrawingObjectBlock(this);
style.cell = picinfo.picdraw.hdo; style.cell = picinfo.picdraw.hdo;
delete hmem; delete hmem;
......
...@@ -140,7 +140,7 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor) throw(R ...@@ -140,7 +140,7 @@ sal_Bool HwpReader::filter(const Sequence< PropertyValue >& rDescriptor) throw(R
nRead = xInputStream->readBytes(aBuffer, nBlock); nRead = xInputStream->readBytes(aBuffer, nBlock);
if( nRead == 0 ) if( nRead == 0 )
break; break;
stream->addData( (const byte *)aBuffer.getConstArray(), nRead ); stream->addData( reinterpret_cast<const byte *>(aBuffer.getConstArray()), nRead );
nTotal += nRead; nTotal += nRead;
} }
...@@ -500,7 +500,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) ...@@ -500,7 +500,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
if( !prop->pictype ) if( !prop->pictype )
{ {
padd( "xlink:href", sXML_CDATA, padd( "xlink:href", sXML_CDATA,
hconv(kstr2hstr( (uchar *)urltounix(prop->szPatternFile).c_str()).c_str())); hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str()));
} }
else else
{ {
...@@ -543,7 +543,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) ...@@ -543,7 +543,7 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo )
else else
{ {
padd( "xlink:href", sXML_CDATA, padd( "xlink:href", sXML_CDATA,
hconv(kstr2hstr( (uchar *)urltounix(prop->szPatternFile).c_str()).c_str())); hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str()));
} }
} }
...@@ -723,7 +723,7 @@ void HwpReader::makeStyles() ...@@ -723,7 +723,7 @@ void HwpReader::makeStyles()
for (int ii = 0; ii < hwpstyle.Num(); ii++) for (int ii = 0; ii < hwpstyle.Num(); ii++)
{ {
unsigned char *stylename = (unsigned char *) hwpstyle.GetName(ii); unsigned char *stylename = reinterpret_cast<unsigned char *>(hwpstyle.GetName(ii));
padd("style:name", sXML_CDATA, (hconv(kstr2hstr(stylename).c_str()))); padd("style:name", sXML_CDATA, (hconv(kstr2hstr(stylename).c_str())));
padd("style:family", sXML_CDATA, "paragraph"); padd("style:family", sXML_CDATA, "paragraph");
padd("style:parent-style-name", sXML_CDATA, "Standard"); padd("style:parent-style-name", sXML_CDATA, "Standard");
...@@ -1323,7 +1323,7 @@ void HwpReader::parseCharShape(CharShape * cshape) ...@@ -1323,7 +1323,7 @@ void HwpReader::parseCharShape(CharShape * cshape)
ascii(Int2Str(cshape->size / 25, "%dpt", buf))); ascii(Int2Str(cshape->size / 25, "%dpt", buf)));
::std::string const tmp = hstr2ksstr(kstr2hstr( ::std::string const tmp = hstr2ksstr(kstr2hstr(
(unsigned char *) hwpfont.GetFontName(0, cshape->font[0])).c_str()); reinterpret_cast<unsigned char const *>(hwpfont.GetFontName(0, cshape->font[0]))).c_str());
double fRatio = 1.0; double fRatio = 1.0;
int size = getRepFamilyName(tmp.c_str(), buf, fRatio); int size = getRepFamilyName(tmp.c_str(), buf, fRatio);
...@@ -1709,7 +1709,7 @@ void HwpReader::makePageStyle() ...@@ -1709,7 +1709,7 @@ void HwpReader::makePageStyle()
hconv(kstr2hstr((uchar*) urltowin(hwpinfo.back_info.filename).c_str()).c_str())); hconv(kstr2hstr((uchar*) urltowin(hwpinfo.back_info.filename).c_str()).c_str()));
#else #else
padd("xlink:href", sXML_CDATA, padd("xlink:href", sXML_CDATA,
hconv(kstr2hstr( (uchar *)urltounix(hwpinfo.back_info.filename).c_str()).c_str())); hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(hwpinfo.back_info.filename).c_str())).c_str()));
#endif #endif
padd("xlink:type", sXML_CDATA, "simple"); padd("xlink:type", sXML_CDATA, "simple");
padd("xlink:actuate", sXML_CDATA, "onLoad"); padd("xlink:actuate", sXML_CDATA, "onLoad");
...@@ -1725,7 +1725,7 @@ void HwpReader::makePageStyle() ...@@ -1725,7 +1725,7 @@ void HwpReader::makePageStyle()
if( hwpinfo.back_info.type == 2 ){ if( hwpinfo.back_info.type == 2 ){
rstartEl("office:binary-data", rList); rstartEl("office:binary-data", rList);
pList->clear(); pList->clear();
boost::shared_ptr<char> pStr(base64_encode_string((unsigned char *) hwpinfo.back_info.data, hwpinfo.back_info.size ), Free<char>()); boost::shared_ptr<char> pStr(base64_encode_string(reinterpret_cast<unsigned char *>(hwpinfo.back_info.data), hwpinfo.back_info.size ), Free<char>());
rchars(ascii(pStr.get())); rchars(ascii(pStr.get()));
rendEl("office:binary-data"); rendEl("office:binary-data");
} }
...@@ -3703,13 +3703,13 @@ void HwpReader::makeHyperText(TxtBox * hbox) ...@@ -3703,13 +3703,13 @@ void HwpReader::makeHyperText(TxtBox * hbox)
HyperText *hypert = hwpfile.GetHyperText(); HyperText *hypert = hwpfile.GetHyperText();
if( !hypert ) return; if( !hypert ) return;
if( strlen((char *)hypert->filename) > 0 ){ if( strlen(reinterpret_cast<char *>(hypert->filename)) > 0 ){
::std::string const tmp = hstr2ksstr(hypert->bookmark); ::std::string const tmp = hstr2ksstr(hypert->bookmark);
::std::string const tmp2 = hstr2ksstr(kstr2hstr( ::std::string const tmp2 = hstr2ksstr(kstr2hstr(
#ifdef _WIN32 #ifdef _WIN32
(uchar *) urltowin((char *)hypert->filename).c_str()).c_str()); (uchar *) urltowin((char *)hypert->filename).c_str()).c_str());
#else #else
(uchar *) urltounix((char *)hypert->filename).c_str()).c_str()); reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str());
#endif #endif
padd("xlink:type", sXML_CDATA, "simple"); padd("xlink:type", sXML_CDATA, "simple");
if (tmp.size() > 0 && strcmp(tmp.c_str(), "[HTML]")) { if (tmp.size() > 0 && strcmp(tmp.c_str(), "[HTML]")) {
...@@ -3811,10 +3811,10 @@ void HwpReader::makePicture(Picture * hbox) ...@@ -3811,10 +3811,10 @@ void HwpReader::makePicture(Picture * hbox)
#else #else
if( hbox->follow[4] != 0 ) if( hbox->follow[4] != 0 )
padd("xlink:href", sXML_CDATA, padd("xlink:href", sXML_CDATA,
(hconv(kstr2hstr((uchar *)urltounix((char *)(hbox->follow + 4)).c_str()).c_str()))); (hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hbox->follow + 4)).c_str())).c_str())));
else else
padd("xlink:href", sXML_CDATA, padd("xlink:href", sXML_CDATA,
(hconv(kstr2hstr((uchar *)urltounix((char *)(hbox->follow + 5)).c_str()).c_str()))); (hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hbox->follow + 5)).c_str())).c_str())));
#endif #endif
rstartEl("draw:a", rList); rstartEl("draw:a", rList);
pList->clear(); pList->clear();
...@@ -3869,7 +3869,7 @@ void HwpReader::makePicture(Picture * hbox) ...@@ -3869,7 +3869,7 @@ void HwpReader::makePicture(Picture * hbox)
padd("xlink:href", sXML_CDATA, (hconv(kstr2hstr((uchar *) buf).c_str()))); padd("xlink:href", sXML_CDATA, (hconv(kstr2hstr((uchar *) buf).c_str())));
#else #else
padd("xlink:href", sXML_CDATA, padd("xlink:href", sXML_CDATA,
(hconv(kstr2hstr((uchar *) urltounix(hbox->picinfo.picun.path).c_str()).c_str()))); (hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(hbox->picinfo.picun.path).c_str())).c_str())));
#endif #endif
padd("xlink:type", sXML_CDATA, "simple"); padd("xlink:type", sXML_CDATA, "simple");
padd("xlink:show", sXML_CDATA, "embed"); padd("xlink:show", sXML_CDATA, "embed");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment