forked from qt-creator/qt-creator
Renamed TextEditDocumentLayout to BaseTextDocumentLayout
This commit is contained in:
@@ -67,11 +67,11 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
|
|
||||||
if (tokens.isEmpty()) {
|
if (tokens.isEmpty()) {
|
||||||
setCurrentBlockState(previousState);
|
setCurrentBlockState(previousState);
|
||||||
if (TextBlockUserData *userData = TextEditDocumentLayout::testUserData(currentBlock())) {
|
if (TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(currentBlock())) {
|
||||||
userData->setClosingCollapseMode(TextBlockUserData::NoClosingCollapse);
|
userData->setClosingCollapseMode(TextBlockUserData::NoClosingCollapse);
|
||||||
userData->setCollapseMode(TextBlockUserData::NoCollapse);
|
userData->setCollapseMode(TextBlockUserData::NoCollapse);
|
||||||
}
|
}
|
||||||
TextEditDocumentLayout::clearParentheses(currentBlock());
|
BaseTextDocumentLayout::clearParentheses(currentBlock());
|
||||||
if (text.length()) // the empty line can still contain whitespace
|
if (text.length()) // the empty line can still contain whitespace
|
||||||
setFormat(0, text.length(), m_formats[CppVisualWhitespace]);
|
setFormat(0, text.length(), m_formats[CppVisualWhitespace]);
|
||||||
return;
|
return;
|
||||||
@@ -177,7 +177,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, QTextCharFormat());
|
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, QTextCharFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TextBlockUserData *userData = TextEditDocumentLayout::testUserData(currentBlock())) {
|
if (TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(currentBlock())) {
|
||||||
userData->setClosingCollapseMode(TextBlockUserData::NoClosingCollapse);
|
userData->setClosingCollapseMode(TextBlockUserData::NoClosingCollapse);
|
||||||
userData->setCollapseMode(TextBlockUserData::NoCollapse);
|
userData->setCollapseMode(TextBlockUserData::NoCollapse);
|
||||||
}
|
}
|
||||||
@@ -194,13 +194,13 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
TextBlockUserData::CollapseMode collapseMode = TextBlockUserData::CollapseAfter;
|
TextBlockUserData::CollapseMode collapseMode = TextBlockUserData::CollapseAfter;
|
||||||
if (collapse == firstNonSpace && c != QLatin1Char('+'))
|
if (collapse == firstNonSpace && c != QLatin1Char('+'))
|
||||||
collapseMode = TextBlockUserData::CollapseThis;
|
collapseMode = TextBlockUserData::CollapseThis;
|
||||||
TextEditDocumentLayout::userData(currentBlock())->setCollapseMode(collapseMode);
|
BaseTextDocumentLayout::userData(currentBlock())->setCollapseMode(collapseMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int cc = Parenthesis::closeCollapseAtPos(parentheses);
|
int cc = Parenthesis::closeCollapseAtPos(parentheses);
|
||||||
if (cc >= 0) {
|
if (cc >= 0) {
|
||||||
TextBlockUserData *userData = TextEditDocumentLayout::userData(currentBlock());
|
TextBlockUserData *userData = BaseTextDocumentLayout::userData(currentBlock());
|
||||||
userData->setClosingCollapseMode(TextBlockUserData::ClosingCollapse);
|
userData->setClosingCollapseMode(TextBlockUserData::ClosingCollapse);
|
||||||
QString trailingText = text.mid(cc+1).simplified();
|
QString trailingText = text.mid(cc+1).simplified();
|
||||||
if (trailingText.isEmpty() || trailingText == QLatin1String(";")) {
|
if (trailingText.isEmpty() || trailingText == QLatin1String(";")) {
|
||||||
@@ -208,11 +208,11 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditDocumentLayout::setParentheses(currentBlock(), parentheses);
|
BaseTextDocumentLayout::setParentheses(currentBlock(), parentheses);
|
||||||
|
|
||||||
// if the block is ifdefed out, we only store the parentheses, but
|
// if the block is ifdefed out, we only store the parentheses, but
|
||||||
// do not adjust the brace depth.
|
// do not adjust the brace depth.
|
||||||
if (TextEditDocumentLayout::ifdefedOut(currentBlock()))
|
if (BaseTextDocumentLayout::ifdefedOut(currentBlock()))
|
||||||
braceDepth = initialBraceDepth;
|
braceDepth = initialBraceDepth;
|
||||||
|
|
||||||
// optimization: if only the brace depth changes, we adjust subsequent blocks
|
// optimization: if only the brace depth changes, we adjust subsequent blocks
|
||||||
@@ -225,7 +225,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
int delta = braceDepth - oldBraceDepth;
|
int delta = braceDepth - oldBraceDepth;
|
||||||
QTextBlock block = currentBlock().next();
|
QTextBlock block = currentBlock().next();
|
||||||
while (block.isValid() && block.userState() != -1) {
|
while (block.isValid() && block.userState() != -1) {
|
||||||
TextEditDocumentLayout::changeBraceDepth(block, delta);
|
BaseTextDocumentLayout::changeBraceDepth(block, delta);
|
||||||
block = block.next();
|
block = block.next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ bool DocumentMarker::addMark(TextEditor::ITextMark *mark, int line)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(line >= 1, return false);
|
QTC_ASSERT(line >= 1, return false);
|
||||||
int blockNumber = line - 1;
|
int blockNumber = line - 1;
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(document->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return false);
|
QTC_ASSERT(documentLayout, return false);
|
||||||
QTextBlock block = document->findBlockByNumber(blockNumber);
|
QTextBlock block = document->findBlockByNumber(blockNumber);
|
||||||
|
|
||||||
if (block.isValid()) {
|
if (block.isValid()) {
|
||||||
TextBlockUserData *userData = TextEditDocumentLayout::userData(block);
|
TextBlockUserData *userData = BaseTextDocumentLayout::userData(block);
|
||||||
userData->addMark(mark);
|
userData->addMark(mark);
|
||||||
mark->updateLineNumber(blockNumber + 1);
|
mark->updateLineNumber(blockNumber + 1);
|
||||||
mark->updateBlock(block);
|
mark->updateBlock(block);
|
||||||
@@ -81,7 +81,7 @@ TextEditor::TextMarks DocumentMarker::marksAt(int line) const
|
|||||||
QTextBlock block = document->findBlockByNumber(blockNumber);
|
QTextBlock block = document->findBlockByNumber(blockNumber);
|
||||||
|
|
||||||
if (block.isValid()) {
|
if (block.isValid()) {
|
||||||
if (TextBlockUserData *userData = TextEditDocumentLayout::testUserData(block))
|
if (TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(block))
|
||||||
return userData->marks();
|
return userData->marks();
|
||||||
}
|
}
|
||||||
return TextMarks();
|
return TextMarks();
|
||||||
@@ -117,7 +117,7 @@ bool DocumentMarker::hasMark(TextEditor::ITextMark *mark) const
|
|||||||
void DocumentMarker::updateMark(ITextMark *mark)
|
void DocumentMarker::updateMark(ITextMark *mark)
|
||||||
{
|
{
|
||||||
Q_UNUSED(mark)
|
Q_UNUSED(mark)
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(document->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
documentLayout->requestUpdate();
|
documentLayout->requestUpdate();
|
||||||
}
|
}
|
||||||
@@ -304,7 +304,7 @@ bool BaseTextDocument::open(const QString &fileName)
|
|||||||
m_document->setHtml(tr("<em>Binary data</em>"));
|
m_document->setHtml(tr("<em>Binary data</em>"));
|
||||||
else
|
else
|
||||||
m_document->setPlainText(text);
|
m_document->setPlainText(text);
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(m_document->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(m_document->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return true);
|
QTC_ASSERT(documentLayout, return true);
|
||||||
documentLayout->lastSaveRevision = m_document->revision();
|
documentLayout->lastSaveRevision = m_document->revision();
|
||||||
m_document->setModified(false);
|
m_document->setModified(false);
|
||||||
@@ -376,7 +376,7 @@ void BaseTextDocument::cleanWhitespace(const QTextCursor &cursor)
|
|||||||
void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument)
|
void BaseTextDocument::cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument)
|
||||||
{
|
{
|
||||||
|
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(m_document->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(m_document->documentLayout());
|
||||||
|
|
||||||
QTextBlock block = m_document->findBlock(cursor.selectionStart());
|
QTextBlock block = m_document->findBlock(cursor.selectionStart());
|
||||||
QTextBlock end;
|
QTextBlock end;
|
||||||
|
|||||||
@@ -205,10 +205,10 @@ void TextBlockUserData::doCollapse(const QTextBlock& block, bool visible)
|
|||||||
TextBlockUserData::MatchType TextBlockUserData::checkOpenParenthesis(QTextCursor *cursor, QChar c)
|
TextBlockUserData::MatchType TextBlockUserData::checkOpenParenthesis(QTextCursor *cursor, QChar c)
|
||||||
{
|
{
|
||||||
QTextBlock block = cursor->block();
|
QTextBlock block = cursor->block();
|
||||||
if (!TextEditDocumentLayout::hasParentheses(block) || TextEditDocumentLayout::ifdefedOut(block))
|
if (!BaseTextDocumentLayout::hasParentheses(block) || BaseTextDocumentLayout::ifdefedOut(block))
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
|
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
Parenthesis openParen, closedParen;
|
Parenthesis openParen, closedParen;
|
||||||
QTextBlock closedParenParag = block;
|
QTextBlock closedParenParag = block;
|
||||||
|
|
||||||
@@ -235,9 +235,9 @@ TextBlockUserData::MatchType TextBlockUserData::checkOpenParenthesis(QTextCursor
|
|||||||
closedParenParag = closedParenParag.next();
|
closedParenParag = closedParenParag.next();
|
||||||
if (!closedParenParag.isValid())
|
if (!closedParenParag.isValid())
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
if (TextEditDocumentLayout::hasParentheses(closedParenParag)
|
if (BaseTextDocumentLayout::hasParentheses(closedParenParag)
|
||||||
&& !TextEditDocumentLayout::ifdefedOut(closedParenParag)) {
|
&& !BaseTextDocumentLayout::ifdefedOut(closedParenParag)) {
|
||||||
parenList = TextEditDocumentLayout::parentheses(closedParenParag);
|
parenList = BaseTextDocumentLayout::parentheses(closedParenParag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,10 +274,10 @@ TextBlockUserData::MatchType TextBlockUserData::checkOpenParenthesis(QTextCursor
|
|||||||
TextBlockUserData::MatchType TextBlockUserData::checkClosedParenthesis(QTextCursor *cursor, QChar c)
|
TextBlockUserData::MatchType TextBlockUserData::checkClosedParenthesis(QTextCursor *cursor, QChar c)
|
||||||
{
|
{
|
||||||
QTextBlock block = cursor->block();
|
QTextBlock block = cursor->block();
|
||||||
if (!TextEditDocumentLayout::hasParentheses(block) || TextEditDocumentLayout::ifdefedOut(block))
|
if (!BaseTextDocumentLayout::hasParentheses(block) || BaseTextDocumentLayout::ifdefedOut(block))
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
|
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
Parenthesis openParen, closedParen;
|
Parenthesis openParen, closedParen;
|
||||||
QTextBlock openParenParag = block;
|
QTextBlock openParenParag = block;
|
||||||
|
|
||||||
@@ -305,9 +305,9 @@ TextBlockUserData::MatchType TextBlockUserData::checkClosedParenthesis(QTextCurs
|
|||||||
if (!openParenParag.isValid())
|
if (!openParenParag.isValid())
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
|
|
||||||
if (TextEditDocumentLayout::hasParentheses(openParenParag)
|
if (BaseTextDocumentLayout::hasParentheses(openParenParag)
|
||||||
&& !TextEditDocumentLayout::ifdefedOut(openParenParag)) {
|
&& !BaseTextDocumentLayout::ifdefedOut(openParenParag)) {
|
||||||
parenList = TextEditDocumentLayout::parentheses(openParenParag);
|
parenList = BaseTextDocumentLayout::parentheses(openParenParag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,8 +346,8 @@ bool TextBlockUserData::findPreviousOpenParenthesis(QTextCursor *cursor, bool se
|
|||||||
int position = cursor->position();
|
int position = cursor->position();
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
while (block.isValid()) {
|
while (block.isValid()) {
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = parenList.count()-1; i >= 0; --i) {
|
for (int i = parenList.count()-1; i >= 0; --i) {
|
||||||
Parenthesis paren = parenList.at(i);
|
Parenthesis paren = parenList.at(i);
|
||||||
if (block == cursor->block() &&
|
if (block == cursor->block() &&
|
||||||
@@ -374,8 +374,8 @@ bool TextBlockUserData::findPreviousBlockOpenParenthesis(QTextCursor *cursor, bo
|
|||||||
int position = cursor->position();
|
int position = cursor->position();
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
while (block.isValid()) {
|
while (block.isValid()) {
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = parenList.count()-1; i >= 0; --i) {
|
for (int i = parenList.count()-1; i >= 0; --i) {
|
||||||
Parenthesis paren = parenList.at(i);
|
Parenthesis paren = parenList.at(i);
|
||||||
if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}')
|
if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}')
|
||||||
@@ -410,8 +410,8 @@ bool TextBlockUserData::findNextClosingParenthesis(QTextCursor *cursor, bool sel
|
|||||||
int position = cursor->position();
|
int position = cursor->position();
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
while (block.isValid()) {
|
while (block.isValid()) {
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = 0; i < parenList.count(); ++i) {
|
for (int i = 0; i < parenList.count(); ++i) {
|
||||||
Parenthesis paren = parenList.at(i);
|
Parenthesis paren = parenList.at(i);
|
||||||
if (block == cursor->block() &&
|
if (block == cursor->block() &&
|
||||||
@@ -438,8 +438,8 @@ bool TextBlockUserData::findNextBlockClosingParenthesis(QTextCursor *cursor)
|
|||||||
int position = cursor->position();
|
int position = cursor->position();
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
while (block.isValid()) {
|
while (block.isValid()) {
|
||||||
Parentheses parenList = TextEditDocumentLayout::parentheses(block);
|
Parentheses parenList = BaseTextDocumentLayout::parentheses(block);
|
||||||
if (!parenList.isEmpty() && !TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = 0; i < parenList.count(); ++i) {
|
for (int i = 0; i < parenList.count(); ++i) {
|
||||||
Parenthesis paren = parenList.at(i);
|
Parenthesis paren = parenList.at(i);
|
||||||
if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}')
|
if (paren.chr != QLatin1Char('{') && paren.chr != QLatin1Char('}')
|
||||||
@@ -469,12 +469,12 @@ TextBlockUserData::MatchType TextBlockUserData::matchCursorBackward(QTextCursor
|
|||||||
cursor->clearSelection();
|
cursor->clearSelection();
|
||||||
const QTextBlock block = cursor->block();
|
const QTextBlock block = cursor->block();
|
||||||
|
|
||||||
if (!TextEditDocumentLayout::hasParentheses(block) || TextEditDocumentLayout::ifdefedOut(block))
|
if (!BaseTextDocumentLayout::hasParentheses(block) || BaseTextDocumentLayout::ifdefedOut(block))
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
|
|
||||||
const int relPos = cursor->position() - block.position();
|
const int relPos = cursor->position() - block.position();
|
||||||
|
|
||||||
Parentheses parentheses = TextEditDocumentLayout::parentheses(block);
|
Parentheses parentheses = BaseTextDocumentLayout::parentheses(block);
|
||||||
const Parentheses::const_iterator cend = parentheses.constEnd();
|
const Parentheses::const_iterator cend = parentheses.constEnd();
|
||||||
for (Parentheses::const_iterator it = parentheses.constBegin();it != cend; ++it) {
|
for (Parentheses::const_iterator it = parentheses.constBegin();it != cend; ++it) {
|
||||||
const Parenthesis &paren = *it;
|
const Parenthesis &paren = *it;
|
||||||
@@ -491,12 +491,12 @@ TextBlockUserData::MatchType TextBlockUserData::matchCursorForward(QTextCursor *
|
|||||||
cursor->clearSelection();
|
cursor->clearSelection();
|
||||||
const QTextBlock block = cursor->block();
|
const QTextBlock block = cursor->block();
|
||||||
|
|
||||||
if (!TextEditDocumentLayout::hasParentheses(block) || TextEditDocumentLayout::ifdefedOut(block))
|
if (!BaseTextDocumentLayout::hasParentheses(block) || BaseTextDocumentLayout::ifdefedOut(block))
|
||||||
return NoMatch;
|
return NoMatch;
|
||||||
|
|
||||||
const int relPos = cursor->position() - block.position();
|
const int relPos = cursor->position() - block.position();
|
||||||
|
|
||||||
Parentheses parentheses = TextEditDocumentLayout::parentheses(block);
|
Parentheses parentheses = BaseTextDocumentLayout::parentheses(block);
|
||||||
const Parentheses::const_iterator cend = parentheses.constEnd();
|
const Parentheses::const_iterator cend = parentheses.constEnd();
|
||||||
for (Parentheses::const_iterator it = parentheses.constBegin();it != cend; ++it) {
|
for (Parentheses::const_iterator it = parentheses.constBegin();it != cend; ++it) {
|
||||||
const Parenthesis &paren = *it;
|
const Parenthesis &paren = *it;
|
||||||
@@ -509,17 +509,17 @@ TextBlockUserData::MatchType TextBlockUserData::matchCursorForward(QTextCursor *
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TextEditDocumentLayout::TextEditDocumentLayout(QTextDocument *doc)
|
BaseTextDocumentLayout::BaseTextDocumentLayout(QTextDocument *doc)
|
||||||
:QPlainTextDocumentLayout(doc) {
|
:QPlainTextDocumentLayout(doc) {
|
||||||
lastSaveRevision = 0;
|
lastSaveRevision = 0;
|
||||||
hasMarks = 0;
|
hasMarks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextEditDocumentLayout::~TextEditDocumentLayout()
|
BaseTextDocumentLayout::~BaseTextDocumentLayout()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditDocumentLayout::setParentheses(const QTextBlock &block, const Parentheses &parentheses)
|
void BaseTextDocumentLayout::setParentheses(const QTextBlock &block, const Parentheses &parentheses)
|
||||||
{
|
{
|
||||||
if (parentheses.isEmpty()) {
|
if (parentheses.isEmpty()) {
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
@@ -529,47 +529,47 @@ void TextEditDocumentLayout::setParentheses(const QTextBlock &block, const Paren
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Parentheses TextEditDocumentLayout::parentheses(const QTextBlock &block)
|
Parentheses BaseTextDocumentLayout::parentheses(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
return userData->parentheses();
|
return userData->parentheses();
|
||||||
return Parentheses();
|
return Parentheses();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditDocumentLayout::hasParentheses(const QTextBlock &block)
|
bool BaseTextDocumentLayout::hasParentheses(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
return userData->hasParentheses();
|
return userData->hasParentheses();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditDocumentLayout::setIfdefedOut(const QTextBlock &block)
|
bool BaseTextDocumentLayout::setIfdefedOut(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
return userData(block)->setIfdefedOut();
|
return userData(block)->setIfdefedOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditDocumentLayout::clearIfdefedOut(const QTextBlock &block)
|
bool BaseTextDocumentLayout::clearIfdefedOut(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
return userData->clearIfdefedOut();
|
return userData->clearIfdefedOut();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextEditDocumentLayout::ifdefedOut(const QTextBlock &block)
|
bool BaseTextDocumentLayout::ifdefedOut(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
return userData->ifdefedOut();
|
return userData->ifdefedOut();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TextEditDocumentLayout::braceDepthDelta(const QTextBlock &block)
|
int BaseTextDocumentLayout::braceDepthDelta(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (TextBlockUserData *userData = testUserData(block))
|
if (TextBlockUserData *userData = testUserData(block))
|
||||||
return userData->braceDepthDelta();
|
return userData->braceDepthDelta();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TextEditDocumentLayout::braceDepth(const QTextBlock &block)
|
int BaseTextDocumentLayout::braceDepth(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
int state = block.userState();
|
int state = block.userState();
|
||||||
if (state == -1)
|
if (state == -1)
|
||||||
@@ -577,7 +577,7 @@ int TextEditDocumentLayout::braceDepth(const QTextBlock &block)
|
|||||||
return state >> 8;
|
return state >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditDocumentLayout::setBraceDepth(QTextBlock &block, int depth)
|
void BaseTextDocumentLayout::setBraceDepth(QTextBlock &block, int depth)
|
||||||
{
|
{
|
||||||
int state = block.userState();
|
int state = block.userState();
|
||||||
if (state == -1)
|
if (state == -1)
|
||||||
@@ -586,7 +586,7 @@ void TextEditDocumentLayout::setBraceDepth(QTextBlock &block, int depth)
|
|||||||
block.setUserState((depth << 8) | state);
|
block.setUserState((depth << 8) | state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditDocumentLayout::changeBraceDepth(QTextBlock &block, int delta)
|
void BaseTextDocumentLayout::changeBraceDepth(QTextBlock &block, int delta)
|
||||||
{
|
{
|
||||||
if (delta)
|
if (delta)
|
||||||
setBraceDepth(block, braceDepth(block) + delta);
|
setBraceDepth(block, braceDepth(block) + delta);
|
||||||
|
|||||||
@@ -173,13 +173,13 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TEXTEDITOR_EXPORT TextEditDocumentLayout : public QPlainTextDocumentLayout
|
class TEXTEDITOR_EXPORT BaseTextDocumentLayout : public QPlainTextDocumentLayout
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextEditDocumentLayout(QTextDocument *doc);
|
BaseTextDocumentLayout(QTextDocument *doc);
|
||||||
~TextEditDocumentLayout();
|
~BaseTextDocumentLayout();
|
||||||
|
|
||||||
static void setParentheses(const QTextBlock &block, const Parentheses &parentheses);
|
static void setParentheses(const QTextBlock &block, const Parentheses &parentheses);
|
||||||
static void clearParentheses(const QTextBlock &block) { setParentheses(block, Parentheses());}
|
static void clearParentheses(const QTextBlock &block) { setParentheses(block, Parentheses());}
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ bool BaseTextEditor::open(const QString &fileName)
|
|||||||
void BaseTextEditorPrivate::collapseLicenseHeader()
|
void BaseTextEditorPrivate::collapseLicenseHeader()
|
||||||
{
|
{
|
||||||
QTextDocument *doc = q->document();
|
QTextDocument *doc = q->document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
QTextBlock block = doc->firstBlock();
|
QTextBlock block = doc->firstBlock();
|
||||||
const TabSettings &ts = m_document->tabSettings();
|
const TabSettings &ts = m_document->tabSettings();
|
||||||
@@ -1768,7 +1768,7 @@ void BaseTextEditorPrivate::setupDocumentSignals(BaseTextDocument *document)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QTextDocument *doc = document->document();
|
QTextDocument *doc = document->document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
if (!documentLayout) {
|
if (!documentLayout) {
|
||||||
QTextOption opt = doc->defaultTextOption();
|
QTextOption opt = doc->defaultTextOption();
|
||||||
opt.setTextDirection(Qt::LeftToRight);
|
opt.setTextDirection(Qt::LeftToRight);
|
||||||
@@ -1776,7 +1776,7 @@ void BaseTextEditorPrivate::setupDocumentSignals(BaseTextDocument *document)
|
|||||||
| QTextOption::AddSpaceForLineAndParagraphSeparators
|
| QTextOption::AddSpaceForLineAndParagraphSeparators
|
||||||
);
|
);
|
||||||
doc->setDefaultTextOption(opt);
|
doc->setDefaultTextOption(opt);
|
||||||
documentLayout = new TextEditDocumentLayout(doc);
|
documentLayout = new BaseTextDocumentLayout(doc);
|
||||||
doc->setDocumentLayout(documentLayout);
|
doc->setDocumentLayout(documentLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2162,7 +2162,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
QPainter painter(viewport());
|
QPainter painter(viewport());
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
QPointF offset(contentOffset());
|
QPointF offset(contentOffset());
|
||||||
@@ -2344,7 +2344,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
if (r.bottom() >= er.top() && r.top() <= er.bottom()) {
|
if (r.bottom() >= er.top() && r.top() <= er.bottom()) {
|
||||||
|
|
||||||
if (TextEditDocumentLayout::ifdefedOut(block)) {
|
if (BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
QRectF rr = r;
|
QRectF rr = r;
|
||||||
rr.setRight(viewportRect.width() - offset.x());
|
rr.setRight(viewportRect.width() - offset.x());
|
||||||
if (lineX > 0)
|
if (lineX > 0)
|
||||||
@@ -2355,7 +2355,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
QTextLayout *layout = block.layout();
|
QTextLayout *layout = block.layout();
|
||||||
|
|
||||||
QTextOption option = layout->textOption();
|
QTextOption option = layout->textOption();
|
||||||
if (suppressSyntaxInIfdefedOutBlock && TextEditDocumentLayout::ifdefedOut(block)) {
|
if (suppressSyntaxInIfdefedOutBlock && BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
option.setFlags(option.flags() | QTextOption::SuppressColors);
|
option.setFlags(option.flags() | QTextOption::SuppressColors);
|
||||||
painter.setPen(d->m_ifdefedOutFormat.foreground().color());
|
painter.setPen(d->m_ifdefedOutFormat.foreground().color());
|
||||||
} else {
|
} else {
|
||||||
@@ -2437,7 +2437,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
}
|
}
|
||||||
rr.setRight(qMin(lineX, rr.right()));
|
rr.setRight(qMin(lineX, rr.right()));
|
||||||
}
|
}
|
||||||
if (d->m_highlightBlocksInfo.isEmpty() || TextEditDocumentLayout::ifdefedOut(block))
|
if (d->m_highlightBlocksInfo.isEmpty() || BaseTextDocumentLayout::ifdefedOut(block))
|
||||||
painter.fillRect(rr, d->m_currentLineFormat.background());
|
painter.fillRect(rr, d->m_currentLineFormat.background());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2732,7 +2732,7 @@ QWidget *BaseTextEditor::extraArea() const
|
|||||||
|
|
||||||
int BaseTextEditor::extraAreaWidth(int *markWidthPtr) const
|
int BaseTextEditor::extraAreaWidth(int *markWidthPtr) const
|
||||||
{
|
{
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(document()->documentLayout());
|
||||||
if (!documentLayout)
|
if (!documentLayout)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -2818,7 +2818,7 @@ static void drawRectBox(QPainter *painter, const QRect &rect, bool start, bool e
|
|||||||
void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
int selStart = textCursor().selectionStart();
|
int selStart = textCursor().selectionStart();
|
||||||
@@ -2933,7 +2933,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextBlockUserData *nextBlockUserData = TextEditDocumentLayout::testUserData(nextBlock);
|
TextBlockUserData *nextBlockUserData = BaseTextDocumentLayout::testUserData(nextBlock);
|
||||||
|
|
||||||
bool collapseNext = nextBlockUserData
|
bool collapseNext = nextBlockUserData
|
||||||
&& nextBlockUserData->collapseMode() == TextBlockUserData::CollapseThis
|
&& nextBlockUserData->collapseMode() == TextBlockUserData::CollapseThis
|
||||||
@@ -3072,7 +3072,7 @@ void BaseTextEditor::slotModificationChanged(bool m)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
int oldLastSaveRevision = documentLayout->lastSaveRevision;
|
int oldLastSaveRevision = documentLayout->lastSaveRevision;
|
||||||
documentLayout->lastSaveRevision = doc->revision();
|
documentLayout->lastSaveRevision = doc->revision();
|
||||||
@@ -3149,8 +3149,8 @@ void BaseTextEditor::slotCursorPositionChanged()
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
qDebug() << "block" << textCursor().blockNumber()+1
|
qDebug() << "block" << textCursor().blockNumber()+1
|
||||||
<< "depth:" << TextEditDocumentLayout::braceDepth(textCursor().block())
|
<< "depth:" << BaseTextDocumentLayout::braceDepth(textCursor().block())
|
||||||
<< '/' << TextEditDocumentLayout::braceDepth(document()->lastBlock());
|
<< '/' << BaseTextDocumentLayout::braceDepth(document()->lastBlock());
|
||||||
#endif
|
#endif
|
||||||
if (!d->m_contentsChanged && d->m_lastCursorChangeWasInteresting) {
|
if (!d->m_contentsChanged && d->m_lastCursorChangeWasInteresting) {
|
||||||
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(editableInterface(), d->m_tempNavigationState);
|
Core::EditorManager::instance()->addCurrentPositionToNavigationHistory(editableInterface(), d->m_tempNavigationState);
|
||||||
@@ -3524,7 +3524,7 @@ void BaseTextEditor::ensureCursorVisible()
|
|||||||
|
|
||||||
void BaseTextEditor::toggleBlockVisible(const QTextBlock &block)
|
void BaseTextEditor::toggleBlockVisible(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(document()->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(document()->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
bool visible = block.next().isVisible();
|
bool visible = block.next().isVisible();
|
||||||
@@ -3731,8 +3731,8 @@ void BaseTextEditor::countBrackets(QTextCursor cursor, int from, int end, QChar
|
|||||||
cursor.setPosition(from);
|
cursor.setPosition(from);
|
||||||
QTextBlock block = cursor.block();
|
QTextBlock block = cursor.block();
|
||||||
while (block.isValid() && block.position() < end) {
|
while (block.isValid() && block.position() < end) {
|
||||||
TextEditor::Parentheses parenList = TextEditor::TextEditDocumentLayout::parentheses(block);
|
TextEditor::Parentheses parenList = TextEditor::BaseTextDocumentLayout::parentheses(block);
|
||||||
if (!parenList.isEmpty() && !TextEditor::TextEditDocumentLayout::ifdefedOut(block)) {
|
if (!parenList.isEmpty() && !TextEditor::BaseTextDocumentLayout::ifdefedOut(block)) {
|
||||||
for (int i = 0; i < parenList.count(); ++i) {
|
for (int i = 0; i < parenList.count(); ++i) {
|
||||||
TextEditor::Parenthesis paren = parenList.at(i);
|
TextEditor::Parenthesis paren = parenList.at(i);
|
||||||
int position = block.position() + paren.pos;
|
int position = block.position() + paren.pos;
|
||||||
@@ -4077,7 +4077,7 @@ void BaseTextEditor::clearLink()
|
|||||||
|
|
||||||
void BaseTextEditorPrivate::updateMarksBlock(const QTextBlock &block)
|
void BaseTextEditorPrivate::updateMarksBlock(const QTextBlock &block)
|
||||||
{
|
{
|
||||||
if (const TextBlockUserData *userData = TextEditDocumentLayout::testUserData(block))
|
if (const TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(block))
|
||||||
foreach (ITextMark *mrk, userData->marks())
|
foreach (ITextMark *mrk, userData->marks())
|
||||||
mrk->updateBlock(block);
|
mrk->updateBlock(block);
|
||||||
}
|
}
|
||||||
@@ -4088,7 +4088,7 @@ void BaseTextEditorPrivate::updateMarksLineNumber()
|
|||||||
QTextBlock block = doc->begin();
|
QTextBlock block = doc->begin();
|
||||||
int blockNumber = 0;
|
int blockNumber = 0;
|
||||||
while (block.isValid()) {
|
while (block.isValid()) {
|
||||||
if (const TextBlockUserData *userData = TextEditDocumentLayout::testUserData(block))
|
if (const TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(block))
|
||||||
foreach (ITextMark *mrk, userData->marks()) {
|
foreach (ITextMark *mrk, userData->marks()) {
|
||||||
mrk->updateLineNumber(blockNumber + 1);
|
mrk->updateLineNumber(blockNumber + 1);
|
||||||
}
|
}
|
||||||
@@ -4493,7 +4493,7 @@ QString BaseTextEditor::extraSelectionTooltip(int pos) const
|
|||||||
void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange> &blocks)
|
void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange> &blocks)
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
bool needUpdate = false;
|
bool needUpdate = false;
|
||||||
@@ -4508,19 +4508,19 @@ void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange>
|
|||||||
if (rangeNumber < blocks.size()) {
|
if (rangeNumber < blocks.size()) {
|
||||||
const BlockRange &range = blocks.at(rangeNumber);
|
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 = TextEditDocumentLayout::setIfdefedOut(block);
|
set = BaseTextDocumentLayout::setIfdefedOut(block);
|
||||||
} else {
|
} else {
|
||||||
cleared = TextEditDocumentLayout::clearIfdefedOut(block);
|
cleared = BaseTextDocumentLayout::clearIfdefedOut(block);
|
||||||
}
|
}
|
||||||
if (block.contains(range.last))
|
if (block.contains(range.last))
|
||||||
++rangeNumber;
|
++rangeNumber;
|
||||||
} else {
|
} else {
|
||||||
cleared = TextEditDocumentLayout::clearIfdefedOut(block);
|
cleared = BaseTextDocumentLayout::clearIfdefedOut(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cleared || set) {
|
if (cleared || set) {
|
||||||
needUpdate = true;
|
needUpdate = true;
|
||||||
int delta = TextEditDocumentLayout::braceDepthDelta(block);
|
int delta = BaseTextDocumentLayout::braceDepthDelta(block);
|
||||||
if (cleared)
|
if (cleared)
|
||||||
braceDepthDelta += delta;
|
braceDepthDelta += delta;
|
||||||
else if (set)
|
else if (set)
|
||||||
@@ -4528,7 +4528,7 @@ void BaseTextEditor::setIfdefedOutBlocks(const QList<BaseTextEditor::BlockRange>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (braceDepthDelta)
|
if (braceDepthDelta)
|
||||||
TextEditDocumentLayout::changeBraceDepth(block,braceDepthDelta);
|
BaseTextDocumentLayout::changeBraceDepth(block,braceDepthDelta);
|
||||||
|
|
||||||
block = block.next();
|
block = block.next();
|
||||||
}
|
}
|
||||||
@@ -4802,7 +4802,7 @@ void BaseTextEditor::setStorageSettings(const StorageSettings &storageSettings)
|
|||||||
void BaseTextEditor::collapse()
|
void BaseTextEditor::collapse()
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
QTextBlock block = textCursor().block();
|
QTextBlock block = textCursor().block();
|
||||||
QTextBlock curBlock = block;
|
QTextBlock curBlock = block;
|
||||||
@@ -4826,7 +4826,7 @@ void BaseTextEditor::collapse()
|
|||||||
void BaseTextEditor::expand()
|
void BaseTextEditor::expand()
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
QTextBlock block = textCursor().block();
|
QTextBlock block = textCursor().block();
|
||||||
while (block.isValid() && !block.isVisible())
|
while (block.isValid() && !block.isVisible())
|
||||||
@@ -4840,7 +4840,7 @@ void BaseTextEditor::expand()
|
|||||||
void BaseTextEditor::unCollapseAll()
|
void BaseTextEditor::unCollapseAll()
|
||||||
{
|
{
|
||||||
QTextDocument *doc = document();
|
QTextDocument *doc = document();
|
||||||
TextEditDocumentLayout *documentLayout = qobject_cast<TextEditDocumentLayout*>(doc->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(doc->documentLayout());
|
||||||
QTC_ASSERT(documentLayout, return);
|
QTC_ASSERT(documentLayout, return);
|
||||||
|
|
||||||
QTextBlock block = doc->firstBlock();
|
QTextBlock block = doc->firstBlock();
|
||||||
|
|||||||
Reference in New Issue
Block a user