* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: text.c,v 1.39 2003/08/09 12:03:10 gvg Exp $ */
+/* $Id: text.c,v 1.40 2003/08/09 21:14:01 gvg Exp $ */
#undef WIN32_LEAN_AND_MEAN
static BOOL
FASTCALL
-TextIntGetTextExtentPoint(PDC dc,
+TextIntGetTextExtentPoint(PTEXTOBJ TextObj,
LPCWSTR String,
int Count,
int MaxExtent,
LPINT Dx,
LPSIZE Size)
{
- PTEXTOBJ TextObj;
PFONTGDI FontGDI;
FT_Face face;
FT_GlyphSlot glyph;
FT_CharMap charmap, found = NULL;
BOOL use_kerning;
- TextObj = TEXTOBJ_LockText(dc->w.hFont);
GetFontObjectsFromTextObj(TextObj, NULL, NULL, &FontGDI);
face = FontGDI->face;
if (NULL != Fit)
String++;
}
- TEXTOBJ_UnlockText(dc->w.hFont);
-
Size->cx = TotalWidth;
Size->cy = MaxHeight;
BOOLEAN Result;
INT Fit;
LPINT Dx;
+ PTEXTOBJ TextObj;
- dc = DC_HandleToPtr(hDC);
-
- if (NULL == dc)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return FALSE;
- }
if (Count < 0)
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
- Result = TextIntGetTextExtentPoint(dc, String, Count, MaxExtent,
+ dc = DC_HandleToPtr(hDC);
+ if (NULL == dc)
+ {
+ if (NULL != Dx)
+ {
+ ExFreePool(Dx);
+ }
+ ExFreePool(String);
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ TextObj = TEXTOBJ_LockText(dc->w.hFont);
+ DC_ReleasePtr(hDC);
+ Result = TextIntGetTextExtentPoint(TextObj, String, Count, MaxExtent,
NULL == UnsafeFit ? NULL : &Fit, Dx, &Size);
+ TEXTOBJ_UnlockText(dc->w.hFont);
ExFreePool(String);
if (! Result)
SIZE Size;
NTSTATUS Status;
BOOLEAN Result;
+ PTEXTOBJ TextObj;
dc = DC_HandleToPtr(hDC);
return FALSE;
}
+ dc = DC_HandleToPtr(hDC);
+ if (NULL == dc)
+ {
+ ExFreePool(String);
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ TextObj = TEXTOBJ_LockText(dc->w.hFont);
+ DC_ReleasePtr(hDC);
Result = TextIntGetTextExtentPoint(dc, String, Count, 0, NULL, NULL, &Size);
+ TEXTOBJ_UnlockText(dc->w.hFont);
ExFreePool(String);
if (! Result)