mirror of
https://github.com/fralx/LimeReport.git
synced 2025-01-12 09:31:04 +03:00
Script editor fixed
This commit is contained in:
parent
6cd3f96907
commit
0f915a9581
@ -148,6 +148,7 @@ QString CodeEditor::textUnderCursor() const
|
|||||||
bool CodeEditor::matchLeftParenthesis(QTextBlock currentBlock, QChar parenthesisType, int i, int numLeftParentheses)
|
bool CodeEditor::matchLeftParenthesis(QTextBlock currentBlock, QChar parenthesisType, int i, int numLeftParentheses)
|
||||||
{
|
{
|
||||||
TextBlockData *data = static_cast<TextBlockData *>(currentBlock.userData());
|
TextBlockData *data = static_cast<TextBlockData *>(currentBlock.userData());
|
||||||
|
if (data){
|
||||||
QVector<ParenthesisInfo *> infos = data->parentheses();
|
QVector<ParenthesisInfo *> infos = data->parentheses();
|
||||||
|
|
||||||
int docPos = currentBlock.position();
|
int docPos = currentBlock.position();
|
||||||
@ -172,6 +173,7 @@ bool CodeEditor::matchLeftParenthesis(QTextBlock currentBlock, QChar parenthesis
|
|||||||
currentBlock = currentBlock.next();
|
currentBlock = currentBlock.next();
|
||||||
if (currentBlock.isValid())
|
if (currentBlock.isValid())
|
||||||
return matchLeftParenthesis(currentBlock, parenthesisType, 0, numLeftParentheses);
|
return matchLeftParenthesis(currentBlock, parenthesisType, 0, numLeftParentheses);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -180,7 +182,7 @@ bool CodeEditor::matchRightParenthesis(QTextBlock currentBlock, QChar parenthesi
|
|||||||
{
|
{
|
||||||
TextBlockData *data = static_cast<TextBlockData *>(currentBlock.userData());
|
TextBlockData *data = static_cast<TextBlockData *>(currentBlock.userData());
|
||||||
QVector<ParenthesisInfo *> parentheses = data->parentheses();
|
QVector<ParenthesisInfo *> parentheses = data->parentheses();
|
||||||
|
if (data){
|
||||||
int docPos = currentBlock.position();
|
int docPos = currentBlock.position();
|
||||||
for (; i > -1 && parentheses.size() > 0; --i) {
|
for (; i > -1 && parentheses.size() > 0; --i) {
|
||||||
ParenthesisInfo *info = parentheses.at(i);
|
ParenthesisInfo *info = parentheses.at(i);
|
||||||
@ -201,6 +203,7 @@ bool CodeEditor::matchRightParenthesis(QTextBlock currentBlock, QChar parenthesi
|
|||||||
if (currentBlock.isValid())
|
if (currentBlock.isValid())
|
||||||
return matchRightParenthesis(currentBlock, parenthesisType, 0, numRightParentheses);
|
return matchRightParenthesis(currentBlock, parenthesisType, 0, numRightParentheses);
|
||||||
|
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user