change: change code style to Linux style except indent.

This commit is contained in:
Mike Solar
2025-08-03 03:09:40 +08:00
parent 65ab76edc8
commit 74f73ab3be
789 changed files with 77113 additions and 68888 deletions
+32 -31
View File
@@ -22,68 +22,69 @@
#include "core.h"
namespace olive {
namespace olive
{
void MultiUndoCommand::redo()
{
for (auto it=children_.cbegin(); it!=children_.cend(); it++) {
(*it)->redo_and_set_modified();
}
for (auto it = children_.cbegin(); it != children_.cend(); it++) {
(*it)->redo_and_set_modified();
}
}
void MultiUndoCommand::undo()
{
for (auto it=children_.crbegin(); it!=children_.crend(); it++) {
(*it)->undo_and_set_modified();
}
for (auto it = children_.crbegin(); it != children_.crend(); it++) {
(*it)->undo_and_set_modified();
}
}
UndoCommand::UndoCommand()
{
prepared_ = false;
done_ = false;
prepared_ = false;
done_ = false;
}
void UndoCommand::redo_and_set_modified()
{
project_ = GetRelevantProject();
project_ = GetRelevantProject();
redo_now();
redo_now();
if (project_) {
modified_ = project_->is_modified();
project_->set_modified(true);
}
if (project_) {
modified_ = project_->is_modified();
project_->set_modified(true);
}
}
void UndoCommand::undo_and_set_modified()
{
undo_now();
undo_now();
if (project_) {
project_->set_modified(modified_);
}
if (project_) {
project_->set_modified(modified_);
}
}
void UndoCommand::redo_now()
{
if (!done_) {
if (!prepared_) {
prepare();
prepared_ = true;
}
if (!done_) {
if (!prepared_) {
prepare();
prepared_ = true;
}
redo();
done_ = true;
}
redo();
done_ = true;
}
}
void UndoCommand::undo_now()
{
if (done_) {
undo();
done_ = false;
}
if (done_) {
undo();
done_ = false;
}
}
}