fixes problem with PS header inclusion

svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=504473
This commit is contained in:
Stefan Kebekus 2006-02-01 09:06:05 +00:00
parent 3aead09295
commit fb0b66bbf1
2 changed files with 16 additions and 3 deletions

View file

@ -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;

View file

@ -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;