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

clang-cl loplugin: hwpfilter

Change-Id: I63677cea6ee2cec0589bd853ca9b135931df63d4
Reviewed-on: https://gerrit.libreoffice.org/29863Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 1a98de0e
......@@ -1377,7 +1377,7 @@ char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar)
}
}
}
for (unsigned int i = 0; i < strlen(src); i++)
for (size_t i = 0; i < strlen(src); i++)
{
if (src[i] == '\\') {
ret.push_back('/');
......
......@@ -120,7 +120,7 @@ void OlePicture::Read(HWPFile & hwpf)
char tname[200];
wchar_t wtname[200];
tmpnam(tname);
if (0 == (fp = fopen(tname, "wb")))
if (nullptr == (fp = fopen(tname, "wb")))
{
delete [] data;
return;
......@@ -129,10 +129,10 @@ void OlePicture::Read(HWPFile & hwpf)
delete [] data;
fclose(fp);
MultiByteToWideChar(CP_ACP, 0, tname, -1, wtname, 200);
if( StgOpenStorage(wtname, NULL,
if( StgOpenStorage(wtname, nullptr,
STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_TRANSACTED,
NULL, 0, &pis) != S_OK ) {
pis = 0;
nullptr, 0, &pis) != S_OK ) {
pis = nullptr;
unlink(tname);
return;
}
......
......@@ -1721,7 +1721,7 @@ void HwpReader::makePageStyle()
if( hwpinfo.back_info.type == 1 ){
#ifdef _WIN32
padd("xlink:href", sXML_CDATA,
reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr((uchar*) urltowin(hwpinfo.back_info.filename).c_str()).c_str())));
reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltowin(hwpinfo.back_info.filename).c_str())).c_str())));
#else
padd("xlink:href", sXML_CDATA,
reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(hwpinfo.back_info.filename).c_str())).c_str())));
......@@ -3732,7 +3732,7 @@ void HwpReader::makeHyperText(TxtBox * hbox)
::std::string const tmp = hstr2ksstr(hypert->bookmark);
::std::string const tmp2 = hstr2ksstr(kstr2hstr(
#ifdef _WIN32
(uchar *) urltowin((char *)hypert->filename).c_str()).c_str());
reinterpret_cast<uchar const *>(urltowin(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str());
#else
reinterpret_cast<uchar const *>(urltounix(reinterpret_cast<char *>(hypert->filename)).c_str())).c_str());
#endif
......@@ -3891,7 +3891,7 @@ void HwpReader::makePicture(Picture * hbox)
if ( hbox->pictype == PICTYPE_FILE ){
#ifdef _WIN32
sprintf(buf, "file:///%s", hbox->picinfo.picun.path );
padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr((uchar *) buf).c_str())));
padd("xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar *>(buf)).c_str())));
#else
padd("xlink:href", sXML_CDATA,
reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr(reinterpret_cast<uchar const *>(urltounix(hbox->picinfo.picun.path).c_str())).c_str())));
......@@ -3926,19 +3926,19 @@ void HwpReader::makePicture(Picture * hbox)
wchar_t pathname[200];
MultiByteToWideChar(CP_ACP, 0, hbox->picinfo.picole.embname, -1, pathname, 200);
int rc = hwpfile.oledata->pis->OpenStorage(pathname, 0,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, NULL, 0, &srcsto);
int rc = hwpfile.oledata->pis->OpenStorage(pathname, nullptr,
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_TRANSACTED, nullptr, 0, &srcsto);
if (rc != S_OK) {
rchars("");
}
else{
rc = OleLoad(srcsto, IID_IUnknown, NULL, (LPVOID*)&pObj);
rc = OleLoad(srcsto, IID_IUnknown, nullptr, reinterpret_cast<LPVOID*>(&pObj));
if( rc != S_OK ){
srcsto->Release();
rchars("");
}
else{
std::shared_ptr<char> pStr(base64_encode_string( (uchar *)pObj, strlen((char *)pObj)), Free<char>());
std::shared_ptr<char> pStr(base64_encode_string( reinterpret_cast<uchar *>(pObj), strlen(reinterpret_cast<char *>(pObj))), Free<char>());
rchars(ascii(pStr.get()));
pObj->Release();
srcsto->Release();
......
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