From f8267bc946470b78d45015f3cdda5c1291e1cc3d Mon Sep 17 00:00:00 2001 From: "jshin%mailaps.org" Date: Thu, 19 Feb 2004 19:47:25 +0000 Subject: [PATCH] bug 234908 : fix the crash in Xft builds introduced by bug 231995. temporary work-around (patch by darin) --- gfx/src/gtk/nsFontMetricsXft.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/gfx/src/gtk/nsFontMetricsXft.cpp b/gfx/src/gtk/nsFontMetricsXft.cpp index 7f3499e7fe6..cd594cddf46 100644 --- a/gfx/src/gtk/nsFontMetricsXft.cpp +++ b/gfx/src/gtk/nsFontMetricsXft.cpp @@ -2771,17 +2771,23 @@ GetFontXftInfo(FcPattern* aPattern) // with GetEncoding(). It also sets fonttype (wide or narrow). // Then get the converter and see if has a valid coverage map. + // XXX these two if-statements used to be logically AND'ed, but + // string changes (bug 231995) made it impossible to use getter_Copies(encoding) + // and encoding.get() in a single statement. Until Darin comes up with + // a solution, we need to split it into two if-statements. (bug 234908) if (NS_SUCCEEDED(GetEncoding(family, getter_Copies(encoding), - fontType, ftEncoding)) && - NS_SUCCEEDED(GetConverter(encoding.get(), getter_AddRefs(converter)))) { - nsCOMPtr mapper(do_QueryInterface(converter)); - if (PR_LOG_TEST(gXftFontLoad, PR_LOG_DEBUG)) { - printf("\t\tc> got the converter and CMap :%s !!\n", - encoding.get()); - } + fontType, ftEncoding))) { + if (NS_SUCCEEDED(GetConverter(encoding.get(), + getter_AddRefs(converter)))) { + nsCOMPtr mapper(do_QueryInterface(converter)); + if (PR_LOG_TEST(gXftFontLoad, PR_LOG_DEBUG)) { + printf("\t\tc> got the converter and CMap :%s !!\n", + encoding.get()); + } - if (mapper) { - ccmap = MapperToCCMap(mapper); + if (mapper) { + ccmap = MapperToCCMap(mapper); + } } }