Prechádzať zdrojové kódy

Fix issue 328: Ignores supplied xsl stylesheet for toc

Antialize 15 rokov pred
rodič
commit
75060f1be6
1 zmenil súbory, kde vykonal 7 pridanie a 3 odobranie
  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);