Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix crash on inserting multiple keys

shun-iwasawa6b556893bf54
diff --git a/toonz/sources/toonz/xsheetcmd.cpp b/toonz/sources/toonz/xsheetcmd.cpp
index 7f29ef76a..8308f3a47 100644
--- a/toonz/sources/toonz/xsheetcmd.cpp
+++ b/toonz/sources/toonz/xsheetcmd.cpp
@@ -361,14 +361,9 @@ void GlobalKeyframeUndo::doInsertGlobalKeyframes(
int frame, const std::vector<int> &columns) {
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
- int i, colsCount = columns.size();
- int startCol =
- Preferences::instance()->isXsheetCameraColumnVisible() ? -1 : 0;
- for (i = startCol; i != colsCount; ++i) {
+ for (const int c : columns) {
TStageObjectId objectId;
- int c = columns[i];
-
TXshColumn *column = xsh->getColumn(c);
if (column && column->getSoundColumn()) continue;
@@ -393,14 +388,9 @@ void GlobalKeyframeUndo::doRemoveGlobalKeyframes(
int frame, const std::vector<int> &columns) {
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
- int i, colsCount = columns.size();
- int startCol =
- Preferences::instance()->isXsheetCameraColumnVisible() ? -1 : 0;
- for (i = 0; i != colsCount; ++i) {
+ for (const int c : columns) {
TStageObjectId objectId;
- int c = columns[i];
-
TXshColumn *column = xsh->getColumn(c);
if (column && column->getSoundColumn()) continue;