diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-09 01:00:35 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-09 10:16:01 +0100 |
commit | bef74b6c3a0a9c8649ea8eb333d80015f76863e4 (patch) | |
tree | 41cdf5b6776c90a6d04a1d6680f4d47a90593746 /src/widgets/util/qundostack.cpp | |
parent | f8d2975b6a8b36bf8dd304c99783947a72081b79 (diff) | |
parent | 4c3c63d4cbb81b38e88e06b72749e7e01497b6f1 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
Diffstat (limited to 'src/widgets/util/qundostack.cpp')
-rw-r--r-- | src/widgets/util/qundostack.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp index dbe01e4ad8..8974f11a13 100644 --- a/src/widgets/util/qundostack.cpp +++ b/src/widgets/util/qundostack.cpp @@ -128,7 +128,7 @@ QUndoCommand::QUndoCommand(const QString &text, QUndoCommand *parent) QUndoCommand::QUndoCommand(QUndoCommand *parent) { d = new QUndoCommandPrivate; - if (parent != 0) + if (parent != nullptr) parent->d->child_list.append(this); } @@ -336,7 +336,7 @@ int QUndoCommand::childCount() const const QUndoCommand *QUndoCommand::child(int index) const { if (index < 0 || index >= d->child_list.count()) - return 0; + return nullptr; return d->child_list.at(index); } @@ -559,7 +559,7 @@ QUndoStack::~QUndoStack() { #if QT_CONFIG(undogroup) Q_D(QUndoStack); - if (d->group != 0) + if (d->group != nullptr) d->group->removeStack(this); #endif clear(); @@ -640,7 +640,7 @@ void QUndoStack::push(QUndoCommand *cmd) bool macro = !d->macro_stack.isEmpty(); - QUndoCommand *cur = 0; + QUndoCommand *cur = nullptr; if (macro) { QUndoCommand *macro_cmd = d->macro_stack.constLast(); if (!macro_cmd->d->child_list.isEmpty()) @@ -654,7 +654,7 @@ void QUndoStack::push(QUndoCommand *cmd) d->clean_index = -1; // we've deleted the clean state } - bool try_merge = cur != 0 + bool try_merge = cur != nullptr && cur->id() != -1 && cur->id() == cmd->id() && (macro || d->index != d->clean_index); @@ -1225,7 +1225,7 @@ const QUndoCommand *QUndoStack::command(int index) const Q_D(const QUndoStack); if (index < 0 || index >= d->command_list.count()) - return 0; + return nullptr; return d->command_list.at(index); } @@ -1305,11 +1305,11 @@ void QUndoStack::setActive(bool active) #else Q_D(QUndoStack); - if (d->group != 0) { + if (d->group != nullptr) { if (active) d->group->setActiveStack(this); else if (d->group->activeStack() == this) - d->group->setActiveStack(0); + d->group->setActiveStack(nullptr); } #endif } @@ -1320,7 +1320,7 @@ bool QUndoStack::isActive() const return true; #else Q_D(const QUndoStack); - return d->group == 0 || d->group->activeStack() == this; + return d->group == nullptr || d->group->activeStack() == this; #endif } |