Git commit d0ecab47368288ec00318dccb6dfcd9fc79a8e8b by Patrick Spendrin. Committed on 28/12/2015 at 21:48. Pushed by sengels into branch 'frameworks'. Windows string fixes This patch changes multiline QStringLiterals to QString::fromLatin1 as QStringLiterals doesn't understand multiline strings on windows. Also, strncasecmp is replaced by the portable qstrnicmp function provided by QByteArray header. REVIEW: 126379 M +11 -10 generators/dvi/dviRenderer_prescan.cpp M +1 -1 generators/dvi/psgs.cpp M +14 -14 generators/dvi/special.cpp M +1 -1 generators/epub/converter.cpp M +1 -1 ui/latexrenderer.cpp M +1 -1 ui/pageview.cpp http://commits.kde.org/okular/d0ecab47368288ec00318dccb6dfcd9fc79a8e8b diff --git a/generators/dvi/dviRenderer_prescan.cpp b/generators/dvi/dviRen= derer_prescan.cpp index 783c727..bce2185 100644 --- a/generators/dvi/dviRenderer_prescan.cpp +++ b/generators/dvi/dviRenderer_prescan.cpp @@ -22,6 +22,7 @@ #include = #include +#include #include #include #include @@ -44,7 +45,7 @@ void dviRenderer::prescan_embedPS(char *cp, quint8 *begin= ningOfSpecialCommand) #endif = // Encapsulated Postscript File - if (strncasecmp(cp, "PSfile=3D", 7) !=3D 0) + if (qstrnicmp(cp, "PSfile=3D", 7) !=3D 0) return; = QString command(cp+7); @@ -230,7 +231,7 @@ void dviRenderer::prescan_removePageSizeInfo(char *cp, = quint8 *beginningOfSpecia #endif = // Encapsulated Postscript File - if (strncasecmp(cp, "papersize=3D", 10) !=3D 0) + if (qstrnicmp(cp, "papersize=3D", 10) !=3D 0) return; = for (quint8 *ptr=3DbeginningOfSpecialCommand; ptr", 9) =3D=3D 0) { + if (qstrnicmp(cp, "html:", 9) =3D=3D 0) { html_anchor_end(); return; } diff --git a/generators/dvi/psgs.cpp b/generators/dvi/psgs.cpp index b1eedc4..466e642 100644 --- a/generators/dvi/psgs.cpp +++ b/generators/dvi/psgs.cpp @@ -255,7 +255,7 @@ void ghostscript_interface::gs_generate_graphics_file(c= onst PageNumber& page, co while(proc.canReadLine()) { GSoutput =3D QString::fromLocal8Bit(proc.readLine()); if (GSoutput.contains(QStringLiteral("Unknown device"))) { - qCDebug(OkularDviDebug) << QStringLiteral("The version of ghostview in= stalled on this computer does not support " + qCDebug(OkularDviDebug) << QString::fromLatin1("The version of ghostvi= ew installed on this computer does not support " "the '%1' ghostview device driver.").= arg(*gsDevice) << endl; knownDevices.erase(gsDevice); gsDevice =3D knownDevices.begin(); diff --git a/generators/dvi/special.cpp b/generators/dvi/special.cpp index 6a9fe69..522c017 100644 --- a/generators/dvi/special.cpp +++ b/generators/dvi/special.cpp @@ -20,13 +20,13 @@ #include #include = +#include #include #include #include #include #include "debug_dvi.h" = - void dviRenderer::printErrorMsgForSpecials(const QString& msg) { if (dviFile->errorCounter < 25) { @@ -517,45 +517,45 @@ void dviRenderer::applicationDoSpecial(char *cp) // and NOT during the prescan phase = // font color specials - if (strncasecmp(cp, "color", 5) =3D=3D 0) { + if (qstrnicmp(cp, "color", 5) =3D=3D 0) { color_special(special_command.mid(5)); return; } = // HTML reference - if (strncasecmp(cp, "html:", 9) =3D=3D 0) { + if (qstrnicmp(cp, "html:", 9) =3D=3D 0) { html_anchor_end(); return; } = // TPIC specials - if (strncasecmp(cp, "pn", 2) =3D=3D 0) { + if (qstrnicmp(cp, "pn", 2) =3D=3D 0) { TPIC_setPen_special(special_command.mid(2)); return; } - if (strncasecmp(cp, "pa ", 3) =3D=3D 0) { + if (qstrnicmp(cp, "pa ", 3) =3D=3D 0) { TPIC_addPath_special(special_command.mid(3)); return; } - if (strncasecmp(cp, "fp", 2) =3D=3D 0) { + if (qstrnicmp(cp, "fp", 2) =3D=3D 0) { TPIC_flushPath_special(); return; } = // Encapsulated Postscript File - if (strncasecmp(cp, "PSfile=3D", 7) =3D=3D 0) { + if (qstrnicmp(cp, "PSfile=3D", 7) =3D=3D 0) { epsf_special(special_command.mid(7)); return; } = // source special - if (strncasecmp(cp, "src:", 4) =3D=3D 0) { + if (qstrnicmp(cp, "src:", 4) =3D=3D 0) { source_special(special_command.mid(4)); return; } @@ -694,11 +694,11 @@ void dviRenderer::applicationDoSpecial(char *cp) // unrecognized special commands. if ((cp[0] =3D=3D '!') || (cp[0] =3D=3D '"') || - (strncasecmp(cp, "html:" + const QString preHtml =3D QString::fromLatin1("= " "" "" "
").= arg(mTextDocument->padding); diff --git a/ui/latexrenderer.cpp b/ui/latexrenderer.cpp index 8e42a9f..fbc93b6 100644 --- a/ui/latexrenderer.cpp +++ b/ui/latexrenderer.cpp @@ -191,7 +191,7 @@ LatexRenderer::Error LatexRenderer::handleLatex( QStrin= g& fileName, const QStrin = bool LatexRenderer::securityCheck( const QString &latexFormula ) { - return !latexFormula.contains(QRegExp(QStringLiteral("\\\\(def|let|fut= urelet|newcommand|renewcommand|else|fi|write|input|include" + return !latexFormula.contains(QRegExp(QString::fromLatin1("\\\\(def|le= t|futurelet|newcommand|renewcommand|else|fi|write|input|include" "|chardef|catcode|makeatletter|noexpand|toksdef|every|errhelp|errorsto= pmode|scrollmode|nonstopmode|batchmode" "|read|csname|newhelp|relax|afterground|afterassignment|expandafter|no= expand|special|command|loop|repeat|toks" "|output|line|mathcode|name|item|section|mbox|DeclareRobustCommand)[^a= -zA-Z]"))); diff --git a/ui/pageview.cpp b/ui/pageview.cpp index 13727e4..ee7aad1 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -2893,7 +2893,7 @@ void PageView::mouseReleaseEvent( QMouseEvent * e ) xs.append(1.0); ys.prepend(0.0); ys.append(1.0); - selHtml =3D QStringLiteral("" + selHtml =3D QString::fromLatin1("" "" ""); for (int r=3D0; r+1