r15086 by jghali - #9090: PDF bookmark on non printable layer results in bad PDF output

scribus-commit scribus-commit at lists.scribus.net
Wed May 19 22:50:25 CEST 2010


Revision: 15086
Author: jghali
Date: 2010-05-19T20:46:09.632665Z
Commit message: #9090: PDF bookmark on non printable layer results in bad PDF output

Changeset: 
M  /branches/Version135/Scribus/scribus/pdflib_core.cpp

Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp	(revision 15085)
+++ scribus/pdflib_core.cpp	(revision 15086)
@@ -7304,7 +7304,6 @@
 	QTreeWidgetItem* pp;
 	QString Inhal = "";
 	QMap<int,QString> Inha;
-	//if ((Bvie->childCount() != 0) && (Options.Bookmarks) && (BookMinUse))
 	if ((Bvie->topLevelItemCount() != 0) && (Options.Bookmarks) && (BookMinUse))
 	{
 		int Basis = ObjCounter - 1;
@@ -7335,7 +7334,16 @@
 			if (ip->childCount())
 				Inhal += "/Count -"+QString::number(ip->childCount())+"\n";
 			if ((ip->PageObject->OwnPage != -1) && PageTree.Kids.contains(ip->PageObject->OwnPage))
-				Inhal += "/Dest ["+QString::number(PageTree.Kids[ip->PageObject->OwnPage])+" 0 R "+ip->Action+"\n";
+			{
+				QString action = ip->Action;
+				if (action.isEmpty())
+				{
+					const Page* page = doc.DocPages.at(ip->PageObject->OwnPage);
+					double actionPos = page->height() - (ip->PageObject->yPos() - page->yOffset());
+					action = QString("/XYZ 0 %1 0").arg(actionPos);
+				}
+				Inhal += "/Dest ["+QString::number(PageTree.Kids[ip->PageObject->OwnPage])+" 0 R "+action+"\n";
+			}
 			Inhal += ">>\nendobj\n";
 			Inha[ip->ItemNr] = Inhal;
 			++it;




More information about the scribus-commit mailing list