Make sure string passed to -J is no more than 255 bytes

lpr refuses to print referencing http://tools.ietf.org/search/rfc2911#section-4.1.2
Unfortunately cutting at 255 bytes may mess up the end of the name, but oh well
BUGS: 326617
FIXED-IN: 4.11.5
This commit is contained in:
Albert Astals Cid 2013-12-15 23:44:51 +01:00
parent 55011e0588
commit 5dfffec650

View File

@ -430,7 +430,8 @@ QStringList FilePrinter::jobname( QPrinter &printer, const QString &version )
}
if ( version.startsWith( "lpr" ) ) {
return QStringList("-J") << printer.docName();
const QString shortenedDocName = QString::fromUtf8(printer.docName().toUtf8().left(255));
return QStringList("-J") << shortenedDocName;
}
}