Fix octave backend problem with repetitive addition of function `cantor_print…

Authored by sirgienko on Apr 3 2018, 8:12 PM.

Description

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