[poppler] poppler/utils: HtmlFonts.cc, 1.1, 1.1.4.1 HtmlOutputDev.cc, 1.5.4.2, 1.5.4.3 HtmlOutputDev.h, 1.2, 1.2.4.1

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Apr 14 16:51:54 PDT 2007


Update of /cvs/poppler/poppler/utils
In directory kemper:/tmp/cvs-serv19141

Modified Files:
      Tag: xpdf302merge
	HtmlFonts.cc HtmlOutputDev.cc HtmlOutputDev.h 
Log Message:
branchport link and color fixes


Index: HtmlFonts.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/HtmlFonts.cc,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- HtmlFonts.cc	12 Dec 2005 20:15:11 -0000	1.1
+++ HtmlFonts.cc	14 Apr 2007 23:51:52 -0000	1.1.4.1
@@ -33,10 +33,10 @@
 GooString* HtmlFont::DefaultFont=new GooString("Times"); // Arial,Helvetica,sans-serif
 
 HtmlFontColor::HtmlFontColor(GfxRGB rgb){
-  r=static_cast<int>(255*rgb.r);
-  g=static_cast<int>(255*rgb.g);
-  b=static_cast<int>(255*rgb.b);
-  if (!(Ok(r)&&Ok(b)&&Ok(g))) {printf("Error : Bad color \n");r=0;g=0;b=0;}
+  r=static_cast<int>(rgb.r/65535.0*255.0);
+  g=static_cast<int>(rgb.g/65535.0*255.0);
+  b=static_cast<int>(rgb.b/65535.0*255.0);
+  if (!(Ok(r)&&Ok(b)&&Ok(g))) {printf("Error : Bad color %d %d %d\n", r, g, b);r=0;g=0;b=0;}
 }
 
 GooString *HtmlFontColor::convtoX(unsigned int xcol) const{

Index: HtmlOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/utils/HtmlOutputDev.cc,v
retrieving revision 1.5.4.2
retrieving revision 1.5.4.3
diff -u -d -r1.5.4.2 -r1.5.4.3
--- HtmlOutputDev.cc	6 Apr 2007 15:33:26 -0000	1.5.4.2
+++ HtmlOutputDev.cc	14 Apr 2007 23:51:52 -0000	1.5.4.3
@@ -27,6 +27,7 @@
 #include "goo/gmem.h"
 #include "Error.h"
 #include "GfxState.h"
+#include "Page.h"
 #ifdef ENABLE_LIBJPEG
 #include "DCTStream.h"
 #endif
@@ -1036,6 +1037,12 @@
 
 
 void HtmlOutputDev::endPage() {
+  Links *linksList = catalog->getPage(pageNum)->getLinks(catalog);
+  for (int i = 0; i < linksList->getNumLinks(); ++i)
+  {
+      processLink(linksList->getLink(i));
+  }
+
   pages->conv();
   pages->coalesce();
   pages->dump(page, pageNum);
@@ -1267,23 +1274,20 @@
 
 
 
-void HtmlOutputDev::drawLink(Link* link,Catalog *cat){
-#warning THIS WONT WORK OUTPUTDEV DOES NOT HAS drawLink anymore
-/*
-  double _x1,_y1,_x2,_y2,w;
+void HtmlOutputDev::processLink(Link* link){
+  double _x1,_y1,_x2,_y2;
   int x1,y1,x2,y2;
   
   link->getRect(&_x1,&_y1,&_x2,&_y2);
-  w = link->getBorderStyle()->getWidth();
   cvtUserToDev(_x1,_y1,&x1,&y1);
   
   cvtUserToDev(_x2,_y2,&x2,&y2); 
 
 
-  GooString* _dest=getLinkDest(link,cat);
+  GooString* _dest=getLinkDest(link,catalog);
   HtmlLink t((double) x1,(double) y2,(double) x2,(double) y1,_dest);
   pages->AddLink(t);
-  delete _dest;*/
+  delete _dest;
 }
 
 GooString* HtmlOutputDev::getLinkDest(Link *link,Catalog* catalog){

Index: HtmlOutputDev.h
===================================================================
RCS file: /cvs/poppler/poppler/utils/HtmlOutputDev.h,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -d -r1.2 -r1.2.4.1
--- HtmlOutputDev.h	19 Mar 2006 17:01:05 -0000	1.2
+++ HtmlOutputDev.h	14 Apr 2007 23:51:52 -0000	1.2.4.1
@@ -232,6 +232,18 @@
 
   //----- initialization and control
 
+  virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
+                               int rotate, GBool useMediaBox, GBool crop,
+                               int sliceX, int sliceY, int sliceW, int sliceH,
+                               GBool printing, Catalog * catalogA,
+                               GBool (* abortCheckCbk)(void *data) = NULL,
+                               void * abortCheckCbkData = NULL)
+  {
+   catalog = catalogA;
+   return gTrue;
+  }
+
+
   // Start a page.
   virtual void startPage(int pageNum, GfxState *state);
 
@@ -259,7 +271,6 @@
 
   //new feature    
   virtual int DevType() {return 1234;}
-  virtual void drawLink(Link *link,Catalog *cat); 
 
   int getPageWidth() { return maxPageWidth; }
   int getPageHeight() { return maxPageHeight; }
@@ -272,6 +283,7 @@
   // convert encoding into a HTML standard, or encoding->getCString if not
   // recognized
   static char* mapEncodingToHtml(GooString* encoding);
+  void processLink(Link *link);
   GooString* getLinkDest(Link *link,Catalog *catalog);
   void dumpMetaVars(FILE *);
   void doFrame(int firstPage);
@@ -294,6 +306,7 @@
   GooString *Docname;
   GooString *docTitle;
   GooList *glMetaVars;
+  Catalog *catalog;
   friend class HtmlPage;
 };
 



More information about the poppler mailing list