From 4e6abbf318e8cd5965ed5d390f6ca55d384867f2 Mon Sep 17 00:00:00 2001 From: bieber Date: Fri, 11 Jun 2010 20:11:45 +0000 Subject: [PATCH] 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 --- utils/themeeditor/skindocument.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp index 8547aafa1..93c2f6531 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) -- 2.11.4.GIT