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:
parent
2cd620802a
commit
e568e15142
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue