richedit: Removed assumption about the order of rtf indent control words.

Previously the calculations of dxStartIdent and dxOffset depended on
their order.
This commit is contained in:
Dylan Smith 2008-08-07 10:17:12 -04:00 committed by Alexandre Julliard
parent 2cd620802a
commit e568e15142
1 changed files with 2 additions and 4 deletions

View File

@ -473,15 +473,13 @@ static void ME_RTFParAttrHook(RTF_Info *info)
case rtfFirstIndent: case rtfFirstIndent:
ME_GetSelectionParaFormat(info->editor, &fmt); ME_GetSelectionParaFormat(info->editor, &fmt);
fmt.dwMask = PFM_STARTINDENT | PFM_OFFSET; fmt.dwMask = PFM_STARTINDENT | PFM_OFFSET;
fmt.dxStartIndent += info->rtfParam; fmt.dxStartIndent += fmt.dxOffset + info->rtfParam;
fmt.dxOffset = -info->rtfParam; fmt.dxOffset = -info->rtfParam;
break; break;
case rtfLeftIndent: case rtfLeftIndent:
/* we assume rtfLeftIndent is always specified before rtfFirstIndent */
ME_GetSelectionParaFormat(info->editor, &fmt); ME_GetSelectionParaFormat(info->editor, &fmt);
fmt.dwMask = PFM_STARTINDENT; fmt.dwMask = PFM_STARTINDENT;
fmt.dxStartIndent = info->rtfParam; fmt.dxStartIndent = info->rtfParam - fmt.dxOffset;
fmt.dxOffset = 0;
break; break;
case rtfRightIndent: case rtfRightIndent:
fmt.dwMask = PFM_RIGHTINDENT; fmt.dwMask = PFM_RIGHTINDENT;