ClangFormat: Fix handling more complex styles

Change-Id: I8c30c90a81bef786cdd0946351bf2cf46cc906ee
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-02-21 13:44:23 +01:00
parent c5e4d73431
commit 308a48323e

View File

@@ -63,10 +63,6 @@ static void readTable(QTableWidget *table, std::istringstream &stream)
if (firstLetter == std::string::npos || line.at(firstLetter) == '#')
continue;
// Increase indent where it already exists.
if (firstLetter > 0 && firstLetter < 5)
line = " " + line;
table->insertRow(table->rowCount());
const size_t colonPos = line.find_first_of(':');
auto *keyItem = new QTableWidgetItem;
@@ -104,8 +100,6 @@ static QByteArray tableToYAML(QTableWidget *table)
auto *valueItem = table->item(i, 1);
QByteArray itemText = keyItem->text().toUtf8();
// Change the indent back to 2 spaces
itemText.replace(" ", " ");
if (!valueItem->text().isEmpty() || !itemText.trimmed().startsWith('-'))
itemText += ": ";
itemText += valueItem->text().toUtf8() + '\n';