Commit 67826276 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Implement ME_DITypesEqual using a switch statment.

parent 694b6955
...@@ -44,23 +44,23 @@ void ME_Remove(ME_DisplayItem *diWhere) ...@@ -44,23 +44,23 @@ void ME_Remove(ME_DisplayItem *diWhere)
static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass) static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
{ {
if (type==nTypeOrClass) switch (nTypeOrClass)
return TRUE; {
if (nTypeOrClass==diRunOrParagraph && (type==diRun || type==diParagraph)) case diRunOrParagraph:
return TRUE; return type == diRun || type == diParagraph;
if (nTypeOrClass==diRunOrStartRow && (type==diRun || type==diStartRow)) case diRunOrStartRow:
return TRUE; return type == diRun || type == diStartRow;
if (nTypeOrClass==diParagraphOrEnd && (type==diTextEnd || type==diParagraph)) case diParagraphOrEnd:
return TRUE; return type == diTextEnd || type == diParagraph;
if (nTypeOrClass==diStartRowOrParagraph && (type==diStartRow || type==diParagraph)) case diStartRowOrParagraph:
return TRUE; return type == diStartRow || type == diParagraph;
if (nTypeOrClass==diStartRowOrParagraphOrEnd case diStartRowOrParagraphOrEnd:
&& (type==diStartRow || type==diParagraph || type==diTextEnd)) return type == diStartRow || type == diParagraph || type == diTextEnd;
return TRUE; case diRunOrParagraphOrEnd:
if (nTypeOrClass==diRunOrParagraphOrEnd return type == diRun || type == diParagraph || type == diTextEnd;
&& (type==diRun || type==diParagraph || type==diTextEnd)) default:
return TRUE; return type == nTypeOrClass;
return FALSE; }
} }
ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass) ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass)
......
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