[poppler] poppler/poppler: CairoFontEngine.cc,1.12,1.13

Kristian Hogsberg krh at freedesktop.org
Wed Jun 8 07:35:49 PDT 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv21672/poppler

Modified Files:
	CairoFontEngine.cc 
Log Message:
2005-06-08  Kristian Høgsberg  <krh at redhat.com>

        * poppler/CairoFontEngine.cc: Remember to delete tmpFileName.
        Patch from Nikolai Weibull (#3491).



Index: CairoFontEngine.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoFontEngine.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- CairoFontEngine.cc	20 May 2005 18:38:10 -0000	1.12
+++ CairoFontEngine.cc	8 Jun 2005 14:35:47 -0000	1.13
@@ -122,25 +122,25 @@
       if (gfxFont->getName()) {
 	dfp = globalParams->getDisplayFont(gfxFont->getName());
       }
-	if (!dfp) {
-	  // 8-bit font substitution
-	  if (gfxFont->isFixedWidth()) {
-	    substIdx = 8;
-	  } else if (gfxFont->isSerif()) {
-	    substIdx = 4;
-	  } else {
-	    substIdx = 0;
-	  }
-	  if (gfxFont->isBold()) {
-	    substIdx += 2;
-	  }
-	  if (gfxFont->isItalic()) {
-	    substIdx += 1;
-	  }
-	  substName = new GooString(cairoOutSubstFonts[substIdx].name);
-	  dfp = globalParams->getDisplayFont(substName);
-	  delete substName;
+      if (!dfp) {
+	// 8-bit font substitution
+	if (gfxFont->isFixedWidth()) {
+	  substIdx = 8;
+	} else if (gfxFont->isSerif()) {
+	  substIdx = 4;
+	} else {
+	  substIdx = 0;
+	}
+	if (gfxFont->isBold()) {
+	  substIdx += 2;
 	}
+	if (gfxFont->isItalic()) {
+	  substIdx += 1;
+	}
+	substName = new GooString(cairoOutSubstFonts[substIdx].name);
+	dfp = globalParams->getDisplayFont(substName);
+	delete substName;
+      }
     }
     if (!dfp) {
       error(-1, "Couldn't find a font for '%s'",
@@ -245,6 +245,7 @@
   // return an error, leaving the file to be deleted later
   if (fileName == tmpFileName) {
     unlink (fileName->getCString());
+    delete tmpFileName;
   }
 
   cairo_font_face = cairo_ft_font_face_create_for_ft_face (face,



More information about the poppler mailing list