mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-20 16:31:29 +00:00
merged 428172:429295
svn path=/branches/work/kde4/kdegraphics/kdvi/; revision=429298
This commit is contained in:
commit
62aec651dc
|
@ -551,14 +551,10 @@ bool dviRenderer::setFile(const QString &fname)
|
|||
|
||||
|
||||
// Generate the list of bookmarks
|
||||
kdError() << "========================================================" << endl;
|
||||
|
||||
QPtrStack<Bookmark> stack;
|
||||
stack.setAutoDelete (false);
|
||||
|
||||
QValueVector<PreBookmark>::iterator it;
|
||||
for( it = prebookmarks.begin(); it != prebookmarks.end(); ++it ) {
|
||||
kdError() << (*it).title << " has an count " << (*it).noOfChildren << endl;
|
||||
Bookmark *bmk = new Bookmark((*it).title, findAnchor((*it).anchorName));
|
||||
if (stack.isEmpty())
|
||||
bookmarks.append(bmk);
|
||||
|
@ -568,7 +564,6 @@ bool dviRenderer::setFile(const QString &fname)
|
|||
}
|
||||
for(int i=0; i<(*it).noOfChildren; i++)
|
||||
stack.push(bmk);
|
||||
|
||||
}
|
||||
prebookmarks.clear();
|
||||
|
||||
|
@ -723,24 +718,6 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen
|
|||
kdDebug(4300) << "Source hyperlink to " << currentDVIPage->sourceHyperLinkList[i].linkText << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// QString cp = linkText;
|
||||
// int max = cp.length();
|
||||
// int i;
|
||||
// for(i=0; i<max; i++)
|
||||
// if (cp[i].isDigit() == false)
|
||||
// break;
|
||||
//
|
||||
// // The macro-package srcltx gives a special like "src:99 test.tex"
|
||||
// // while MikTeX gives "src:99test.tex". KDVI tries
|
||||
// // to understand both.
|
||||
// QFileInfo fi1(dviFile->filename);
|
||||
// QFileInfo fi2(fi1.dir(),cp.mid(i+1));
|
||||
//
|
||||
// //Sometimes the filename is passed without the .tex extension,
|
||||
// //better add it when necessary.
|
||||
// if ( !fi2.exists() )
|
||||
// fi2.setFile(fi2.absFilePath() + ".tex");
|
||||
|
||||
DVI_SourceFileSplitter splitter(linkText, dviFile->filename);
|
||||
QString TeXfile = splitter.filePath();
|
||||
|
@ -817,4 +794,35 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen
|
|||
}
|
||||
|
||||
|
||||
QString dviRenderer::PDFencodingToQString(QString pdfstring)
|
||||
{
|
||||
// This method locates special PDF characters in a string and
|
||||
// replaces them by UTF8. See Section 3.2.3 of the PDF reference
|
||||
// guide for information.
|
||||
pdfstring = pdfstring.replace("\\n", "\n");
|
||||
pdfstring = pdfstring.replace("\\r", "\n");
|
||||
pdfstring = pdfstring.replace("\\t", "\t");
|
||||
pdfstring = pdfstring.replace("\\f", "\f");
|
||||
pdfstring = pdfstring.replace("\\(", "(");
|
||||
pdfstring = pdfstring.replace("\\)", ")");
|
||||
pdfstring = pdfstring.replace("\\\\", "\\");
|
||||
|
||||
// Now replace octal character codes with the characters they encode
|
||||
int pos;
|
||||
QRegExp rx( "(\\\\)(\\d\\d\\d)" ); // matches "\xyz" where x,y,z are numbers
|
||||
while((pos = rx.search( pdfstring )) != -1) {
|
||||
pdfstring = pdfstring.replace(pos, 4, QChar(rx.cap(2).toInt(0,8)));
|
||||
}
|
||||
rx.setPattern( "(\\\\)(\\d\\d)" ); // matches "\xy" where x,y are numbers
|
||||
while((pos = rx.search( pdfstring )) != -1) {
|
||||
pdfstring = pdfstring.replace(pos, 3, QChar(rx.cap(2).toInt(0,8)));
|
||||
}
|
||||
rx.setPattern( "(\\\\)(\\d)" ); // matches "\x" where x is a number
|
||||
while((pos = rx.search( pdfstring )) != -1) {
|
||||
pdfstring = pdfstring.replace(pos, 4, QChar(rx.cap(2).toInt(0,8)));
|
||||
}
|
||||
return pdfstring;
|
||||
}
|
||||
|
||||
|
||||
#include "dviRenderer.moc"
|
||||
|
|
|
@ -170,6 +170,11 @@ private slots:
|
|||
void showThatSourceInformationIsPresent(void);
|
||||
|
||||
private:
|
||||
/* This method locates special PDF characters in a string and
|
||||
replaces them by UTF8. See Section 3.2.3 of the PDF reference
|
||||
guide for information */
|
||||
QString PDFencodingToQString(QString pdfstring);
|
||||
|
||||
void setResolution(double resolution_in_DPI);
|
||||
|
||||
fontPool font_pool;
|
||||
|
|
|
@ -344,7 +344,7 @@ void dviRenderer::prescan_ParsePSSpecial(QString cp)
|
|||
}
|
||||
// The PostScript code defines a bookmark
|
||||
if (cp.contains("/Dest") && cp.contains("/Title"))
|
||||
prebookmarks.append(PreBookmark(cp.section('(', 2, 2).section(')', 0, 0),
|
||||
prebookmarks.append(PreBookmark(PDFencodingToQString(cp.section('(', 2, 2).section(')', 0, 0)),
|
||||
cp.section('(', 1, 1).section(')', 0, 0),
|
||||
cp.section('-', 1, 1).section(' ', 0, 0).toUInt()
|
||||
));
|
||||
|
|
|
@ -18,6 +18,7 @@ GenericName[es]=Visor de documentos DVI
|
|||
GenericName[et]=DVI failide vaataja
|
||||
GenericName[fi]=DVI-näytin
|
||||
GenericName[fr]=Afficheur DVI
|
||||
GenericName[ga]=Amharcán DVI
|
||||
GenericName[gl]=Visor de DVI
|
||||
GenericName[he]=מציג DVI
|
||||
GenericName[hi]=डीवीआई प्रदर्शक
|
||||
|
|
|
@ -36,7 +36,7 @@ optionDialogSpecialWidget::optionDialogSpecialWidget( QWidget* parent, const ch
|
|||
editorDescriptionString += i18n("Click 'Help' to learn how to set up Emacs.");
|
||||
|
||||
editorNameString += "Kate";
|
||||
editorCommandString += "kate --line %l %f";
|
||||
editorCommandString += "kate --use --line %l %f";
|
||||
editorDescriptionString += i18n("Kate perfectly supports inverse search.");
|
||||
|
||||
editorNameString += "Kile";
|
||||
|
|
Loading…
Reference in a new issue