Commit 1967fae8 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

user32: Have a fallback in linebreaking if uniscribe fails to analyse a string.

parent 4bc418b3
...@@ -598,9 +598,13 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta ...@@ -598,9 +598,13 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
const SIZE *sz; const SIZE *sz;
EDIT_InvalidateUniscribeData_linedef(current_line); EDIT_InvalidateUniscribeData_linedef(current_line);
EDIT_UpdateUniscribeData_linedef(es, NULL, current_line); EDIT_UpdateUniscribeData_linedef(es, NULL, current_line);
sz = ScriptString_pSize(current_line->ssa); if (current_line->ssa)
/* Calculate line width */ {
current_line->width = sz->cx; sz = ScriptString_pSize(current_line->ssa);
/* Calculate line width */
current_line->width = sz->cx;
}
else current_line->width = es->char_width * current_line->net_length;
} }
else current_line->width = 0; else current_line->width = 0;
...@@ -644,18 +648,23 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta ...@@ -644,18 +648,23 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
EDIT_InvalidateUniscribeData_linedef(current_line); EDIT_InvalidateUniscribeData_linedef(current_line);
EDIT_UpdateUniscribeData_linedef(es, NULL, current_line); EDIT_UpdateUniscribeData_linedef(es, NULL, current_line);
count = ScriptString_pcOutChars(current_line->ssa); if (current_line->ssa)
piDx = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * (*count)); {
ScriptStringGetLogicalWidths(current_line->ssa,piDx); count = ScriptString_pcOutChars(current_line->ssa);
piDx = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * (*count));
prev = current_line->net_length-1; ScriptStringGetLogicalWidths(current_line->ssa,piDx);
do {
current_line->width -= piDx[prev]; prev = current_line->net_length-1;
prev--; do {
} while ( prev > 0 && current_line->width > fw); current_line->width -= piDx[prev];
if (prev<=0) prev--;
prev = 1; } while ( prev > 0 && current_line->width > fw);
HeapFree(GetProcessHeap(),0,piDx); if (prev<=0)
prev = 1;
HeapFree(GetProcessHeap(),0,piDx);
}
else
prev = (fw / es->char_width);
} }
/* If the first line we are calculating, wrapped before istart, we must /* If the first line we are calculating, wrapped before istart, we must
......
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