فهرست منبع

Fix issue 328: Ignores supplied xsl stylesheet for toc

Antialize 15 سال پیش
والد
کامیت
75060f1be6
1فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  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);