Merge pull request #757 from manongjohn/fix_crash_adding_fx_while_on_camera_col

Fix crash adding Fx while on Camera column
This commit is contained in:
manongjohn 2021-08-27 12:10:12 -04:00 committed by GitHub
commit 08829c4a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -936,6 +936,8 @@ void TFxCommand::addFx(TFx *newFx, const QList<TFxP> &fxs, TApplication *app,
int col, int row) {
if (!newFx) return;
if (col < 0) col = 0;
std::unique_ptr<FxCommandUndo> undo(
new InsertFxUndo(newFx, row, col, fxs, QList<Link>(), app, false));
if (!undo->isConsistent()) return;

View file

@ -565,9 +565,9 @@ void AddFxContextMenu::onAddFx(QAction *action) {
if (fx->isZerary() &&
fx->getAttributes()->getDagNodePos() != TConst::nowhere) {
TXsheet *xsh = m_app->getCurrentXsheet()->getXsheet();
TXshZeraryFxColumn *column =
xsh->getColumn(m_app->getCurrentColumn()->getColumnIndex())
->getZeraryFxColumn();
int col = m_app->getCurrentColumn()->getColumnIndex();
if (col < 0) col = 0;
TXshZeraryFxColumn *column = xsh->getColumn(col)->getZeraryFxColumn();
if (column)
column->getZeraryColumnFx()->getAttributes()->setDagNodePos(
fx->getAttributes()->getDagNodePos());