src/gui/text: whitespace fixes
Change-Id: Idd0e0673d76a23593b03558e18bc6afbdb9b38ab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
parent
63606d6a39
commit
41ecf56cf7
@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE
|
||||
#endif
|
||||
|
||||
#define FLOOR(x) ((x) & -64)
|
||||
#define CEIL(x) (((x)+63) & -64)
|
||||
#define CEIL(x) (((x)+63) & -64)
|
||||
#define TRUNC(x) ((x) >> 6)
|
||||
#define ROUND(x) (((x)+32) & -64)
|
||||
|
||||
|
@ -2491,7 +2491,7 @@ static bool isOrderedList(int style)
|
||||
|| style == QTextListFormat::ListUpperAlpha
|
||||
|| style == QTextListFormat::ListUpperRoman
|
||||
|| style == QTextListFormat::ListLowerRoman
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block)
|
||||
|
@ -632,7 +632,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
|
||||
blockRevision);
|
||||
|
||||
if (key+1 != blocks.position(b)) {
|
||||
// qDebug("remove_string from %d length %d", key, X->size_array[0]);
|
||||
// qDebug("remove_string from %d length %d", key, X->size_array[0]);
|
||||
Q_ASSERT(noBlockInString(text.mid(X->stringPosition, X->size_array[0])));
|
||||
w = remove_string(key, X->size_array[0], op);
|
||||
|
||||
@ -641,7 +641,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
|
||||
dstKey += X->size_array[0];
|
||||
}
|
||||
} else {
|
||||
// qDebug("remove_block at %d", key);
|
||||
// qDebug("remove_block at %d", key);
|
||||
Q_ASSERT(X->size_array[0] == 1 && isValidBlockSeparator(text.at(X->stringPosition)));
|
||||
b = blocks.previous(b);
|
||||
B = 0;
|
||||
@ -779,7 +779,7 @@ void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFor
|
||||
}
|
||||
|
||||
void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlock &to,
|
||||
const QTextBlockFormat &newFormat, FormatChangeMode mode)
|
||||
const QTextBlockFormat &newFormat, FormatChangeMode mode)
|
||||
{
|
||||
beginEditBlock();
|
||||
|
||||
@ -795,7 +795,7 @@ void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlo
|
||||
QTextBlock it = from;
|
||||
QTextBlock end = to;
|
||||
if (end.isValid())
|
||||
end = end.next();
|
||||
end = end.next();
|
||||
|
||||
for (; it != end; it = it.next()) {
|
||||
int oldFormat = block(it)->format;
|
||||
@ -820,8 +820,8 @@ void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlo
|
||||
if (group)
|
||||
group->blockInserted(it);
|
||||
} else if (group) {
|
||||
group->blockFormatChanged(it);
|
||||
}
|
||||
group->blockFormatChanged(it);
|
||||
}
|
||||
}
|
||||
|
||||
documentChange(from.position(), to.position() + to.length() - from.position());
|
||||
@ -892,14 +892,14 @@ int QTextDocumentPrivate::undoRedo(bool undo)
|
||||
QTextUndoCommand &c = undoStack[undoState];
|
||||
int resetBlockRevision = c.pos;
|
||||
|
||||
switch(c.command) {
|
||||
switch (c.command) {
|
||||
case QTextUndoCommand::Inserted:
|
||||
remove(c.pos, c.length, (QTextUndoCommand::Operation)c.operation);
|
||||
PMDEBUG(" erase: from %d, length %d", c.pos, c.length);
|
||||
c.command = QTextUndoCommand::Removed;
|
||||
editPos = c.pos;
|
||||
editLength = 0;
|
||||
break;
|
||||
break;
|
||||
case QTextUndoCommand::Removed:
|
||||
PMDEBUG(" insert: format %d (from %d, length %d, strpos=%d)", c.format, c.pos, c.length, c.strPos);
|
||||
insert_string(c.pos, c.strPos, c.length, c.format, (QTextUndoCommand::Operation)c.operation);
|
||||
@ -908,33 +908,33 @@ int QTextDocumentPrivate::undoRedo(bool undo)
|
||||
editLength = 0;
|
||||
editPos = c.pos;
|
||||
editLength += c.length;
|
||||
break;
|
||||
case QTextUndoCommand::BlockInserted:
|
||||
case QTextUndoCommand::BlockAdded:
|
||||
break;
|
||||
case QTextUndoCommand::BlockInserted:
|
||||
case QTextUndoCommand::BlockAdded:
|
||||
remove_block(c.pos, &c.blockFormat, c.command, (QTextUndoCommand::Operation)c.operation);
|
||||
PMDEBUG(" blockremove: from %d", c.pos);
|
||||
if (c.command == QTextUndoCommand::BlockInserted)
|
||||
c.command = QTextUndoCommand::BlockRemoved;
|
||||
else
|
||||
c.command = QTextUndoCommand::BlockDeleted;
|
||||
if (c.command == QTextUndoCommand::BlockInserted)
|
||||
c.command = QTextUndoCommand::BlockRemoved;
|
||||
else
|
||||
c.command = QTextUndoCommand::BlockDeleted;
|
||||
editPos = c.pos;
|
||||
editLength = 0;
|
||||
break;
|
||||
case QTextUndoCommand::BlockRemoved:
|
||||
case QTextUndoCommand::BlockDeleted:
|
||||
break;
|
||||
case QTextUndoCommand::BlockRemoved:
|
||||
case QTextUndoCommand::BlockDeleted:
|
||||
PMDEBUG(" blockinsert: charformat %d blockformat %d (pos %d, strpos=%d)", c.format, c.blockFormat, c.pos, c.strPos);
|
||||
insert_block(c.pos, c.strPos, c.format, c.blockFormat, (QTextUndoCommand::Operation)c.operation, c.command);
|
||||
resetBlockRevision += 1;
|
||||
if (c.command == QTextUndoCommand::BlockRemoved)
|
||||
c.command = QTextUndoCommand::BlockInserted;
|
||||
else
|
||||
c.command = QTextUndoCommand::BlockAdded;
|
||||
if (c.command == QTextUndoCommand::BlockRemoved)
|
||||
c.command = QTextUndoCommand::BlockInserted;
|
||||
else
|
||||
c.command = QTextUndoCommand::BlockAdded;
|
||||
if (editPos != (int)c.pos)
|
||||
editLength = 0;
|
||||
editPos = c.pos;
|
||||
editLength += 1;
|
||||
break;
|
||||
case QTextUndoCommand::CharFormatChanged: {
|
||||
break;
|
||||
case QTextUndoCommand::CharFormatChanged: {
|
||||
resetBlockRevision = -1; // ## TODO
|
||||
PMDEBUG(" charFormat: format %d (from %d, length %d)", c.format, c.pos, c.length);
|
||||
FragmentIterator it = find(c.pos);
|
||||
@ -947,9 +947,9 @@ int QTextDocumentPrivate::undoRedo(bool undo)
|
||||
editLength = 0;
|
||||
editPos = c.pos;
|
||||
editLength += c.length;
|
||||
break;
|
||||
}
|
||||
case QTextUndoCommand::BlockFormatChanged: {
|
||||
break;
|
||||
}
|
||||
case QTextUndoCommand::BlockFormatChanged: {
|
||||
resetBlockRevision = -1; // ## TODO
|
||||
PMDEBUG(" blockformat: format %d pos %d", c.format, c.pos);
|
||||
QTextBlock it = blocksFind(c.pos);
|
||||
@ -970,9 +970,9 @@ int QTextDocumentPrivate::undoRedo(bool undo)
|
||||
}
|
||||
documentChange(it.position(), it.length());
|
||||
editPos = -1;
|
||||
break;
|
||||
}
|
||||
case QTextUndoCommand::GroupFormatChange: {
|
||||
break;
|
||||
}
|
||||
case QTextUndoCommand::GroupFormatChange: {
|
||||
resetBlockRevision = -1; // ## TODO
|
||||
PMDEBUG(" group format change");
|
||||
QTextObject *object = objectForIndex(c.objectIndex);
|
||||
@ -980,22 +980,22 @@ int QTextDocumentPrivate::undoRedo(bool undo)
|
||||
changeObjectFormat(object, c.format);
|
||||
c.format = oldFormat;
|
||||
editPos = -1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QTextUndoCommand::CursorMoved:
|
||||
editPos = c.pos;
|
||||
editLength = 0;
|
||||
break;
|
||||
case QTextUndoCommand::Custom:
|
||||
case QTextUndoCommand::Custom:
|
||||
resetBlockRevision = -1; // ## TODO
|
||||
if (undo)
|
||||
c.custom->undo();
|
||||
else
|
||||
c.custom->redo();
|
||||
editPos = -1;
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
||||
if (resetBlockRevision >= 0) {
|
||||
@ -1315,9 +1315,9 @@ void QTextDocumentPrivate::adjustDocumentChangesAndCursors(int from, int addedOr
|
||||
int removed = qMax(0, -addedOrRemoved);
|
||||
|
||||
int diff = 0;
|
||||
if(from + removed < docChangeFrom)
|
||||
if (from + removed < docChangeFrom)
|
||||
diff = docChangeFrom - from - removed;
|
||||
else if(from > docChangeFrom + docChangeLength)
|
||||
else if (from > docChangeFrom + docChangeLength)
|
||||
diff = from - (docChangeFrom + docChangeLength);
|
||||
|
||||
int overlap_start = qMax(from, docChangeFrom);
|
||||
|
@ -194,7 +194,7 @@ public:
|
||||
|
||||
void setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode = SetFormat);
|
||||
void setBlockFormat(const QTextBlock &from, const QTextBlock &to,
|
||||
const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
|
||||
const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
|
||||
|
||||
void emitUndoAvailable(bool available);
|
||||
void emitRedoAvailable(bool available);
|
||||
|
@ -265,8 +265,8 @@ QString QTextList::itemText(const QTextBlock &blockIt) const
|
||||
result = QLatin1String("?");
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
}
|
||||
|
@ -355,12 +355,12 @@ QTextTable *QTextTablePrivate::createTable(QTextDocumentPrivate *pieceTable, int
|
||||
|
||||
for (int i = 1; i < rows*cols; ++i) {
|
||||
d->cells.append(pieceTable->insertBlock(QTextBeginningOfFrame, pos, cellIdx, charIdx));
|
||||
// qDebug(" addCell at %d", pos);
|
||||
// qDebug(" addCell at %d", pos);
|
||||
++pos;
|
||||
}
|
||||
|
||||
d->fragment_end = pieceTable->insertBlock(QTextEndOfFrame, pos, cellIdx, charIdx);
|
||||
// qDebug(" addEOR at %d", pos);
|
||||
// qDebug(" addEOR at %d", pos);
|
||||
++pos;
|
||||
|
||||
d->blockFragmentUpdates = false;
|
||||
@ -482,7 +482,7 @@ void QTextTablePrivate::update() const
|
||||
for (int jj = 0; jj < colspan; ++jj) {
|
||||
Q_ASSERT(grid[(r+ii)*nCols + c+jj] == 0);
|
||||
grid[(r+ii)*nCols + c+jj] = fragment;
|
||||
// qDebug(" setting cell %d span=%d/%d at %d/%d", fragment, rowspan, colspan, r+ii, c+jj);
|
||||
// qDebug(" setting cell %d span=%d/%d at %d/%d", fragment, rowspan, colspan, r+ii, c+jj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -654,7 +654,7 @@ void QTextTable::resize(int rows, int cols)
|
||||
int nCols = this->columns();
|
||||
|
||||
if (rows == nRows && cols == nCols)
|
||||
return;
|
||||
return;
|
||||
|
||||
d->pieceTable->beginEditBlock();
|
||||
|
||||
@ -682,7 +682,7 @@ void QTextTable::insertRows(int pos, int num)
|
||||
{
|
||||
Q_D(QTextTable);
|
||||
if (num <= 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
if (d->dirty)
|
||||
d->update();
|
||||
@ -744,7 +744,7 @@ void QTextTable::insertColumns(int pos, int num)
|
||||
{
|
||||
Q_D(QTextTable);
|
||||
if (num <= 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
if (d->dirty)
|
||||
d->update();
|
||||
@ -932,7 +932,7 @@ void QTextTable::removeColumns(int pos, int num)
|
||||
// qDebug() << "-------- removeCols" << pos << num;
|
||||
|
||||
if (num <= 0 || pos < 0)
|
||||
return;
|
||||
return;
|
||||
if (d->dirty)
|
||||
d->update();
|
||||
if (pos >= d->nCols)
|
||||
|
@ -1,89 +1,89 @@
|
||||
# Qt kernel module
|
||||
|
||||
HEADERS += \
|
||||
text/qfont.h \
|
||||
text/qfontdatabase.h \
|
||||
text/qfontengine_p.h \
|
||||
text/qfontengineglyphcache_p.h \
|
||||
text/qfontinfo.h \
|
||||
text/qfontmetrics.h \
|
||||
text/qfont_p.h \
|
||||
text/qfontsubset_p.h \
|
||||
text/qtextengine_p.h \
|
||||
text/qtextlayout.h \
|
||||
text/qtextformat.h \
|
||||
text/qtextformat_p.h \
|
||||
text/qtextobject.h \
|
||||
text/qtextobject_p.h \
|
||||
text/qtextoption.h \
|
||||
text/qfragmentmap_p.h \
|
||||
text/qtextdocument.h \
|
||||
text/qtextdocument_p.h \
|
||||
text/qtexthtmlparser_p.h \
|
||||
text/qabstracttextdocumentlayout.h \
|
||||
text/qtextdocumentlayout_p.h \
|
||||
text/qtextcursor.h \
|
||||
text/qtextcursor_p.h \
|
||||
text/qtextdocumentfragment.h \
|
||||
text/qtextdocumentfragment_p.h \
|
||||
text/qtextimagehandler_p.h \
|
||||
text/qtexttable.h \
|
||||
text/qtextlist.h \
|
||||
text/qsyntaxhighlighter.h \
|
||||
text/qtextdocumentwriter.h \
|
||||
text/qcssparser_p.h \
|
||||
text/qtexttable_p.h \
|
||||
text/qzipreader_p.h \
|
||||
text/qzipwriter_p.h \
|
||||
text/qtextodfwriter_p.h \
|
||||
text/qstatictext_p.h \
|
||||
text/qstatictext.h \
|
||||
text/qrawfont.h \
|
||||
text/qrawfont_p.h \
|
||||
text/qfont.h \
|
||||
text/qfontdatabase.h \
|
||||
text/qfontengine_p.h \
|
||||
text/qfontengineglyphcache_p.h \
|
||||
text/qfontinfo.h \
|
||||
text/qfontmetrics.h \
|
||||
text/qfont_p.h \
|
||||
text/qfontsubset_p.h \
|
||||
text/qtextengine_p.h \
|
||||
text/qtextlayout.h \
|
||||
text/qtextformat.h \
|
||||
text/qtextformat_p.h \
|
||||
text/qtextobject.h \
|
||||
text/qtextobject_p.h \
|
||||
text/qtextoption.h \
|
||||
text/qfragmentmap_p.h \
|
||||
text/qtextdocument.h \
|
||||
text/qtextdocument_p.h \
|
||||
text/qtexthtmlparser_p.h \
|
||||
text/qabstracttextdocumentlayout.h \
|
||||
text/qtextdocumentlayout_p.h \
|
||||
text/qtextcursor.h \
|
||||
text/qtextcursor_p.h \
|
||||
text/qtextdocumentfragment.h \
|
||||
text/qtextdocumentfragment_p.h \
|
||||
text/qtextimagehandler_p.h \
|
||||
text/qtexttable.h \
|
||||
text/qtextlist.h \
|
||||
text/qsyntaxhighlighter.h \
|
||||
text/qtextdocumentwriter.h \
|
||||
text/qcssparser_p.h \
|
||||
text/qtexttable_p.h \
|
||||
text/qzipreader_p.h \
|
||||
text/qzipwriter_p.h \
|
||||
text/qtextodfwriter_p.h \
|
||||
text/qstatictext_p.h \
|
||||
text/qstatictext.h \
|
||||
text/qrawfont.h \
|
||||
text/qrawfont_p.h \
|
||||
text/qglyphrun.h \
|
||||
text/qglyphrun_p.h \
|
||||
text/qdistancefield_p.h
|
||||
|
||||
SOURCES += \
|
||||
text/qfont.cpp \
|
||||
text/qfontengine.cpp \
|
||||
text/qfontsubset.cpp \
|
||||
text/qfontmetrics.cpp \
|
||||
text/qfontdatabase.cpp \
|
||||
text/qtextengine.cpp \
|
||||
text/qtextlayout.cpp \
|
||||
text/qtextformat.cpp \
|
||||
text/qtextobject.cpp \
|
||||
text/qtextoption.cpp \
|
||||
text/qfragmentmap.cpp \
|
||||
text/qtextdocument.cpp \
|
||||
text/qtextdocument_p.cpp \
|
||||
text/qtexthtmlparser.cpp \
|
||||
text/qabstracttextdocumentlayout.cpp \
|
||||
text/qtextdocumentlayout.cpp \
|
||||
text/qtextcursor.cpp \
|
||||
text/qtextdocumentfragment.cpp \
|
||||
text/qtextimagehandler.cpp \
|
||||
text/qtexttable.cpp \
|
||||
text/qtextlist.cpp \
|
||||
text/qtextdocumentwriter.cpp \
|
||||
text/qsyntaxhighlighter.cpp \
|
||||
text/qcssparser.cpp \
|
||||
text/qzip.cpp \
|
||||
text/qtextodfwriter.cpp \
|
||||
text/qstatictext.cpp \
|
||||
text/qrawfont.cpp \
|
||||
text/qfont.cpp \
|
||||
text/qfontengine.cpp \
|
||||
text/qfontsubset.cpp \
|
||||
text/qfontmetrics.cpp \
|
||||
text/qfontdatabase.cpp \
|
||||
text/qtextengine.cpp \
|
||||
text/qtextlayout.cpp \
|
||||
text/qtextformat.cpp \
|
||||
text/qtextobject.cpp \
|
||||
text/qtextoption.cpp \
|
||||
text/qfragmentmap.cpp \
|
||||
text/qtextdocument.cpp \
|
||||
text/qtextdocument_p.cpp \
|
||||
text/qtexthtmlparser.cpp \
|
||||
text/qabstracttextdocumentlayout.cpp \
|
||||
text/qtextdocumentlayout.cpp \
|
||||
text/qtextcursor.cpp \
|
||||
text/qtextdocumentfragment.cpp \
|
||||
text/qtextimagehandler.cpp \
|
||||
text/qtexttable.cpp \
|
||||
text/qtextlist.cpp \
|
||||
text/qtextdocumentwriter.cpp \
|
||||
text/qsyntaxhighlighter.cpp \
|
||||
text/qcssparser.cpp \
|
||||
text/qzip.cpp \
|
||||
text/qtextodfwriter.cpp \
|
||||
text/qstatictext.cpp \
|
||||
text/qrawfont.cpp \
|
||||
text/qglyphrun.cpp \
|
||||
text/qdistancefield.cpp
|
||||
|
||||
SOURCES += \
|
||||
text/qfont_qpa.cpp \
|
||||
text/qfontengine_qpa.cpp \
|
||||
text/qplatformfontdatabase.cpp \
|
||||
text/qrawfont_qpa.cpp
|
||||
text/qfont_qpa.cpp \
|
||||
text/qfontengine_qpa.cpp \
|
||||
text/qplatformfontdatabase.cpp \
|
||||
text/qrawfont_qpa.cpp
|
||||
|
||||
HEADERS += \
|
||||
text/qplatformfontdatabase.h
|
||||
text/qplatformfontdatabase.h
|
||||
|
||||
contains(QT_CONFIG, harfbuzz)|contains(QT_CONFIG, system-harfbuzz) {
|
||||
DEFINES += QT_ENABLE_HARFBUZZ_NG
|
||||
|
Loading…
Reference in New Issue
Block a user