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

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

SVN commit 602383 by kebekus:

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


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


--- trunk/KDE/kdegraphics/kviewshell/plugins/dvi/dviRenderer.cpp \
#602382:602383 @@ -202,8 +202,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, (int)(0.3/2.54*id.resolution+0.5)); // \
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);
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/pdfRenderer.cpp \
#602382:602383 @@ -500,7 +500,7 @@
 }
 
 
-bool PdfRenderer::isValidFile(const QString fileName)
+bool PdfRenderer::isValidFile(const QString& fileName) const
 {
   Poppler::Document* doc = Poppler::Document::load(fileName.toAscii());
   if (doc)
--- trunk/KDE/kdegraphics/kviewshell/plugins/pdf/pdfRenderer.h \
#602382:602383 @@ -118,7 +118,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