Flush modified data to the model when pressing OK in the data table dialog.

This dialog used to have no OK / Cancel buttons, and the data would get
flushed when the dialog got dismissed.  This behavior got lost during the
dialog conversion.

Also, SaveModified() does check whether or not the data table is modified.
No need to call IsModified() before calling SaveModified().

Change-Id: I5cea88cb52127cc5c7c1be67a5a592d87df92d0c
This commit is contained in:
Kohei Yoshida 2014-06-27 11:31:06 -04:00
parent 0181a13904
commit 483a4b546c
2 changed files with 3 additions and 4 deletions

View file

@ -1182,8 +1182,7 @@ bool DataBrowser::SaveModified()
bool DataBrowser::EndEditing()
{
if( IsModified())
SaveModified();
SaveModified();
// apply changes made to series headers
::std::for_each( m_aSeriesHeaders.begin(), m_aSeriesHeaders.end(), impl::applyChangesFunctor());

View file

@ -57,8 +57,8 @@ void ChartController::executeDispatch_EditData()
SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
m_xUndoManager );
DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
// the dialog has no OK/Cancel
aDataEditorDialog.Execute();
if (aDataEditorDialog.Execute() == RET_OK)
aDataEditorDialog.ApplyChangesToModel();
aUndoGuard.commit();
}
}