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

gdi32: Store char_extra in DC_ATTR.

parent f7824d43
......@@ -95,7 +95,7 @@ static void set_initial_dc_state( DC *dc )
dc->attr->brush_org.y = 0;
dc->mapperFlags = 0;
dc->attr->text_align = TA_LEFT | TA_TOP | TA_NOUPDATECP;
dc->charExtra = 0;
dc->attr->char_extra = 0;
dc->breakExtra = 0;
dc->breakRem = 0;
dc->attr->map_mode = MM_TEXT;
......@@ -413,7 +413,7 @@ BOOL CDECL nulldrv_RestoreDC( PHYSDEV dev, INT level )
dc->attr->brush_org = dcs->attr->brush_org;
dc->mapperFlags = dcs->mapperFlags;
dc->attr->text_align = dcs->attr->text_align;
dc->charExtra = dcs->charExtra;
dc->attr->char_extra = dcs->attr->char_extra;
dc->breakExtra = dcs->breakExtra;
dc->breakRem = dcs->breakRem;
dc->attr->map_mode = dcs->attr->map_mode;
......@@ -545,7 +545,6 @@ INT WINAPI NtGdiSaveDC( HDC hdc )
newdc->hBitmap = dc->hBitmap;
newdc->hPalette = dc->hPalette;
newdc->mapperFlags = dc->mapperFlags;
newdc->charExtra = dc->charExtra;
newdc->breakExtra = dc->breakExtra;
newdc->breakRem = dc->breakRem;
newdc->xformWorld2Wnd = dc->xformWorld2Wnd;
......
......@@ -4736,20 +4736,6 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc,
/***********************************************************************
* GetTextCharacterExtra (GDI32.@)
*/
INT WINAPI GetTextCharacterExtra( HDC hdc )
{
INT ret;
DC *dc = get_dc_ptr( hdc );
if (!dc) return 0x80000000;
ret = dc->charExtra;
release_dc_ptr( dc );
return ret;
}
/***********************************************************************
* SetTextCharacterExtra (GDI32.@)
*/
INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
......@@ -4763,8 +4749,8 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra )
extra = physdev->funcs->pSetTextCharacterExtra( physdev, extra );
if (extra != 0x80000000)
{
ret = dc->charExtra;
dc->charExtra = extra;
ret = dc->attr->char_extra;
dc->attr->char_extra = extra;
}
release_dc_ptr( dc );
}
......@@ -4943,14 +4929,15 @@ BOOL WINAPI GetTextExtentExPointI( HDC hdc, const WORD *indices, INT count, INT
{
for (i = 0; i < count; i++)
{
unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) + (i + 1) * dc->charExtra;
unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) +
(i + 1) * dc->attr->char_extra;
if (nfit && dx > (unsigned int)max_ext) break;
if (dxs) dxs[i] = dx;
}
if (nfit) *nfit = i;
}
size->cx = abs( INTERNAL_XDSTOWS( dc, size->cx )) + count * dc->charExtra;
size->cx = abs( INTERNAL_XDSTOWS( dc, size->cx )) + count * dc->attr->char_extra;
size->cy = abs( INTERNAL_YDSTOWS( dc, size->cy ));
}
......@@ -5080,14 +5067,15 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count, INT max_ext,
{
for (i = 0; i < count; i++)
{
unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) + (i + 1) * dc->charExtra;
unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) +
(i + 1) * dc->attr->char_extra;
if (nfit && dx > (unsigned int)max_ext) break;
if (dxs) dxs[i] = dx;
}
if (nfit) *nfit = i;
}
size->cx = abs( INTERNAL_XDSTOWS( dc, size->cx )) + count * dc->charExtra;
size->cx = abs( INTERNAL_XDSTOWS( dc, size->cx )) + count * dc->attr->char_extra;
size->cy = abs( INTERNAL_YDSTOWS( dc, size->cy ));
}
......
......@@ -306,6 +306,15 @@ INT WINAPI SetMapMode( HDC hdc, INT mode )
}
/***********************************************************************
* GetTextCharacterExtra (GDI32.@)
*/
INT WINAPI GetTextCharacterExtra( HDC hdc )
{
DC_ATTR *dc_attr = get_dc_attr( hdc );
return dc_attr ? dc_attr->char_extra : 0x80000000;
}
/***********************************************************************
* GetPolyFillMode (GDI32.@)
*/
INT WINAPI GetPolyFillMode( HDC hdc )
......
......@@ -111,7 +111,6 @@ typedef struct tagDC
UINT font_code_page;
DWORD mapperFlags; /* Font mapper flags */
INT charExtra; /* Spacing from SetTextCharacterExtra() */
INT breakExtra; /* breakTotalExtra / breakCount */
INT breakRem; /* breakTotalExtra % breakCount */
ABORTPROC pAbortProc; /* AbortProc for Printing */
......
......@@ -125,6 +125,7 @@ typedef struct DC_ATTR
WORD rel_abs_mode;
WORD stretch_blt_mode;
INT map_mode;
INT char_extra;
RECT vis_rect; /* visible rectangle in screen coords */
FLOAT miter_limit;
POINT brush_org; /* brush origin */
......
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