User: ihi Date: 2006/08/28 08:05:21 Modified: dba/dbaccess/source/ui/app/AppController.cxx
Log: INTEGRATION: CWS dba205a (1.31.10); FILE MERGED 2006/08/22 07:09:51 oj 1.31.10.2: #i67014# correct table name 2006/07/28 13:03:08 oj 1.31.10.1: #i67014# replaceElement now uses the correct name for table/view File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.32&r2=1.33 Delta lines: +25 -11 --------------------- --- AppController.cxx 19 Jul 2006 22:33:43 -0000 1.32 +++ AppController.cxx 28 Aug 2006 15:05:18 -0000 1.33 @@ -769,21 +769,24 @@ aReturn.bEnabled = getContainer()->getElementType() == E_TABLE && isConnected(); break; case SID_DB_APP_DSPROPS: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); aReturn.bEnabled = DST_EMBEDDED != eType && DST_MOZILLA != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; } break; case SID_DB_APP_DSCONNECTION_TYPE: - if ( (aReturn.bEnabled = !isDataSourceReadOnly() && m_xDataSource.is()) ) + aReturn.bEnabled = !isDataSourceReadOnly(); + if ( aReturn.bEnabled && m_xDataSource.is() ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); aReturn.bEnabled = DST_EMBEDDED != eType; } break; case SID_DB_APP_DSADVANCED_SETTINGS: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); aReturn.bEnabled = DST_EMBEDDED != eType && DST_LDAP != eType && DST_CALC != eType && DST_MOZILLA != eType && DST_THUNDERBIRD != eType && DST_EVOLUTION != eType && DST_KAB != eType && DST_OUTLOOK != eType && DST_OUTLOOKEXP != eType; @@ -834,7 +837,8 @@ aReturn.bEnabled = sal_False; break; case SID_DB_APP_STATUS_TYPE: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) { DATASOURCE_TYPE eType = m_aTypeCollection.getType(::comphelper::getString(m_xDataSource->getPropertyValue(PROPERTY_URL))); ::rtl::OUString sDSTypeName = m_aTypeCollection.getTypeDisplayName(eType); @@ -842,7 +846,8 @@ } break; case SID_DB_APP_STATUS_DBNAME: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) { ::rtl::OUString sTemp; m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sTemp; @@ -878,11 +883,13 @@ } break; case SID_DB_APP_STATUS_USERNAME: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) m_xDataSource->getPropertyValue( PROPERTY_USER ) >>= aReturn.sTitle; break; case SID_DB_APP_STATUS_HOSTNAME: - if ( (aReturn.bEnabled = m_xDataSource.is()) ) + aReturn.bEnabled = m_xDataSource.is(); + if ( aReturn.bEnabled ) { ::rtl::OUString sTemp; m_xDataSource->getPropertyValue(PROPERTY_URL) >>= sTemp; @@ -1831,7 +1838,7 @@ ::std::auto_ptr< OSaveAsDlg > aDialog; Reference<XRename> xRename; - ElementType eType = getContainer()->getElementType(); + const ElementType eType = getContainer()->getElementType(); switch( eType ) { case E_FORM: @@ -1905,7 +1912,7 @@ ::rtl::OUString sCatalog = aDialog->getCatalog(); ::rtl::OUString sSchema = aDialog->getSchema(); - sNewName = ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sName, sal_False, ::dbtools::eInTableDefinitions ); + sNewName = ::dbtools::composeTableName( m_xMetaData, sCatalog, sSchema, sName, sal_False, ::dbtools::eInDataManipulation ); } else sNewName = aDialog->getName(); @@ -1923,7 +1930,14 @@ xRename->rename(sNewName); if ( !Reference< XNameAccess >( xRename, UNO_QUERY ).is() ) - getContainer()->elementReplaced( getContainer()->getElementType(), sOldName, sNewName, getConnection() ); + { + if ( eType == E_TABLE ) + { + Reference<XPropertySet> xProp(xRename,UNO_QUERY); + sNewName = ::dbaui::composeTableName( m_xMetaData, xProp, ::dbtools::eInDataManipulation, false, false, false ); + } + getContainer()->elementReplaced( eType , sOldName, sNewName, getConnection(),xRename ); + } bTryAgain = sal_False; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
