Commit f37e4ff9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use DC_ATTR for SetTextCharacterExtra implementation.

parent ca07de0e
......@@ -4736,29 +4736,6 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc,
/***********************************************************************
* SetTextCharacterExtra (GDI32.@)
*/
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{
INT ret = 0x80000000;
DC * dc = get_dc_ptr( hdc );
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetTextCharacterExtra );
extra = physdev->funcs->pSetTextCharacterExtra( physdev, extra );
if (extra != 0x80000000)
{
ret = dc->attr->char_extra;
dc->attr->char_extra = extra;
}
release_dc_ptr( dc );
}
return ret;
}
/***********************************************************************
* NtGdiSetTextJustification (win32u.@)
*/
BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks )
......
......@@ -76,6 +76,7 @@ extern BOOL METADC_RoundRect( HDC hdc, INT left, INT top, INT right, INT bottom,
INT ell_width, INT ell_height ) DECLSPEC_HIDDEN;
extern BOOL METADC_SaveDC( HDC hdc ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetBkMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetTextCharacterExtra( HDC hdc, INT extra ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetMapMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetPixel( HDC hdc, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL METADC_SetPolyFillMode( HDC hdc, INT mode ) DECLSPEC_HIDDEN;
......
......@@ -315,6 +315,21 @@ INT WINAPI GetTextCharacterExtra( HDC hdc )
}
/***********************************************************************
* SetTextCharacterExtra (GDI32.@)
*/
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
{
DC_ATTR *dc_attr;
INT ret;
if (is_meta_dc( hdc )) return METADC_SetTextCharacterExtra( hdc, extra );
if (!(dc_attr = get_dc_attr( hdc ))) return 0x8000000;
ret = dc_attr->char_extra;
dc_attr->char_extra = extra;
return ret;
}
/***********************************************************************
* GetPolyFillMode (GDI32.@)
*/
INT WINAPI GetPolyFillMode( HDC hdc )
......
......@@ -140,9 +140,9 @@ BOOL METADC_SetTextJustification( HDC hdc, INT extra, INT breaks )
return metadc_param2( hdc, META_SETTEXTJUSTIFICATION, extra, breaks );
}
INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra )
BOOL METADC_SetTextCharacterExtra( HDC hdc, INT extra )
{
return MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra ) ? extra : 0x80000000;
return metadc_param1( hdc, META_SETTEXTCHAREXTRA, extra );
}
DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags )
......
......@@ -198,7 +198,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs =
NULL, /* pSetMapMode */
MFDRV_SetMapperFlags, /* pSetMapperFlags */
NULL, /* pSetPixel */
MFDRV_SetTextCharacterExtra, /* pSetTextCharacterExtra */
NULL, /* pSetTextCharacterExtra */
MFDRV_SetTextColor, /* pSetTextColor */
NULL, /* pSetTextJustification */
MFDRV_SetViewportExtEx, /* pSetViewportExtEx */
......
......@@ -105,7 +105,6 @@ extern COLORREF CDECL MFDRV_SetDCBrushColor( PHYSDEV dev, COLORREF color ) DECLS
extern COLORREF CDECL MFDRV_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetLayout( PHYSDEV dev, DWORD layout ) DECLSPEC_HIDDEN;
extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN;
extern INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN;
extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_SetViewportExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) DECLSPEC_HIDDEN;
extern BOOL CDECL MFDRV_SetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN;
......
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