summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-06-27 11:31:06 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-06-30 09:04:31 +0000
commit388e66387bb6346f7cdc8b55ade39fd6a0bc2545 (patch)
tree66f44d87db470eb2698d2e9b997624cff3d61ce2 /chart2
parentbc273b24f0ae1959fc4b962e3f6ad736bd99b60d (diff)
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 (cherry picked from commit 483a4b546c850e82a2d1d304238d4830ac6b441f) Reviewed-on: https://gerrit.libreoffice.org/9940 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx3
-rw-r--r--chart2/source/controller/main/ChartController_EditData.cxx4
2 files changed, 3 insertions, 4 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 94174dd67114..bf4f089e8c86 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -1202,8 +1202,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());
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index c87f1678318a..726ba03266fc 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -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();
}
}