From ea2e171c40d95f8b775008f85ea864f337919da0 Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Jun 05 2011 23:57:46 +0000 Subject: Fix the build of the DVI backend: We cannot use document() in dviexport.cpp, we have to pass the orientation all along. --- diff --git a/kdegraphics-4.6.3-okular-landscape.patch b/kdegraphics-4.6.3-okular-landscape.patch index e61b266..a434c14 100644 --- a/kdegraphics-4.6.3-okular-landscape.patch +++ b/kdegraphics-4.6.3-okular-landscape.patch @@ -249,17 +249,127 @@ diff -ur kdegraphics-4.6.3/okular/generators/djvu/generator_djvu.cpp kdegraphics diff -ur kdegraphics-4.6.3/okular/generators/dvi/dviexport.cpp kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviexport.cpp --- kdegraphics-4.6.3/okular/generators/dvi/dviexport.cpp 2009-10-08 23:55:51.000000000 +0200 -+++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviexport.cpp 2011-06-06 01:07:43.000000000 +0200 -@@ -460,7 +460,8 @@ ++++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviexport.cpp 2011-06-06 01:52:08.000000000 +0200 +@@ -288,9 +288,11 @@ + const QString& output_name, + const QStringList& options, + QPrinter* printer, +- bool useFontHinting) ++ bool useFontHinting, ++ QPrinter::Orientation orientation) + : DVIExport(parent, parent_widget), +- printer_(printer) ++ printer_(printer), ++ orientation_(orientation) + { + // None of these should happen. Paranoia checks. + if (!parent.dviFile) +@@ -460,7 +462,8 @@ Okular::FilePrinter::printFile( (*printer_), output_name_, Okular::FilePrinter::ApplicationDeletesFiles, Okular::FilePrinter::ApplicationSelectsPages, - QString() ); + QString(), -+ document()->orientation() ); ++ orientation_ ); } } +diff -ur kdegraphics-4.6.3/okular/generators/dvi/dviexport.h kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviexport.h +--- kdegraphics-4.6.3/okular/generators/dvi/dviexport.h 2009-10-08 23:55:51.000000000 +0200 ++++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviexport.h 2011-06-06 01:52:08.000000000 +0200 +@@ -22,11 +22,11 @@ + #include + + #include ++#include + + + class dviRenderer; + class fontProgressDialog; +-class QPrinter; + class KProcess; + class QStringList; + +@@ -124,13 +124,15 @@ + * passed to the external process's argv command line. + * @param printer having generated the PostScript file, it is passed + * to @c printer (if not null). ++ * @param orientation the original orientation of the document + */ + DVIExportToPS(dviRenderer& parent, + QWidget* parent_widget, + const QString& output_name, + const QStringList& options, + QPrinter* printer, +- bool useFontHinting); ++ bool useFontHinting, ++ QPrinter::Orientation orientation = QPrinter::Portrait); + + private: + virtual void abort_process_impl(); +@@ -139,6 +141,7 @@ + QPrinter* printer_; + QString output_name_; + QString tmpfile_name_; ++ QPrinter::Orientation orientation_; + }; + + #endif +diff -ur kdegraphics-4.6.3/okular/generators/dvi/dviRenderer.cpp kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviRenderer.cpp +--- kdegraphics-4.6.3/okular/generators/dvi/dviRenderer.cpp 2009-10-08 23:55:51.000000000 +0200 ++++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviRenderer.cpp 2011-06-06 01:52:08.000000000 +0200 +@@ -767,9 +767,9 @@ + } + + +-void dviRenderer::exportPS(const QString& fname, const QStringList& options, QPrinter* printer) ++void dviRenderer::exportPS(const QString& fname, const QStringList& options, QPrinter* printer, QPrinter::Orientation orientation) + { +- KSharedPtr exporter(new DVIExportToPS(*this, parentWidget, fname, options, printer, font_pool.getUseFontHints())); ++ KSharedPtr exporter(new DVIExportToPS(*this, parentWidget, fname, options, printer, font_pool.getUseFontHints(), orientation)); + if (exporter->started()) + all_exports_[exporter.data()] = exporter; + } +diff -ur kdegraphics-4.6.3/okular/generators/dvi/dviRenderer.h kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviRenderer.h +--- kdegraphics-4.6.3/okular/generators/dvi/dviRenderer.h 2010-01-20 23:42:01.000000000 +0100 ++++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/dviRenderer.h 2011-06-06 01:52:08.000000000 +0200 +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + + class Anchor; + class DocumentWidget; +@@ -37,7 +38,6 @@ + class ghostscript_interface; + //class infoDialog; + class QEventLoop; +-class QPrinter; + class KProgressDialog; + class PreBookmark; + class TeXFontDefinition; +@@ -154,7 +154,7 @@ + //void editor_finished(const DVISourceEditor*); + + public slots: +- void exportPS(const QString& fname = QString(), const QStringList& options = QStringList(), QPrinter* printer = 0); ++ void exportPS(const QString& fname = QString(), const QStringList& options = QStringList(), QPrinter* printer = 0, QPrinter::Orientation orientation = QPrinter::Portrait); + void exportPDF(); + + //void showInfo(); +diff -ur kdegraphics-4.6.3/okular/generators/dvi/generator_dvi.cpp kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/generator_dvi.cpp +--- kdegraphics-4.6.3/okular/generators/dvi/generator_dvi.cpp 2010-07-28 17:00:52.000000000 +0200 ++++ kdegraphics-4.6.3-okular-landscape/okular/generators/dvi/generator_dvi.cpp 2011-06-06 01:52:08.000000000 +0200 +@@ -567,7 +567,7 @@ + + QEventLoop el; + m_dviRenderer->setEventLoop( &el ); +- m_dviRenderer->exportPS( tf.fileName(), printOptions, &printer ); ++ m_dviRenderer->exportPS( tf.fileName(), printOptions, &printer, document()->orientation() ); + + tf.close(); + diff -ur kdegraphics-4.6.3/okular/generators/poppler/generator_pdf.cpp kdegraphics-4.6.3-okular-landscape/okular/generators/poppler/generator_pdf.cpp --- kdegraphics-4.6.3/okular/generators/poppler/generator_pdf.cpp 2011-03-31 22:02:04.000000000 +0200 +++ kdegraphics-4.6.3-okular-landscape/okular/generators/poppler/generator_pdf.cpp 2011-06-06 01:07:43.000000000 +0200