C++: optionally let the highlighter handle ifdefed-out blocks.

Change-Id: I38cc0e55348cac0245d2ab8f3e39c68de76e3e6d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-08-09 11:43:20 +02:00
committed by Nikolai Kosjar
parent 480f7c09fc
commit 073e5d6632
10 changed files with 67 additions and 22 deletions

View File

@@ -5416,7 +5416,7 @@ QString BaseTextEditorWidget::extraSelectionTooltip(int pos) const
}
// the blocks list must be sorted
void BaseTextEditorWidget::setIfdefedOutBlocks(const QList<BaseTextEditorWidget::BlockRange> &blocks)
void BaseTextEditorWidget::setIfdefedOutBlocks(const QList<BlockRange> &blocks)
{
QTextDocument *doc = document();
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
@@ -5433,11 +5433,12 @@ void BaseTextEditorWidget::setIfdefedOutBlocks(const QList<BaseTextEditorWidget:
bool set = false;
if (rangeNumber < blocks.size()) {
const BlockRange &range = blocks.at(rangeNumber);
if (block.position() >= range.first && ((block.position() + block.length() - 1) <= range.last || !range.last))
if (block.position() >= range.first()
&& ((block.position() + block.length() - 1) <= range.last() || !range.last()))
set = BaseTextDocumentLayout::setIfdefedOut(block);
else
cleared = BaseTextDocumentLayout::clearIfdefedOut(block);
if (block.contains(range.last))
if (block.contains(range.last()))
++rangeNumber;
} else {
cleared = BaseTextDocumentLayout::clearIfdefedOut(block);