User: hr Date: 2007-11-02 11:28:36+0000 Modified: dba/dbaccess/source/ui/tabledesign/TableController.cxx
Log: INTEGRATION: CWS dba231a_SRC680 (1.112.28); FILE MERGED 2007/10/04 11:01:00 oj 1.112.28.1: #i81567# ceck error when update colun File Changes: Directory: /dba/dbaccess/source/ui/tabledesign/ =============================================== File [changed]: TableController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/TableController.cxx?r1=1.113&r2=1.114 Delta lines: +7 -3 ------------------- --- TableController.cxx 2007-09-26 14:53:46+0000 1.113 +++ TableController.cxx 2007-11-02 11:28:34+0000 1.114 @@ -1173,7 +1173,6 @@ // contains all columns names which are already handled those which are not in the list will be deleted Reference< XDatabaseMetaData> xMetaData = getMetaData( ); - ::std::map< ::rtl::OUString,sal_Bool,::comphelper::UStringMixLess> aColumns(xMetaData.is() ? (xMetaData->supportsMixedCaseQuotedIdentifiers() ? true : false): sal_True); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_vRowList.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_vRowList.end(); @@ -1337,6 +1336,11 @@ OSQLMessageBox aMsg(getView(),sTitle,aMessage,WB_YES_NO|WB_DEF_YES,OSQLMessageBox::Warning); if ( aMsg.Execute() != RET_YES ) { + Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW); + ::rtl::OUString sName; + xNewColumn->getPropertyValue(PROPERTY_NAME) >>= sName; + aColumns[sName] = sal_True; + aColumns[pField->GetName()] = sal_True; continue; } } @@ -1350,7 +1354,7 @@ // second drop all columns which could be found by name Reference<XNameAccess> xKeyColumns = getKeyColumns(); // now we have to look for the columns who could be deleted - if(xDrop.is()) + if ( xDrop.is() ) { Sequence< ::rtl::OUString> aColumnNames = xColumns->getElementNames(); const ::rtl::OUString* pIter = aColumnNames.getConstArray(); @@ -1402,7 +1406,7 @@ { OSL_ENSURE(*aIter,"OTableRow is null!"); OFieldDescription* pField = (*aIter)->GetActFieldDescr(); - if ( !pField || (*aIter)->IsReadOnly() ) + if ( !pField || (*aIter)->IsReadOnly() || aColumns.find(pField->GetName()) != aColumns.end() ) continue; Reference<XPropertySet> xColumn; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
