SIZE sz;
RECT rc;
BOOL done_extents = FALSE;
- INT width, xwidth, ywidth;
+ INT width, xwidth = 0, ywidth = 0;
DWORD type;
DC * dc = DC_GetDCUpdate( hdc );
glyphs ? glyphs : reordered_str, count, deltas);
}
- if (lf.lfUnderline || lf.lfStrikeOut)
+done:
+ HeapFree(GetProcessHeap(), 0, deltas);
+ if(glyphs != reordered_str)
+ HeapFree(GetProcessHeap(), 0, glyphs);
+ if(reordered_str != str)
+ HeapFree(GetProcessHeap(), 0, reordered_str);
+
+ GDI_ReleaseObj( hdc );
+
+ if (ret && (lf.lfUnderline || lf.lfStrikeOut))
{
int underlinePos, strikeoutPos;
int underlineWidth, strikeoutWidth;
- UINT nMetricsSize = GetOutlineTextMetricsW(hdc, 0, NULL);
+ UINT size = GetOutlineTextMetricsW(hdc, 0, NULL);
OUTLINETEXTMETRICW* otm = NULL;
- if(!nMetricsSize)
+ if(!size)
{
TEXTMETRICW tm;
GetTextMetricsW(hdc, &tm);
}
else
{
- otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize);
- if (!otm) goto done;
-
- GetOutlineTextMetricsW(hdc, nMetricsSize, otm);
+ otm = HeapAlloc(GetProcessHeap(), 0, size);
+ GetOutlineTextMetricsW(hdc, size, otm);
underlinePos = otm->otmsUnderscorePosition;
underlineWidth = otm->otmsUnderscoreSize;
strikeoutPos = otm->otmsStrikeoutPosition;
strikeoutWidth = otm->otmsStrikeoutSize;
+ HeapFree(GetProcessHeap(), 0, otm);
}
if(lf.lfUnderline)
{
POINT pts[2], oldpt;
- HPEN hpen = CreatePen(PS_SOLID, underlineWidth, dc->textColor);
+ HPEN hpen = CreatePen(PS_SOLID, underlineWidth, GetTextColor(hdc));
hpen = SelectObject(hdc, hpen);
pts[0].x = x;
pts[0].y = y;
if(lf.lfStrikeOut)
{
POINT pts[2], oldpt;
- HPEN hpen = CreatePen(PS_SOLID, strikeoutWidth, dc->textColor);
+ HPEN hpen = CreatePen(PS_SOLID, strikeoutWidth, GetTextColor(hdc));
hpen = SelectObject(hdc, hpen);
pts[0].x = x;
pts[0].y = y;
}
}
-done:
- HeapFree(GetProcessHeap(), 0, deltas);
- if(glyphs != reordered_str)
- HeapFree(GetProcessHeap(), 0, glyphs);
- if(reordered_str != str)
- HeapFree(GetProcessHeap(), 0, reordered_str);
-
- GDI_ReleaseObj( hdc );
return ret;
}