Dylan Smith : richedit: Fixed a bug in protecting table cell boundaries.
Alexandre Julliard
julliard at winehq.org
Fri Aug 29 07:30:44 CDT 2008
Module: wine
Branch: master
Commit: ab6ca01471c434205105655d12959458d6011771
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ab6ca01471c434205105655d12959458d6011771
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Thu Aug 28 15:24:07 2008 -0400
richedit: Fixed a bug in protecting table cell boundaries.
---
dlls/riched20/table.c | 30 ++++++++----------------------
1 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c
index 248ea11..aa82c62 100644
--- a/dlls/riched20/table.c
+++ b/dlls/riched20/table.c
@@ -345,7 +345,7 @@ void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, int nOfs,int *nChars)
ME_DisplayItem *pRun;
int nCharsToBoundary;
- if (this_para->member.para.nCharOfs != nOfs &&
+ if ((this_para->member.para.nCharOfs != nOfs || this_para == end_para) &&
this_para->member.para.pFmt->dwMask & PFM_TABLE &&
this_para->member.para.pFmt->wEffects & PFE_TABLE)
{
@@ -360,27 +360,13 @@ void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, int nOfs,int *nChars)
} else if (end_para->member.para.pFmt->dwMask & PFM_TABLE &&
end_para->member.para.pFmt->wEffects & PFE_TABLE)
{
- if (this_para == end_para)
- {
- pRun = c2.pRun;
- /* Find the previous tab or end paragraph to use as a delete boundary */
- while (pRun && !(pRun->member.run.nFlags & (MERF_TAB|MERF_ENDPARA)))
- pRun = ME_FindItemBack(pRun, diRun);
- if (pRun && pRun->member.run.nFlags & MERF_ENDPARA)
- {
- /* We are in the first cell, and have gone back to the previous
- * paragraph, so nothing needs to be protected. */
- pRun = NULL;
- }
- } else {
- /* The deletion starts from before the row, so don't join it with
- * previous non-empty paragraphs. */
- pRun = NULL;
- if (nOfs > this_para->member.para.nCharOfs)
- pRun = ME_FindItemBack(end_para, diRun);
- if (!pRun)
- pRun = ME_FindItemFwd(end_para, diRun);
- }
+ /* The deletion starts from before the row, so don't join it with
+ * previous non-empty paragraphs. */
+ pRun = NULL;
+ if (nOfs > this_para->member.para.nCharOfs)
+ pRun = ME_FindItemBack(end_para, diRun);
+ if (!pRun)
+ pRun = ME_FindItemFwd(end_para, diRun);
if (pRun)
{
nCharsToBoundary = ME_GetParagraph(pRun)->member.para.nCharOfs
More information about the wine-cvs
mailing list