[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell/plugins
From:       Stefan Kebekus <kebekus () kde ! org>
Date:       2006-11-05 20:51:33
Message-ID: 1162759893.469919.32084.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 602382 by kebekus:

fixes minor problems with hyperlinks in DVI and re-loading in PDF files


 M  +7 -2      dvi/dviRenderer.cpp  
 M  +3 -3      pdf/pdfRenderer.cpp  
 M  +1 -1      pdf/pdfRenderer.h  


--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/dviRenderer.cpp #602381:602382
@@ -233,8 +233,13 @@
 
     bool merged = false;
 
-    // Merge all hyperlinks that point to the same target, and have the same baseline.
-    while (hi.linkText == hj.linkText && hi.baseline == hj.baseline)
+    // Merge all hyperlinks that point to the same target, have the
+    // same baseline, and are no more than 3mm (but at least 2 pixels)
+    // apart
+    int minDistance = QMAX(2, 0.3/2.54*id.resolution); // Compute what 3mm is in pixels
+    while ((hi.linkText == hj.linkText) &&
+           (hi.baseline == hj.baseline) && 
+           ( hi.box.unite(hj.box).width() <= hi.box.width()+hj.box.width()+minDistance ))
     {
       merged = true;
       hi.box = hi.box.unite(hj.box);
--- branches/work/kviewshell-0.7/kviewshell/plugins/pdf/pdfRenderer.cpp #602381:602382
@@ -503,17 +503,17 @@
 }
 
 
-bool PdfRenderer::isValidFile(const QString fileName)
+bool PdfRenderer::isValidFile(const QString& fileName) const
 {
   Poppler::Document* doc = Poppler::Document::load(fileName.ascii());
-  if (doc)
-  {
+  if (doc) {
     delete doc;
     return true;
   }
   return false;
 }
 
+
 bool PdfRenderer::parsePdfSync(QString basename, QTextStream& stream)
 {
   // The first line should contain the basename
--- branches/work/kviewshell-0.7/kviewshell/plugins/pdf/pdfRenderer.h #602381:602382
@@ -107,7 +107,7 @@
   virtual void clear();
 
   /** Check if the give file is a valid PDF Document. */
-  virtual bool isValidFile(const QString fileName);
+  virtual bool isValidFile(const QString& fileName) const;
 
   /** Rendering a page
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic