- Better handling of error cases when no fonts are present in the system.

svn path=/trunk/; revision=9904
This commit is contained in:
Filip Navara 2004-06-27 11:24:43 +00:00
parent 13d400fbd2
commit 3bd4ef3363

View file

@ -2024,7 +2024,8 @@ calc_label:
infoPtr->iconSize.cy + ICON_BOTTOM_PADDING;
Label.right = Label.left + labelSize.cx;
Label.bottom = Label.top + infoPtr->nItemHeight;
if (!oversizedBox && labelSize.cy > infoPtr->ntmHeight)
if (!oversizedBox && labelSize.cy > infoPtr->ntmHeight &&
infoPtr->ntmHeight)
{
labelSize.cy = min(Box.bottom - Label.top, labelSize.cy);
labelSize.cy /= infoPtr->ntmHeight;
@ -9516,7 +9517,8 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, DWORD style,
hOldFont = SelectObject(hdc, infoPtr->hFont);
/*Get String Length in pixels */
GetTextExtentPoint32W(hdc, text, lstrlenW(text), &sz);
if(!GetTextExtentPoint32W(hdc, text, lstrlenW(text), &sz))
sz.cx = 0;
/*Add Extra spacing for the next character */
GetTextMetricsW(hdc, &textMetric);