diff options
author | Ocke Janssen <oj@openoffice.org> | 2002-03-21 12:30:44 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2002-03-21 12:30:44 +0000 |
commit | 03b1ebc6076d6545ded3ccf006e9d777a8b28e6c (patch) | |
tree | 614d2468ee3529df60fa9af4d76d83f6f29f7f33 /dbaccess/source/ui/tabledesign/TableController.cxx | |
parent | dbc049294abef71a09b73ca55e75d779c47ace8c (diff) |
#96780# disable save slot when no valid rows exists and ask for to delete table when all rows are deleted
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 7d5629233cfe..750db88e13d3 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TableController.cxx,v $ * - * $Revision: 1.63 $ + * $Revision: 1.64 $ * - * last change: $Author: oj $ $Date: 2002-03-21 12:55:36 $ + * last change: $Author: oj $ $Date: 2002-03-21 13:30:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -305,7 +305,7 @@ void OTableController::disposing() delete *aIter; } // ----------------------------------------------------------------------------- -FeatureState OTableController::GetState(sal_uInt16 _nId) const +FeatureState OTableController::GetState(sal_uInt16 _nId) { FeatureState aReturn; // (disabled automatically) @@ -324,7 +324,12 @@ FeatureState OTableController::GetState(sal_uInt16 _nId) const break; case ID_BROWSER_SAVEDOC: aReturn.bEnabled = m_bModified; - // run through + if ( aReturn.bEnabled ) + { + ::std::vector<OTableRow*>::iterator aIter = ::std::find_if(m_vRowList.begin(),m_vRowList.end(),::std::mem_fun(&OTableRow::isValid)); + aReturn.bEnabled = aIter != m_vRowList.end(); + } + break; case ID_BROWSER_SAVEASDOC: aReturn.bEnabled |= isConnected(); if ( aReturn.bEnabled ) |