|
From: Tapio V. <aa...@us...> - 2011-03-15 18:18:12
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 15 20:17:11 2011 +0200
Preserve tailing whitespace in US TXT import (for wording).
---
songparser-txt.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/songparser-txt.cc b/songparser-txt.cc
index 526fc0e..64a12ac 100644
--- a/songparser-txt.cc
+++ b/songparser-txt.cc
@@ -67,7 +67,11 @@ bool SongParser::txtParseField(QString const& line) {
bool SongParser::txtParseNote(QString line, VocalTrack &vocal) {
if (line.isEmpty() || line == "\r") return true;
- line = line.trimmed();
+ // Trim leading whitespace (after is preserved for word breaking purposes)
+ while (line[0].isSpace()) {
+ line = line.mid(1);
+ if (line.isEmpty()) return true;
+ }
if (line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if (line[0] == 'E') return false;
QTextStream iss(&line);
|