diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-07-16 06:55:35 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-07-16 06:55:35 +0000 |
commit | 0861aa80142cfe7f575391b9ca413d697b6d2dab (patch) | |
tree | 83cd63d42c6cf7320669320700cf8c6a194c40aa /dbaccess/source/ui/tabledesign/TEditControl.cxx | |
parent | c5e3e02943a330138f07946bc224a201687b183f (diff) |
#89657# check if copy is allowed
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TEditControl.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 7ea6121d3243..0008295422e7 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: TEditControl.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: oj $ $Date: 2001-07-06 11:15:38 $ + * last change: $Author: oj $ $Date: 2001-07-16 07:55:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1330,24 +1330,34 @@ sal_Bool OTableEditorCtrl::IsCutAllowed( long nRow ) sal_Bool OTableEditorCtrl::IsCopyAllowed( long nRow ) { DBG_CHKTHIS(OTableEditorCtrl,NULL); - Reference<XPropertySet> xTable = GetView()->getController()->getTable(); - if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) - return sal_False; - - ////////////////////////////////////////////////////////////////////// - // Wenn eine der markierten Zeilen leer ist, kein Copy moeglich - OTableRow* pRow; - long nIndex = FirstSelectedRow(); - while( nIndex >= 0 ) + sal_Bool bIsCopyAllowed = sal_False; + if(m_eChildFocus == DESCRIPTION) + bIsCopyAllowed = pDescrCell->GetSelected().Len() != 0; + else if(m_eChildFocus == NAME) + bIsCopyAllowed = pNameCell->GetSelected().Len() != 0; + else if(m_eChildFocus == ROW) { - pRow = (*m_pRowList)[nIndex]; - if( !pRow->GetActFieldDescr() ) + Reference<XPropertySet> xTable = GetView()->getController()->getTable(); + if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) return sal_False; - nIndex = NextSelectedRow(); + ////////////////////////////////////////////////////////////////////// + // Wenn eine der markierten Zeilen leer ist, kein Copy moeglich + OTableRow* pRow; + long nIndex = FirstSelectedRow(); + while( nIndex >= 0 ) + { + pRow = (*m_pRowList)[nIndex]; + if( !pRow->GetActFieldDescr() ) + return sal_False; + + nIndex = NextSelectedRow(); + } + + bIsCopyAllowed = sal_True; } - return sal_True; + return bIsCopyAllowed; } //------------------------------------------------------------------------------ @@ -1414,12 +1424,18 @@ void OTableEditorCtrl::Paste() else if(m_eChildFocus == NAME) { if(GetView()->getController()->isAlterAllowed()) + { pNameCell->Paste(); + CellModified(); + } } else if(m_eChildFocus == DESCRIPTION) { if(GetView()->getController()->isAlterAllowed()) + { pDescrCell->Paste(); + CellModified(); + } } } |