Commit 953cdb97 authored by hjk's avatar hjk

TextEditor: More BaseText* -> Text* renamings

*Document* and *Layout* classes, all basetext* files

Change-Id: I1c6e376733a434fcb5c7f19c6210dfa031eeafde
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 4edc6896
......@@ -32,7 +32,7 @@
#include "analyzerconstants.h"
#include <cpptools/cppmodelmanager.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/qtcassert.h>
......
......@@ -30,7 +30,7 @@
#ifndef ANDROIDMANIFESTDOCUMENT_H
#define ANDROIDMANIFESTDOCUMENT_H
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
namespace Android {
namespace Internal {
......
......@@ -34,7 +34,7 @@
#include "androidmanifesteditorwidget.h"
#include <coreplugin/editormanager/ieditor.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
QT_BEGIN_NAMESPACE
class QToolBar;
......
......@@ -47,7 +47,7 @@
#include <projectexplorer/kitinformation.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/algorithm.h>
#include <QLineEdit>
......
......@@ -30,7 +30,7 @@
#ifndef ANDROIDMANIFESTEDITORWIDGET_H
#define ANDROIDMANIFESTEDITORWIDGET_H
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QAbstractListModel>
#include <QStackedWidget>
......
......@@ -33,8 +33,8 @@
#include "androidconstants.h"
#include "javacompletionassistprovider.h"
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <utils/uncommentselection.h>
#include <coreplugin/editormanager/ieditorfactory.h>
......
......@@ -30,7 +30,7 @@
#ifndef JAVAEDITOR_H
#define JAVAEDITOR_H
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
namespace Android {
namespace Internal {
......
......@@ -45,9 +45,9 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <diffeditor/differ.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/textdocument.h>
#include <texteditor/textdocumentlayout.h>
#include <texteditor/texteditor.h>
#include <texteditor/texteditorconstants.h>
#include <utils/fileutils.h>
#include <utils/QtConcurrentTools>
......@@ -288,7 +288,7 @@ void BeautifierPlugin::formatCurrentFileContinue(QObject *watcher)
if (const TextBlockUserData *userdata = static_cast<TextBlockUserData *>(block.userData())) {
if (userdata->folded()) {
foldedBlocks << block.blockNumber();
BaseTextDocumentLayout::doFoldOrUnfold(block, true);
TextDocumentLayout::doFoldOrUnfold(block, true);
}
}
block = block.next();
......@@ -386,7 +386,7 @@ void BeautifierPlugin::formatCurrentFileContinue(QObject *watcher)
for (int i = 0; i < total; ++i) {
QTextBlock block = doc->findBlockByNumber(qMax(0, foldedBlocks.at(i)));
if (block.isValid())
BaseTextDocumentLayout::doFoldOrUnfold(block, false);
TextDocumentLayout::doFoldOrUnfold(block, false);
}
textEditor->document()->setModified(true);
......
......@@ -47,7 +47,7 @@
#include <coreplugin/icore.h>
#include <coreplugin/idocument.h>
#include <cppeditor/cppeditorconstants.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QAction>
#include <QMenu>
......
......@@ -39,7 +39,7 @@
#include <coreplugin/actionmanager/command.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/tooltip/tooltip.h>
#include <utils/tooltip/tipcontents.h>
#include <utils/qtcassert.h>
......
......@@ -34,7 +34,7 @@
#include <coreplugin/icontext.h>
#include <coreplugin/inavigationwidgetfactory.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QAbstractItemModel>
#include <QMultiMap>
......
......@@ -40,7 +40,7 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/id.h>
#include <extensionsystem/pluginmanager.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/texteditorconstants.h>
#include <QtPlugin>
......
......@@ -46,7 +46,7 @@
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppworkingcopy.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/convenience.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/assistproposalitem.h>
......
......@@ -36,8 +36,8 @@
#include <cpptools/cppcompletionassist.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/codeassist/genericproposalmodel.h>
......
......@@ -36,7 +36,7 @@
#include <QObject>
#include <QTextDocument>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <cplusplus/CppDocument.h>
namespace TextEditor { class IAssistProposal; }
......
......@@ -41,7 +41,7 @@
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QThread>
#include <QMutex>
......
......@@ -71,7 +71,7 @@ CMakeEditor::CMakeEditor()
void CMakeEditor::finalizeInitialization()
{
connect(document(), &IDocument::changed, [this]() {
TextDocument *document = textDocument();
BaseTextDocument *document = textDocument();
if (!document->isModified())
return;
InfoBar *infoBar = document->infoBar();
......
......@@ -30,8 +30,8 @@
#ifndef CMAKEEDITOR_H
#define CMAKEEDITOR_H
#include <texteditor/basetextdocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
namespace CMakeProjectManager {
namespace Internal {
......
......@@ -48,10 +48,10 @@ enum { debug = 0 };
namespace Core {
namespace Internal {
class BaseTextDocumentPrivate
class TextDocumentPrivate
{
public:
BaseTextDocumentPrivate() : m_readResult(Utils::TextFileFormat::ReadSuccess) {}
TextDocumentPrivate() : m_readResult(Utils::TextFileFormat::ReadSuccess) {}
Utils::TextFileFormat m_format;
Utils::TextFileFormat::ReadResult m_readResult;
......@@ -61,7 +61,7 @@ public:
} // namespace Internal
BaseTextDocument::BaseTextDocument(QObject *parent) :
IDocument(parent), d(new Internal::BaseTextDocumentPrivate)
IDocument(parent), d(new Internal::TextDocumentPrivate)
{
setCodec(Core::EditorManager::defaultTextCodec());
}
......
......@@ -36,7 +36,7 @@
namespace Core {
namespace Internal { class BaseTextDocumentPrivate; }
namespace Internal { class TextDocumentPrivate; }
class CORE_EXPORT BaseTextDocument : public IDocument
{
......@@ -64,7 +64,7 @@ public:
bool write(const QString &fileName, const Utils::TextFileFormat &format, const QString &data, QString *errorMessage) const;
private:
Internal::BaseTextDocumentPrivate *d;
Internal::TextDocumentPrivate *d;
};
} // namespace Core
......
......@@ -50,7 +50,7 @@
#include <coreplugin/messagemanager.h>
#include <utils/qtcassert.h>
#include <utils/fileutils.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QtPlugin>
#include <QDebug>
......
......@@ -33,7 +33,7 @@
#include <cpptools/cpptoolssettings.h>
#include <cpptools/doxygengenerator.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QDebug>
#include <QKeyEvent>
......
......@@ -58,8 +58,8 @@
#include <cpptools/cppworkingcopy.h>
#include <cpptools/symbolfinder.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/textdocument.h>
#include <texteditor/textdocumentlayout.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/genericproposal.h>
......@@ -706,7 +706,7 @@ void CppEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
d->m_declDefLink = link;
IDocument *targetDocument = DocumentModel::documentForFilePath( d->m_declDefLink->targetFile->fileName());
if (textDocument() != targetDocument) {
if (auto textDocument = qobject_cast<TextDocument *>(targetDocument))
if (auto textDocument = qobject_cast<BaseTextDocument *>(targetDocument))
connect(textDocument, SIGNAL(contentsChanged()),
this, SLOT(abortDeclDefLink()));
}
......@@ -741,7 +741,7 @@ void CppEditorWidget::abortDeclDefLink()
IDocument *targetDocument = DocumentModel::documentForFilePath(d->m_declDefLink->targetFile->fileName());
if (textDocument() != targetDocument) {
if (auto textDocument = qobject_cast<TextDocument *>(targetDocument))
if (auto textDocument = qobject_cast<BaseTextDocument *>(targetDocument))
disconnect(textDocument, SIGNAL(contentsChanged()),
this, SLOT(abortDeclDefLink()));
}
......
......@@ -32,7 +32,7 @@
#include "cppfunctiondecldeflink.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <QScopedPointer>
......
......@@ -36,7 +36,7 @@
#include <cpptools/cppsemanticinfo.h>
#include <cpptools/editordocumenthandle.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/textdocument.h>
#include <QMutex>
#include <QTimer>
......
......@@ -31,7 +31,7 @@
#define CPPELEMENTEVALUATOR_H
#include <cpptools/symbolfinder.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/helpitem.h>
#include <QString>
......
......@@ -42,7 +42,7 @@
#include <cpptools/functionutils.h>
#include <cpptools/cpptoolsreuse.h>
#include <cpptools/symbolfinder.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/textdocumentlayout.h>
#include <utils/qtcassert.h>
#include <QList>
......
......@@ -32,7 +32,7 @@
#define CPPFOLLOWSYMBOLUNDERCURSOR_H
#include <cplusplus/CppDocument.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
QT_BEGIN_NAMESPACE
class QTextCursor;
......
......@@ -32,7 +32,7 @@
#include <cpptools/cppdoxygen.h>
#include <cpptools/cpptoolsreuse.h>
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/textdocumentlayout.h>
#include <cplusplus/SimpleLexer.h>
#include <cplusplus/Lexer.h>
......@@ -89,7 +89,7 @@ void CppHighlighter::highlightBlock(const QString &text)
initialLexerState &= ~0x80; // discard newline expected bit
int foldingIndent = initialBraceDepth;
if (TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(currentBlock())) {
if (TextBlockUserData *userData = TextDocumentLayout::testUserData(currentBlock())) {
userData->setFoldingIndent(0);
userData->setFoldingStartIncluded(false);
userData->setFoldingEndIncluded(false);
......@@ -97,7 +97,7 @@ void CppHighlighter::highlightBlock(const QString &text)
if (tokens.isEmpty()) {
setCurrentBlockState((braceDepth << 8) | lexerState);
BaseTextDocumentLayout::clearParentheses(currentBlock());
TextDocumentLayout::clearParentheses(currentBlock());
if (text.length()) {// the empty line can still contain whitespace
if (initialLexerState == T_COMMENT)
highlightLine(text, 0, text.length(), formatForCategory(CppCommentFormat));
......@@ -106,7 +106,7 @@ void CppHighlighter::highlightBlock(const QString &text)
else
setFormat(0, text.length(), formatForCategory(CppVisualWhitespace));
}
BaseTextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
return;
}
......@@ -144,7 +144,7 @@ void CppHighlighter::highlightBlock(const QString &text)
// as if it were inside the folding block
if (tk.utf16charsBegin() == firstNonSpace) {
++foldingIndent;
BaseTextDocumentLayout::userData(currentBlock())->setFoldingStartIncluded(true);
TextDocumentLayout::userData(currentBlock())->setFoldingStartIncluded(true);
}
}
} else if (tk.is(T_RPAREN) || tk.is(T_RBRACE) || tk.is(T_RBRACKET)) {
......@@ -155,7 +155,7 @@ void CppHighlighter::highlightBlock(const QString &text)
if (braceDepth < foldingIndent) {
// unless we are at the end of the block, we reduce the folding indent
if (i == tokens.size()-1 || tokens.at(i+1).is(T_SEMICOLON))
BaseTextDocumentLayout::userData(currentBlock())->setFoldingEndIncluded(true);
TextDocumentLayout::userData(currentBlock())->setFoldingEndIncluded(true);
else
foldingIndent = qMin(braceDepth, foldingIndent);
}
......@@ -207,7 +207,7 @@ void CppHighlighter::highlightBlock(const QString &text)
--braceDepth;
// unless we are at the end of the block, we reduce the folding indent
if (i == tokens.size()-1)
BaseTextDocumentLayout::userData(currentBlock())->setFoldingEndIncluded(true);
TextDocumentLayout::userData(currentBlock())->setFoldingEndIncluded(true);
else
foldingIndent = qMin(braceDepth, foldingIndent);
const int tokenEnd = tk.utf16charsBegin() + tk.utf16chars() - 1;
......@@ -248,17 +248,17 @@ void CppHighlighter::highlightBlock(const QString &text)
}
}
BaseTextDocumentLayout::setParentheses(currentBlock(), parentheses);
TextDocumentLayout::setParentheses(currentBlock(), parentheses);
// if the block is ifdefed out, we only store the parentheses, but
// do not adjust the brace depth.
if (BaseTextDocumentLayout::ifdefedOut(currentBlock())) {
if (TextDocumentLayout::ifdefedOut(currentBlock())) {
braceDepth = initialBraceDepth;
foldingIndent = initialBraceDepth;
}
BaseTextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
TextDocumentLayout::setFoldingIndent(currentBlock(), foldingIndent);
// optimization: if only the brace depth changes, we adjust subsequent blocks
// to have QSyntaxHighlighter stop the rehighlighting
......@@ -267,13 +267,13 @@ void CppHighlighter::highlightBlock(const QString &text)
int oldState = currentState & 0xff;
int oldBraceDepth = currentState >> 8;
if (oldState == tokenize.state() && oldBraceDepth != braceDepth) {
BaseTextDocumentLayout::FoldValidator foldValidor;
foldValidor.setup(qobject_cast<BaseTextDocumentLayout *>(document()->documentLayout()));
TextDocumentLayout::FoldValidator foldValidor;
foldValidor.setup(qobject_cast<TextDocumentLayout *>(document()->documentLayout()));
int delta = braceDepth - oldBraceDepth;
QTextBlock block = currentBlock().next();
while (block.isValid() && block.userState() != -1) {
BaseTextDocumentLayout::changeBraceDepth(block, delta);
BaseTextDocumentLayout::changeFoldingIndent(block, delta);
TextDocumentLayout::changeBraceDepth(block, delta);
TextDocumentLayout::changeFoldingIndent(block, delta);
foldValidor.process(block);
block = block.next();
}
......
......@@ -33,7 +33,7 @@
#include "cppelementevaluator.h"
#include <coreplugin/helpmanager.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/qtcassert.h>
......
......@@ -35,7 +35,7 @@
#include <cpptools/builtineditordocumentparser.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/editordocumenthandle.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <cplusplus/CppDocument.h>
......
......@@ -29,7 +29,7 @@
#include "cpplocalrenaming.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/fontsettings.h>
#include <utils/qtcassert.h>
......
......@@ -35,7 +35,7 @@
#include <cpptools/cpplocalsymbols.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolsreuse.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/convenience.h>
#include <texteditor/fontsettings.h>
......
......@@ -30,7 +30,7 @@
#ifndef CPPVIRTUALFUNCTIONPROPOSALITEM_H
#define CPPVIRTUALFUNCTIONPROPOSALITEM_H
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/codeassist/assistproposalitem.h>
namespace CppEditor {
......
......@@ -41,7 +41,7 @@
#include <cpptools/cppworkingcopy.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/basetextdocument.h>
#include <texteditor/textdocument.h>
#include <extensionsystem/pluginmanager.h>
#include <cplusplus/CppDocument.h>
......
......@@ -34,7 +34,7 @@
#include "cppsemanticinfo.h"
#include "cpptools_global.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <cplusplus/CppDocument.h>
......
......@@ -36,7 +36,7 @@
#include "cpptoolsreuse.h"
#include "cppworkingcopy.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/convenience.h>
#include <cplusplus/CppDocument.h>
......
......@@ -29,7 +29,7 @@
#include "cppcodeformatter.h"
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/textdocumentlayout.h>
#include <cplusplus/Lexer.h>
#include <utils/qtcassert.h>
......@@ -1090,7 +1090,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block, bool *endedJoined)
*endedJoined = tokenize.endedJoined();
const int lexerState = tokenize.state();
BaseTextDocumentLayout::setLexerState(block, lexerState);
TextDocumentLayout::setLexerState(block, lexerState);
return lexerState;
}
......@@ -1143,7 +1143,7 @@ void QtStyleCodeFormatter::setCodeStyleSettings(const CppCodeStyleSettings &sett
void QtStyleCodeFormatter::saveBlockData(QTextBlock *block, const BlockData &data) const
{
TextBlockUserData *userData = BaseTextDocumentLayout::userData(*block);
TextBlockUserData *userData = TextDocumentLayout::userData(*block);
CppCodeFormatterData *cppData = static_cast<CppCodeFormatterData *>(userData->codeFormatterData());
if (!cppData) {
cppData = new CppCodeFormatterData;
......@@ -1154,7 +1154,7 @@ void QtStyleCodeFormatter::saveBlockData(QTextBlock *block, const BlockData &dat
bool QtStyleCodeFormatter::loadBlockData(const QTextBlock &block, BlockData *data) const
{
TextBlockUserData *userData = BaseTextDocumentLayout::testUserData(block);
TextBlockUserData *userData = TextDocumentLayout::testUserData(block);
if (!userData)
return false;
CppCodeFormatterData *cppData = static_cast<CppCodeFormatterData *>(userData->codeFormatterData());
......@@ -1167,12 +1167,12 @@ bool QtStyleCodeFormatter::loadBlockData(const QTextBlock &block, BlockData *dat
void QtStyleCodeFormatter::saveLexerState(QTextBlock *block, int state) const
{
BaseTextDocumentLayout::setLexerState(*block, state);
TextDocumentLayout::setLexerState(*block, state);
}
int QtStyleCodeFormatter::loadLexerState(const QTextBlock &block) const
{
return BaseTextDocumentLayout::lexerState(block);
return TextDocumentLayout::lexerState(block);
}
void QtStyleCodeFormatter::addContinuationIndent(int *paddingDepth) const
......
......@@ -34,7 +34,7 @@
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/convenience.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/changeset.h>
#include <utils/fileutils.h>
......
......@@ -38,7 +38,7 @@
#include <cplusplus/Symbol.h>
#include <cplusplus/TypeOfExpression.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprocessor.h>
......
......@@ -35,7 +35,7 @@
#include "cppprojects.h"
#include <projectexplorer/project.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/cppmodelmanagerbase.h>
......
......@@ -34,7 +34,7 @@
#include <coreplugin/coreconstants.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/plaintexteditorfactory.h>
#include <utils/fileutils.h>
......
......@@ -36,7 +36,7 @@
#include "cpptoolstestcase.h"
#include "editordocumenthandle.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <cplusplus/CppDocument.h>
#include <utils/fileutils.h>
......
......@@ -30,7 +30,7 @@
#include "cpptoolstestcase.h"
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <texteditor/codeassist/iassistproposal.h>
#include <texteditor/codeassist/iassistproposalmodel.h>
......
......@@ -33,7 +33,7 @@
#include "cppsemanticinfo.h"
#include "cpptools_global.h"
#include <texteditor/basetextdocument.h>
#include <texteditor/textdocument.h>
#include <texteditor/semantichighlighter.h>
#include <QFutureWatcher>
......
......@@ -55,7 +55,7 @@
#include <coreplugin/icore.h>
#include <projectexplorer/taskhub.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/synchronousprocess.h>
#include <utils/qtcprocess.h>
......
......@@ -57,7 +57,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/taskhub.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/texteditor.h>
#include <utils/savedaction.h>
#include <utils/qtcassert.h>
......