User: vg Date: 05/03/10 08:54:34 Modified: /dba/dbaccess/source/ui/tabledesign/ TEditControl.cxx
Log: INTEGRATION: CWS dba24 (1.40.20); FILE MERGED 2005/02/22 06:35:04 oj 1.40.20.3: RESYNC: (1.40-1.41); FILE MERGED 2005/02/21 09:13:58 oj 1.40.20.2: #119863 # check if index is less than vector 2005/02/10 11:25:15 oj 1.40.20.1: #i37008# save the data before openiong the context menu File Changes: Directory: /dba/dbaccess/source/ui/tabledesign/ =============================================== File [changed]: TEditControl.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TEditControl.cxx?r1=1.41&r2=1.42 Delta lines: +17 -8 -------------------- --- TEditControl.cxx 17 Feb 2005 11:09:34 -0000 1.41 +++ TEditControl.cxx 10 Mar 2005 16:54:31 -0000 1.42 @@ -345,7 +345,7 @@ xCon = GetView()->getController()->getConnection(); Reference< XDatabaseMetaData> xMetaData = xCon.is() ? xCon->getMetaData() : Reference< XDatabaseMetaData>(); - nMaxTextLen = ((xub_StrLen)xMetaData.is() ? xMetaData->getMaxColumnNameLength() : 0); + nMaxTextLen = ((xub_StrLen)xMetaData.is() ? static_cast<xub_StrLen>(xMetaData->getMaxColumnNameLength()) : 0); if( nMaxTextLen == 0 ) nMaxTextLen = EDIT_NOLIMIT; @@ -907,12 +907,16 @@ ::std::vector<OTableRow*> vClipboardList; vClipboardList.reserve(GetSelectRowCount()); - for( long nIndex=FirstSelectedRow(); nIndex>=0; nIndex=NextSelectedRow() ) + for( long nIndex=FirstSelectedRow(); nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()); nIndex=NextSelectedRow() ) { pRow = (*m_pRowList)[nIndex]; + OSL_ENSURE(pRow,"OTableEditorCtrl::CopyRows: Row is NULL!"); + if ( pRow ) + { pClipboardRow = new OTableRow( *pRow ); vClipboardList.push_back( pClipboardRow); } + } if(!vClipboardList.empty()) { OTableRowExchange* pData = new OTableRowExchange(vClipboardList); @@ -1023,7 +1027,7 @@ nOldDataPos = nIndex; bSaveOnMove = sal_False; - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { ////////////////////////////////////////////////////////////////////// // Zeile entfernen @@ -1379,7 +1383,7 @@ // Wenn eine der markierten Zeilen leer ist, kein Copy moeglich OTableRow* pRow; long nIndex = FirstSelectedRow(); - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { pRow = (*m_pRowList)[nIndex]; if( !pRow->GetActFieldDescr() ) @@ -1553,7 +1557,7 @@ // - kein DROP erlaubt ist (s.o.) und die Spalte noch kein Required (not null) gesetzt hatte. long nIndex = FirstSelectedRow(); OTableRow* pRow; - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { pRow = (*m_pRowList)[nIndex]; OFieldDescription* pFieldDescr = pRow->GetActFieldDescr(); @@ -1654,6 +1658,9 @@ // jetzt alles, was disabled wurde, wech aContextMenu.RemoveDisabledEntries(sal_True, sal_True); + if( SetDataPtr(m_nDataPos) ) + pDescrWin->SaveData( pActRow->GetActFieldDescr() ); + ////////////////////////////////////////////////////////////// // Alle Aktionen, die die Zeilenzahl veraendern, muessen asynchron // ausgefuehrt werden->sonst Probleme zwischen Kontextmenu u. Browser @@ -1804,7 +1811,7 @@ if( bSet ) { nIndex = FirstSelectedRow(); - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { ////////////////////////////////////////////////////////////////////// // Key setzen @@ -1864,6 +1871,8 @@ // Alte Beschreibung speichern pDescrWin->SaveData( pActFieldDescr ); + if ( nRow < 0 || nRow > static_cast<long>(m_pRowList->size()) ) + return; ////////////////////////////////////////////////////////////////////// // Neue Beschreibung darstellen OTableRow* pRow = (*m_pRowList)[nRow]; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
