Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4bf211c8 authored by Nikita Sirgienko's avatar Nikita Sirgienko Committed by Alexander Semke

Fix octave backend problem with repetitive addition of function `cantor_print ()` in worksheet

Summary: Octave use special script for plots, that is added for each entry with octave plot commands. Unfortunately, this command is add to entry when expressions in worksheet are saving (maybe should add virtual method `toSaveString()` to `Cantor::Expression`?). So, I have added addition check, if this command already exist in entry, to avoid the multiple addition of this command to entries each time, when worksheet save and load.

Test Plan:
1) Create worksheet and write some commands to print plots
2) Save and load this worksheet
3) Do 2) again few times
4) Verify,that `cantor_print()` function appears no more than once in each entry.

Reviewers: #cantor, asemke

Subscribers: #cantor, #kde_edu

Tags: #kde_edu, #cantor

Differential Revision: https://phabricator.kde.org/D11626
parent d2ef2181
......@@ -67,7 +67,7 @@ void OctaveExpression::evaluate()
}
}
}
if ( m_plotPending && !cmd.contains(QLatin1String("cantor_plot")))
if ( m_plotPending && !cmd.contains(QLatin1String("cantor_plot")) && !cmd.contains(QLatin1String(printCommand)))
{
// This was a manual plot, we have to add a print command
if (!cmd.endsWith(QLatin1Char(';')) && !cmd.endsWith(QLatin1Char(',')))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment