Mercurial > clickerconvert
changeset 89:80ff6591101a
Fix numVotesString containing spaces in xlsx
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 05 Oct 2016 15:44:29 +0200 |
parents | d944cc7caf2d |
children | 31a3fe08be60 |
files | src/converter.cpp src/l10n/main_de_DE.ts |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/converter.cpp Wed Oct 05 15:43:30 2016 +0200 +++ b/src/converter.cpp Wed Oct 05 15:44:29 2016 +0200 @@ -337,11 +337,14 @@ makeBar(html, percent, doc); xlsx.write(row, 2, percent == 0 ? QVariant() : percent); const QString numStr = choiceMatch.captured("num"); - const QString numVotesString = QString("%1% | %2 Number of votes"). + const QString numVotesStringHtml = QString("%1% | %2 Number of votes"). arg(percentStr.isEmpty() ? QStringLiteral("0") : percentStr, 8). arg(numStr.isEmpty() ? QStringLiteral("0") : numStr, 3); - html << mChoiceVotesStyle.arg(numVotesString); - xlsx.write(row, 3, numVotesString, mChoiceVotesFmt); + const QString numVotesStringXls = QString("%1% | %2 Number of votes"). + arg(percentStr.isEmpty() ? QStringLiteral("0") : percentStr). + arg(numStr.isEmpty() ? QStringLiteral("0") : numStr); + html << mChoiceVotesStyle.arg(numVotesStringHtml); + xlsx.write(row, 3, numVotesStringXls, mChoiceVotesFmt); xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT); /* As long as we can match a choice which is either before the next question or before the end of the document */
--- a/src/l10n/main_de_DE.ts Wed Oct 05 15:43:30 2016 +0200 +++ b/src/l10n/main_de_DE.ts Wed Oct 05 15:44:29 2016 +0200 @@ -31,12 +31,12 @@ <translation>Die Datei "%1" konnte nicht geƶffnet werden.</translation> </message> <message> - <location filename="../converter.cpp" line="467"/> + <location filename="../converter.cpp" line="470"/> <source>Failed to parse input document.</source> <translation>Fehler bei der verarbeitung des Eingabedokuments.</translation> </message> <message> - <location filename="../converter.cpp" line="501"/> + <location filename="../converter.cpp" line="504"/> <source>Saving the XLSX document failed.</source> <translation>Das erstellen des XLSX Dokuments ist fehlgeschlagen.</translation> </message>