зеркало из https://github.com/mozilla/gecko-dev.git
r=pedemont, sr=blizzard (platform specific) OS/2 only - don't close a file that didn't get created
This commit is contained in:
Родитель
cc1f8a6341
Коммит
bf6483c50f
|
@ -281,7 +281,7 @@ void ConvertColorBitMap(PBYTE buffer, PBITMAPINFO2 pBitMapInfo, nsCString& iconB
|
||||||
{
|
{
|
||||||
iIter = pBitMapInfo->cx; // Bytes = Pels
|
iIter = pBitMapInfo->cx; // Bytes = Pels
|
||||||
}
|
}
|
||||||
for (INT j = 0; j < pBitMapInfo->cy; j++) //Number of rows
|
for (ULONG j = 0; j < pBitMapInfo->cy; j++) //Number of rows
|
||||||
{
|
{
|
||||||
pPelPair = buffer;
|
pPelPair = buffer;
|
||||||
pPel = (PBYTE)buffer;
|
pPel = (PBYTE)buffer;
|
||||||
|
@ -302,7 +302,7 @@ void ConvertColorBitMap(PBYTE buffer, PBITMAPINFO2 pBitMapInfo, nsCString& iconB
|
||||||
}
|
}
|
||||||
if (numBytesPaddingPerRowRGB)
|
if (numBytesPaddingPerRowRGB)
|
||||||
{
|
{
|
||||||
for (INT k = 0; k < numBytesPaddingPerRowRGB; k++)
|
for (PRUint32 k = 0; k < numBytesPaddingPerRowRGB; k++)
|
||||||
{
|
{
|
||||||
iconBuffer.Append((char) 0);
|
iconBuffer.Append((char) 0);
|
||||||
}
|
}
|
||||||
|
@ -483,11 +483,13 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool nonBloc
|
||||||
strcpy(tmpfile, tmpdir);
|
strcpy(tmpfile, tmpdir);
|
||||||
strcat(tmpfile, pszFileName);
|
strcat(tmpfile, pszFileName);
|
||||||
FILE* fp = fopen(tmpfile, "wb+");
|
FILE* fp = fopen(tmpfile, "wb+");
|
||||||
|
if (fp) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
hIcon = WinLoadFileIcon(tmpfile, FALSE);
|
hIcon = WinLoadFileIcon(tmpfile, FALSE);
|
||||||
remove(tmpfile);
|
remove(tmpfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (hIcon == NULLHANDLE)
|
if (hIcon == NULLHANDLE)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
// we got a handle to an icon. Now we want to get a bitmap for the icon using GetIconInfo....
|
// we got a handle to an icon. Now we want to get a bitmap for the icon using GetIconInfo....
|
||||||
|
|
Загрузка…
Ссылка в новой задаче