Commit 8a36f2a3 authored by Phil Krylov's avatar Phil Krylov Committed by Alexandre Julliard

Fixed EM_GETCHARFORMAT for selection containing a single character.

parent 42f3e227
...@@ -642,9 +642,6 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p ...@@ -642,9 +642,6 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p
int nOffset, nOffset2; int nOffset, nOffset2;
CHARFORMAT2W tmp; CHARFORMAT2W tmp;
if (nTo>nFrom) /* selection consists of chars from nFrom up to nTo-1 */
nTo--;
ME_RunOfsFromCharOfs(editor, nFrom, &run, &nOffset); ME_RunOfsFromCharOfs(editor, nFrom, &run, &nOffset);
if (nFrom == nTo) /* special case - if selection is empty, take previous char's formatting */ if (nFrom == nTo) /* special case - if selection is empty, take previous char's formatting */
{ {
...@@ -659,6 +656,9 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p ...@@ -659,6 +656,9 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p
ME_GetRunCharFormat(editor, run, pFmt); ME_GetRunCharFormat(editor, run, pFmt);
return; return;
} }
if (nTo>nFrom) /* selection consists of chars from nFrom up to nTo-1 */
nTo--;
ME_RunOfsFromCharOfs(editor, nTo, &run_end, &nOffset2); ME_RunOfsFromCharOfs(editor, nTo, &run_end, &nOffset2);
ME_GetRunCharFormat(editor, run, pFmt); ME_GetRunCharFormat(editor, run, pFmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment