diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-06-11 20:11:45 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-06-11 20:11:45 +0000 |
| commit | 2aecee81cb9bd4253cd9c10b84d643ed244143dc (patch) | |
| tree | 65bd015bae7d978093feb1f2d99b6ed81b180969 /utils/themeeditor/skindocument.cpp | |
| parent | 1727c9918fc912ea0031a9cf4bc0953347a1ceab (diff) | |
| download | rockbox-2aecee81cb9bd4253cd9c10b84d643ed244143dc.zip rockbox-2aecee81cb9bd4253cd9c10b84d643ed244143dc.tar.gz rockbox-2aecee81cb9bd4253cd9c10b84d643ed244143dc.tar.bz2 rockbox-2aecee81cb9bd4253cd9c10b84d643ed244143dc.tar.xz | |
Theme Editor: Made editor highlight all errors in a document, not just the first one
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26795 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/skindocument.cpp')
| -rw-r--r-- | utils/themeeditor/skindocument.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp index 8547aaf..93c2f65 100644 --- a/utils/themeeditor/skindocument.cpp +++ b/utils/themeeditor/skindocument.cpp @@ -175,17 +175,28 @@ void SkinDocument::codeChanged() editor->addError(skin_error_line()); /* Now we're going to attempt parsing again at each line, until we find - one that won't error out + one that won't error out*/ QTextDocument doc(editor->document()->toPlainText()); - if(skin_error_line() > 0) + int base = 0; + while(skin_error_line() > 0 && !doc.isEmpty()) { QTextCursor rest(&doc); for(int i = 0; i < skin_error_line(); i++) rest.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor); - rest.clearSelection(); - }*/ + if(skin_error_line() == doc.blockCount()) + rest.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + + rest.removeSelectedText(); + base += skin_error_line(); + + skin_parse(doc.toPlainText().toAscii()); + + if(skin_error_line() > 0) + editor->addError(base + skin_error_line()); + + } } if(editor->document()->toPlainText() != saved) |