"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/backend/spreadsheet/Spreadsheet.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.

Spreadsheet.cpp  (labplot-2.8.1):Spreadsheet.cpp  (labplot-2.8.2)
skipping to change at line 975 skipping to change at line 975
colNameList.append( "Column " + QString::number(k+1) ); colNameList.append( "Column " + QString::number(k+1) );
int columnOffset = 0; //indexes the "start column" in the spreadsheet. St arting from this column the data will be imported. int columnOffset = 0; //indexes the "start column" in the spreadsheet. St arting from this column the data will be imported.
Column* newColumn = nullptr; Column* newColumn = nullptr;
if (mode == AbstractFileFilter::ImportMode::Append) { if (mode == AbstractFileFilter::ImportMode::Append) {
columnOffset = childCount<Column>(); columnOffset = childCount<Column>();
for (int n = 0; n < cols; n++ ) { for (int n = 0; n < cols; n++ ) {
newColumn = new Column(colNameList.at(n), AbstractColumn: :ColumnMode::Numeric); newColumn = new Column(colNameList.at(n), AbstractColumn: :ColumnMode::Numeric);
newColumn->setUndoAware(false); newColumn->setUndoAware(false);
addChildFast(newColumn); addChild(newColumn);
} }
} else if (mode == AbstractFileFilter::ImportMode::Prepend) { } else if (mode == AbstractFileFilter::ImportMode::Prepend) {
Column* firstColumn = child<Column>(0); Column* firstColumn = child<Column>(0);
for (int n = 0; n < cols; n++ ) { for (int n = 0; n < cols; n++ ) {
newColumn = new Column(colNameList.at(n), AbstractColumn: :ColumnMode::Numeric); newColumn = new Column(colNameList.at(n), AbstractColumn: :ColumnMode::Numeric);
newColumn->setUndoAware(false); newColumn->setUndoAware(false);
insertChildBeforeFast(newColumn, firstColumn); insertChildBefore(newColumn, firstColumn);
} }
} else if (mode == AbstractFileFilter::ImportMode::Replace) { } else if (mode == AbstractFileFilter::ImportMode::Replace) {
//replace completely the previous content of the data source with the content to be imported. //replace completely the previous content of the data source with the content to be imported.
int columns = childCount<Column>(); int columns = childCount<Column>();
if (columns > cols) { if (columns > cols) {
//there're more columns in the data source then required -> remove the superfluous columns //there're more columns in the data source then required -> remove the superfluous columns
for (int i = 0; i < columns-cols; i++) for (int i = 0; i < columns-cols; i++)
removeChild(child<Column>(0)); removeChild(child<Column>(0));
} else { } else {
//create additional columns if needed //create additional columns if needed
for (int i = columns; i < cols; i++) { for (int i = columns; i < cols; i++) {
newColumn = new Column(colNameList.at(i), Abstrac tColumn::ColumnMode::Numeric); newColumn = new Column(colNameList.at(i), Abstrac tColumn::ColumnMode::Numeric);
newColumn->setUndoAware(false); newColumn->setUndoAware(false);
addChildFast(newColumn); addChildFast(newColumn); //in the replace mode, w e can skip checking the uniqueness of the names and use the "fast" method
} }
} }
// 1. rename the columns that were already available // 1. rename the columns that were already available
// 2. suppress the dataChanged signal for all columns // 2. suppress the dataChanged signal for all columns
// 3. send aspectDescriptionChanged because otherwise the column // 3. send aspectDescriptionChanged because otherwise the column
// will not be connected again to the curves (project.cpp, des criptionChanged) // will not be connected again to the curves (project.cpp, des criptionChanged)
for (int i = 0; i < childCount<Column>(); i++) { for (int i = 0; i < childCount<Column>(); i++) {
child<Column>(i)->setSuppressDataChangedSignal(true); child<Column>(i)->setSuppressDataChangedSignal(true);
emit child<Column>(i)->reset(child<Column>(i)); emit child<Column>(i)->reset(child<Column>(i));
skipping to change at line 1091 skipping to change at line 1091
setUndoAware(true); setUndoAware(true);
for (int i = 0; i < childCount<Column>(); i++) for (int i = 0; i < childCount<Column>(); i++)
child<Column>(i)->setUndoAware(true); child<Column>(i)->setUndoAware(true);
if (m_model != nullptr) if (m_model != nullptr)
m_model->suppressSignals(false); m_model->suppressSignals(false);
if (m_partView != nullptr && m_view != nullptr) if (m_partView != nullptr && m_view != nullptr)
m_view->resizeHeader(); m_view->resizeHeader();
//row count most probably changed after the import, notify the dock widge
t.
//no need to notify about the column cound change, this is done already b
ecause of add/removeChild signals
rowCountChanged(rowCount());
DEBUG("Spreadsheet::finalizeImport() DONE"); DEBUG("Spreadsheet::finalizeImport() DONE");
} }
 End of changes. 4 change blocks. 
3 lines changed or deleted 9 lines changed or added

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