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

Alexandre Julliard julliard at winehq.org
Mon Aug 18 10:46:09 CDT 2008


Module: wine
Branch: master
Commit: e568e151426761b8e37f4dbb45262cbb9dbac20b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e568e151426761b8e37f4dbb45262cbb9dbac20b

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Thu Aug  7 10:17:12 2008 -0400

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

Previously the calculations of dxStartIdent and dxOffset depended on
their order.

---

 dlls/riched20/editor.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

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




More information about the wine-cvs mailing list