"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend/cantorWorksheet/CantorWorksheet.cpp" between
labplot-2.8.1.tar.gz and labplot-2.8.2.tar.gz

About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.

CantorWorksheet.cpp  (labplot-2.8.1):CantorWorksheet.cpp  (labplot-2.8.2)
skipping to change at line 286 skipping to change at line 286
//save columns(variables) //save columns(variables)
for (auto* col : children<Column>(ChildIndexFlag::IncludeHidden)) for (auto* col : children<Column>(ChildIndexFlag::IncludeHidden))
col->save(writer); col->save(writer);
writer->writeEndElement(); // close "cantorWorksheet" section writer->writeEndElement(); // close "cantorWorksheet" section
} }
//! Load from XML //! Load from XML
bool CantorWorksheet::load(XmlStreamReader* reader, bool preview) { bool CantorWorksheet::load(XmlStreamReader* reader, bool preview) {
//reset the status of the reader differentiating between
//"failed because of the missing CAS" and "failed because of the broken X
ML"
reader->setFailedCASMissing(false);
if (!readBasicAttributes(reader)) if (!readBasicAttributes(reader))
return false; return false;
KLocalizedString attributeWarning = ki18n("Attribute '%1' missing or empt y, default value is used"); KLocalizedString attributeWarning = ki18n("Attribute '%1' missing or empt y, default value is used");
QXmlStreamAttributes attribs; QXmlStreamAttributes attribs;
bool rc = false; bool rc = false;
while (!reader->atEnd()) { while (!reader->atEnd()) {
reader->readNext(); reader->readNext();
if (reader->isEndElement() && reader->name() == "cantorWorksheet" ) if (reader->isEndElement() && reader->name() == "cantorWorksheet" )
skipping to change at line 319 skipping to change at line 323
reader->raiseWarning(attributeWarning.subs("backe nd_name").toString()); reader->raiseWarning(attributeWarning.subs("backe nd_name").toString());
} else if (!preview && reader->name() == "worksheet") { } else if (!preview && reader->name() == "worksheet") {
attribs = reader->attributes(); attribs = reader->attributes();
QString str = attribs.value("content").toString().trimmed (); QString str = attribs.value("content").toString().trimmed ();
if (str.isEmpty()) if (str.isEmpty())
reader->raiseWarning(attributeWarning.subs("conte nt").toString()); reader->raiseWarning(attributeWarning.subs("conte nt").toString());
QByteArray content = QByteArray::fromBase64(str.toLatin1( )); QByteArray content = QByteArray::fromBase64(str.toLatin1( ));
rc = init(&content); rc = init(&content);
if (!rc) { if (!rc) {
QString msg = i18n("This project has Cantor conte reader->raiseMissingCASWarning(m_backendName);
nt but no Cantor plugins were found. Please check your installation. The project
will be closed."); //failed to load this object because of the missi
reader->raiseError(msg); ng CAS plugin
//and not because of the broken project XML. Set
this flag to
//handle this case correctly.
//TODO: we also can fail in the limit in cases wh
ere Cantor's content is broken
//and not because of the missing CAS plugin. This
also needs to be treated accrodingly...
reader->setFailedCASMissing(true);
return false; return false;
} }
} else if (!preview && reader->name() == "column") { } else if (!preview && reader->name() == "column") {
Column* column = new Column(QString()); Column* column = new Column(QString());
column->setUndoAware(false); column->setUndoAware(false);
if (!column->load(reader, preview)) { if (!column->load(reader, preview)) {
delete column; delete column;
return false; return false;
} }
addChild(column); addChild(column);
 End of changes. 2 change blocks. 
5 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)