[poppler] Branch 'poppler-0.8' - utils/HtmlFonts.cc utils/HtmlOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jul 28 11:52:54 PDT 2008


 utils/HtmlFonts.cc     |    2 ++
 utils/HtmlOutputDev.cc |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 521a005dc80acbe6c2099b41cb7f513232f934a2
Author: Boris Toloknov <tlknv at yandex.ru>
Date:   Mon Jul 28 20:52:19 2008 +0200

    Make html output to keep all the spaces with &nbsp;

diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index 347319b..fcac855 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -205,6 +205,8 @@ GooString* HtmlFont::HtmlFilter(Unicode* u, int uLen) {
 	case '&': tmp->append("&amp;");  break;
 	case '<': tmp->append("&lt;");  break;
 	case '>': tmp->append("&gt;");  break;
+	case ' ': tmp->append( !xml && ( i+1 >= uLen || !tmp->getLength() || tmp->getChar( tmp->getLength()-1 ) == ' ' ) ? "&nbsp;" : " " );
+	          break;
 	default:  
 	  {
 	    // convert unicode to string
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 94fb2bb..9438909 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -462,7 +462,7 @@ void HtmlPage::coalesce() {
 					str1->size * sizeof(double));
       if (addSpace) {
 		  str1->text[str1->len] = 0x20;
-		  str1->htext->append(" ");
+		  str1->htext->append(xml?" ":"&nbsp;");
 		  str1->xRight[str1->len] = str2->xMin;
 		  ++str1->len;
       }


More information about the poppler mailing list