From 67826276248e98ddfc9c6fe1f1d0e6434aee84ae Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Mon, 10 Aug 2009 10:53:21 -0400 Subject: [PATCH] richedit: Implement ME_DITypesEqual using a switch statment. --- dlls/riched20/list.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/riched20/list.c b/dlls/riched20/list.c index d3d9463c04b..06f1121f178 100644 --- a/dlls/riched20/list.c +++ b/dlls/riched20/list.c @@ -44,23 +44,23 @@ void ME_Remove(ME_DisplayItem *diWhere) static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass) { - if (type==nTypeOrClass) - return TRUE; - if (nTypeOrClass==diRunOrParagraph && (type==diRun || type==diParagraph)) - return TRUE; - if (nTypeOrClass==diRunOrStartRow && (type==diRun || type==diStartRow)) - return TRUE; - if (nTypeOrClass==diParagraphOrEnd && (type==diTextEnd || type==diParagraph)) - return TRUE; - if (nTypeOrClass==diStartRowOrParagraph && (type==diStartRow || type==diParagraph)) - return TRUE; - if (nTypeOrClass==diStartRowOrParagraphOrEnd - && (type==diStartRow || type==diParagraph || type==diTextEnd)) - return TRUE; - if (nTypeOrClass==diRunOrParagraphOrEnd - && (type==diRun || type==diParagraph || type==diTextEnd)) - return TRUE; - return FALSE; + switch (nTypeOrClass) + { + case diRunOrParagraph: + return type == diRun || type == diParagraph; + case diRunOrStartRow: + return type == diRun || type == diStartRow; + case diParagraphOrEnd: + return type == diTextEnd || type == diParagraph; + case diStartRowOrParagraph: + return type == diStartRow || type == diParagraph; + case diStartRowOrParagraphOrEnd: + return type == diStartRow || type == diParagraph || type == diTextEnd; + case diRunOrParagraphOrEnd: + return type == diRun || type == diParagraph || type == diTextEnd; + default: + return type == nTypeOrClass; + } } ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass)