riched20: Correctly handle the wrapping when graphics are used.

Get rid of infinite loops when run's width was larger than the global
available width.
This commit is contained in:
Eric Pouech 2008-01-27 19:01:58 +01:00 committed by Alexandre Julliard
parent 00b48f1d21
commit d014db68d4
1 changed files with 7 additions and 2 deletions

View File

@ -293,8 +293,13 @@ static ME_DisplayItem *ME_WrapHandleRun(ME_WrapContext *wc, ME_DisplayItem *p)
wc->bOverflown = TRUE;
return p;
}
/* graphics or TAB - we can split before */
if (run->nFlags & (MERF_GRAPHICS|MERF_TAB)) {
/* TAB: we can split before */
if (run->nFlags & MERF_TAB) {
wc->bOverflown = TRUE;
return p;
}
/* graphics: we can split before, if run's width is smaller than row's width */
if ((run->nFlags & MERF_GRAPHICS) && run->nWidth <= wc->nAvailWidth) {
wc->bOverflown = TRUE;
return p;
}