Tag: cws_src680_dba30 User: fs Date: 05/03/30 02:29:23 Modified: /dba/dbaccess/source/ui/tabledesign/ TEditControl.cxx
Log: RESYNC: (1.41-1.42); FILE MERGED 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.6.1&r2=1.41.6.2 Delta lines: +20 -11 --------------------- --- TEditControl.cxx 22 Mar 2005 08:02:04 -0000 1.41.6.1 +++ TEditControl.cxx 30 Mar 2005 10:29:20 -0000 1.41.6.2 @@ -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; @@ -908,12 +908,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); @@ -1024,7 +1028,7 @@ nOldDataPos = nIndex; bSaveOnMove = sal_False; - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { ////////////////////////////////////////////////////////////////////// // Zeile entfernen @@ -1380,7 +1384,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() ) @@ -1554,7 +1558,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(); @@ -1655,6 +1659,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 @@ -1805,7 +1812,7 @@ if( bSet ) { nIndex = FirstSelectedRow(); - while( nIndex >= 0 ) + while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { ////////////////////////////////////////////////////////////////////// // Key setzen @@ -1865,6 +1872,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]
