Huw Davies : riched20: Revert to the default paragraph style when all text is deleted.

Alexandre Julliard julliard at winehq.org
Fri Jan 10 14:44:54 CST 2014


Module: wine
Branch: stable
Commit: 56f05cfa51645621e2ba64cc42f95b052ef146bd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=56f05cfa51645621e2ba64cc42f95b052ef146bd

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Nov  4 14:23:53 2013 +0000

riched20: Revert to the default paragraph style when all text is deleted.

(cherry picked from commit 58e83ebdea14dbc3e4839b17ec4cbcd59fa67293)

---

 dlls/riched20/caret.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index b39a8c7..fd7034d 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -284,13 +284,15 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start,
                            int nChars, BOOL bForce)
 {
   ME_Cursor c = *start;
-  int nOfs = ME_GetCursorOfs(start);
+  int nOfs = ME_GetCursorOfs(start), text_len = ME_GetTextLength( editor );
   int shift = 0;
   int totalChars = nChars;
   ME_DisplayItem *start_para;
+  BOOL delete_all = FALSE;
 
   /* Prevent deletion past last end of paragraph run. */
-  nChars = min(nChars, ME_GetTextLength(editor) - nOfs);
+  nChars = min(nChars, text_len - nOfs);
+  if (nChars == text_len) delete_all = TRUE;
   start_para = c.pPara;
 
   if (!bForce)
@@ -424,6 +426,7 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start,
       continue;
     }
   }
+  if (delete_all) ME_SetDefaultParaFormat( start_para->member.para.pFmt );
   return TRUE;
 }
 




More information about the wine-cvs mailing list