From 0c59e312c183c4d988feb10a8adf84f5a70558db Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Sun, 25 May 2008 21:30:10 +0900 Subject: [PATCH] gdi32: Ignore exScale/eyScale when comparing EMREXTTEXTOUT EMF records. --- dlls/gdi32/tests/metafile.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c index d7eda2d6e0d..40c7445efb7 100644 --- a/dlls/gdi32/tests/metafile.c +++ b/dlls/gdi32/tests/metafile.c @@ -975,6 +975,22 @@ static void dump_emf_record(const ENHMETARECORD *emr, const char *desc) printf ("};\n"); } +static void dump_EMREXTTEXTOUT(const EMREXTTEXTOUTW *eto) +{ + trace("rclBounds %d,%d - %d,%d\n", eto->rclBounds.left, eto->rclBounds.top, + eto->rclBounds.right, eto->rclBounds.bottom); + trace("iGraphicsMode %u\n", eto->iGraphicsMode); + trace("exScale: %f\n", eto->exScale); + trace("eyScale: %f\n", eto->eyScale); + trace("emrtext.ptlReference %d,%d\n", eto->emrtext.ptlReference.x, eto->emrtext.ptlReference.y); + trace("emrtext.nChars %u\n", eto->emrtext.nChars); + trace("emrtext.offString %#x\n", eto->emrtext.offString); + trace("emrtext.fOptions %#x\n", eto->emrtext.fOptions); + trace("emrtext.rcl %d,%d - %d,%d\n", eto->emrtext.rcl.left, eto->emrtext.rcl.top, + eto->emrtext.rcl.right, eto->emrtext.rcl.bottom); + trace("emrtext.offDx %#x\n", eto->emrtext.offDx); +} + static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr2, const char *desc, BOOL ignore_scaling, BOOL todo) { @@ -1017,7 +1033,30 @@ static BOOL match_emf_record(const ENHMETARECORD *emr1, const ENHMETARECORD *emr emr1->iType == EMR_SETVIEWPORTEXTEX)) return TRUE; - diff = memcmp(emr1->dParm, emr2->dParm, emr1->nSize - sizeof(EMR)); + if (emr1->iType == EMR_EXTTEXTOUTW || emr1->iType == EMR_EXTTEXTOUTA) + { + EMREXTTEXTOUTW *eto1, *eto2; + + eto1 = HeapAlloc(GetProcessHeap(), 0, emr1->nSize); + memcpy(eto1, emr1, emr1->nSize); + eto2 = HeapAlloc(GetProcessHeap(), 0, emr2->nSize); + memcpy(eto2, emr2, emr2->nSize); + + /* different Windows versions setup DC scaling differently */ + eto1->exScale = eto1->eyScale = 0.0; + eto2->exScale = eto2->eyScale = 0.0; + + diff = memcmp(eto1, eto2, emr1->nSize); + if (diff) + { + dump_EMREXTTEXTOUT(eto1); + dump_EMREXTTEXTOUT(eto2); + } + HeapFree(GetProcessHeap(), 0, eto1); + HeapFree(GetProcessHeap(), 0, eto2); + } + else + diff = memcmp(emr1, emr2, emr1->nSize); if (diff && todo) { todo_wine -- 2.11.4.GIT