Jelajahi Sumber

Fix issue 328: Ignores supplied xsl stylesheet for toc

Antialize 15 tahun lalu
induk
melakukan
75060f1be6
1 mengubah file dengan 7 tambahan dan 3 penghapusan
  1. 7 3
      src/lib/pdfconverter.cc

+ 7 - 3
src/lib/pdfconverter.cc

@@ -334,9 +334,13 @@ void PdfConverterPrivate::loadTocs() {
 		if (!ps.isTableOfContent) continue;
 		obj.clear();
 
-		QString style = obj.tocStyleFile.create(".xsl");
-		StreamDumper styleDump(style);
-		dumpDefaultTOCStyleSheet(styleDump.stream, ps.toc);
+		QString style = ps.tocXsl;
+		if (style.isEmpty()) {
+			style = obj.tocStyleFile.create(".xsl");
+			StreamDumper styleDump(style);
+			dumpDefaultTOCStyleSheet(styleDump.stream, ps.toc);
+		} else
+			style = MultiPageLoader::guessUrlFromString(style).toString();
 
 		QString path = obj.tocFile.create(".xml");
 		StreamDumper sd(path);