From f2a598f5120446e140d584377b90b765bad93dac Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Sun, 17 May 2020 16:07:52 +0200 Subject: [PATCH] mupp add var: check if a variable for a given collection already exists, and if yes, replace it, otherwise add the new variable. --- src/musredit_qt5/mupp/PmuppGui.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/musredit_qt5/mupp/PmuppGui.cpp b/src/musredit_qt5/mupp/PmuppGui.cpp index 0a186853..8ec7900a 100644 --- a/src/musredit_qt5/mupp/PmuppGui.cpp +++ b/src/musredit_qt5/mupp/PmuppGui.cpp @@ -1361,7 +1361,18 @@ void PmuppGui::add(QString varStr, QVector idx) parseErrMsgDlg(); return; } - fVarHandler.push_back(var); // collect all valid variables + // check if variable name for the given collection already exists + int var_idx=-1; + for (int k=0; k