This removes the unneeded checks in HtmlOutputDev on tmp->fontpos when
dumping text nodes as xml or "complex" html.
From ec1b6707e7040af56c843f023c3a6cbadf72f2e6 Mon Sep 17 00:00:00 2001
From: Reece Dunn <[email protected]>
Date: Wed, 4 Nov 2009 23:22:38 +0000
Subject: [PATCH] fontpos is never set to -1, so remove the checks in HtmlOutputDev.

---
 utils/HtmlOutputDev.cc |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 64f5098..f0b96e1 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -645,9 +645,7 @@ void HtmlPage::dumpAsXML(FILE* f,int page){
       fprintf(f,"<text top=\"%d\" left=\"%d\" ",xoutRound(tmp->yMin),xoutRound(tmp->xMin));
       fprintf(f,"width=\"%d\" height=\"%d\" ",xoutRound(tmp->xMax-tmp->xMin),xoutRound(tmp->yMax-tmp->yMin));
       fprintf(f,"font=\"%d\">", tmp->fontpos);
-      if (tmp->fontpos!=-1){
-	str1=fonts->getCSStyle(tmp->fontpos, str);
-      }
+      str1=fonts->getCSStyle(tmp->fontpos, str);
       fputs(str1->getCString(),f);
       delete str;
       delete str1;
@@ -731,12 +729,8 @@ void HtmlPage::dumpComplex(FILE *file, int page){
 	      xoutRound(tmp1->yMin),
 	      xoutRound(tmp1->xMin));
       fputs("<nobr>",pageFile); 
-      if (tmp1->fontpos!=-1){
-	str1=fonts->getCSStyle(tmp1->fontpos, str);  
-      }
-      //printf("%s\n", str1->getCString());
+      str1=fonts->getCSStyle(tmp1->fontpos, str);  
       fputs(str1->getCString(),pageFile);
-      
       delete str;      
       delete str1;
       fputs("</nobr></DIV>\n",pageFile);
-- 
1.6.3.3

_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to