summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-10-16 10:44:56 +0000
committerFrank Schönheit <fs@openoffice.org>2001-10-16 10:44:56 +0000
commitd0517e7f56c3488b8a1fa07336d09179a3dac10c (patch)
tree86a31646b546c03c1df0c5da70a4b9a4088872bf /svx
parent39efe1647b8dddbf79b844c47e7b44fb1f038c3b (diff)
#92158# properly enable or disable the UNDO in the context menu
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridctrl.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 33c61bad05d6..b9721bf3653f 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gridctrl.cxx,v $
*
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
- * last change: $Author: oj $ $Date: 2001-10-16 09:30:51 $
+ * last change: $Author: fs $ $Date: 2001-10-16 11:44:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2659,8 +2659,16 @@ void DbGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu)
bDelete = bDelete && !((m_nOptions & OPT_INSERT) && GetSelectRowCount() == 1 && IsRowSelected(GetRowCount() - 1));
rMenu.EnableItem(SID_FM_DELETEROWS, bDelete);
- rMenu.EnableItem(SID_FM_RECORD_UNDO, IsModified());
rMenu.EnableItem(SID_FM_RECORD_SAVE, IsModified());
+
+ // the undo is more difficult
+ sal_Bool bCanUndo = IsModified();
+ long nState = -1;
+ if (m_aMasterStateProvider.IsSet())
+ nState = m_aMasterStateProvider.Call((void*)SID_FM_RECORD_UNDO);
+ bCanUndo &= ( 0 != nState );
+
+ rMenu.EnableItem(SID_FM_RECORD_UNDO, bCanUndo);
}
//------------------------------------------------------------------------------