summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/indexdialog.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-03-23 08:48:55 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-03-23 08:48:55 +0000
commita27845ab4317900302f7bee09a666c88720864b9 (patch)
treee043d56e437246fed8b77cc2542221448f65c451 /dbaccess/source/ui/dlg/indexdialog.cxx
parent38e4bbb3386839107f903aa5464a4cda78e61ebb (diff)
INTEGRATION: CWS dba26 (1.18.198); FILE MERGED
2005/03/08 11:34:23 oj 1.18.198.1: #i44439# disable toolbar entries when index is a primary key index
Diffstat (limited to 'dbaccess/source/ui/dlg/indexdialog.cxx')
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index 395d44f6f949..6e771f03cf1f 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: indexdialog.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: rt $ $Date: 2003-12-01 18:02:08 $
+ * last change: $Author: vg $ $Date: 2005-03-23 09:48:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -347,8 +347,7 @@ namespace dbaui
SvLBoxEntry* pSelected = m_aIndexes.FirstSelected();
sal_Bool bSelectedAnything = NULL != pSelected;
- m_aActions.EnableItem(ID_INDEX_DROP, bSelectedAnything);
- m_aActions.EnableItem(ID_INDEX_RENAME, bSelectedAnything);
+
if (pSelected)
{
@@ -356,12 +355,15 @@ namespace dbaui
OIndexCollection::const_iterator aSelectedPos = reinterpret_cast<OIndexCollection::const_iterator>(pSelected->GetUserData());
m_aActions.EnableItem(ID_INDEX_SAVE, aSelectedPos->isModified() || aSelectedPos->isNew());
m_aActions.EnableItem(ID_INDEX_RESET, aSelectedPos->isModified() || aSelectedPos->isNew());
+ bSelectedAnything = bSelectedAnything && !aSelectedPos->bPrimaryKey;
}
else
{
m_aActions.EnableItem(ID_INDEX_SAVE, sal_False);
m_aActions.EnableItem(ID_INDEX_RESET, sal_False);
}
+ m_aActions.EnableItem(ID_INDEX_DROP, bSelectedAnything);
+ m_aActions.EnableItem(ID_INDEX_RENAME, bSelectedAnything);
}
//------------------------------------------------------------------