mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-12 19:02:40 +00:00
fixes problem with PS header inclusion
svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=504473
This commit is contained in:
parent
3aead09295
commit
fb0b66bbf1
|
@ -19,6 +19,7 @@
|
|||
#include <klocale.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kmimetype.h>
|
||||
#include <kprocio.h>
|
||||
#include <kprogressbar.h>
|
||||
|
||||
#include <Q3MemArray>
|
||||
|
@ -282,8 +283,20 @@ void dviRenderer::prescan_ParsePSHeaderSpecial(const QString& cp)
|
|||
kdDebug(kvs::dvi) << "PostScript-special, header " << cp.latin1() << endl;
|
||||
#endif
|
||||
|
||||
if (QFile::exists(cp))
|
||||
PS_interface->PostScriptHeaderString->append( QString(" (%1) run\n").arg(cp) );
|
||||
QString _file = cp;
|
||||
|
||||
// If the file is not found in the current directory, use kpsewhich
|
||||
// to find it.
|
||||
if (!QFile::exists(_file)) {
|
||||
// Otherwise, use kpsewhich to find the eps file.
|
||||
KProcIO proc;
|
||||
proc << "kpsewhich" << cp;
|
||||
proc.start(KProcess::Block);
|
||||
proc.readln(_file);
|
||||
}
|
||||
|
||||
if (QFile::exists(_file))
|
||||
PS_interface->PostScriptHeaderString->append( QString(" (%1) run\n").arg(_file) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -303,7 +316,6 @@ void dviRenderer::prescan_ParsePSQuoteSpecial(const QString& cp)
|
|||
{
|
||||
#ifdef DEBUG_PRESCAN
|
||||
kdError(kvs::dvi) << "PostScript-special, literal PostScript " << cp.latin1() << endl;
|
||||
|
||||
#endif
|
||||
|
||||
double PS_H = (currinf.data.dvi_h*300.0)/(65536*1200)-300;
|
||||
|
|
|
@ -692,6 +692,7 @@ void dviRenderer::applicationDoSpecial(char *cp)
|
|||
(strncasecmp(cp, "html:<A name=", 13) == 0) ||
|
||||
(strncasecmp(cp, "ps:", 3) == 0) ||
|
||||
(strncasecmp(cp, "papersize", 9) == 0) ||
|
||||
(strncasecmp(cp, "header", 6) == 0) ||
|
||||
(strncasecmp(cp, "background", 10) == 0) )
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue