Tag: cws_src680_dba205b
User: oj      
Date: 2006/09/04 05:03:16

Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 RESYNC: (1.32-1.33); FILE MERGED

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.8.1&r2=1.32.8.2
Delta lines:  +28 -14
---------------------
--- AppController.cxx   3 Aug 2006 10:05:23 -0000       1.32.8.1
+++ AppController.cxx   4 Sep 2006 12:03:13 -0000       1.32.8.2
@@ -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:
@@ -1906,7 +1913,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();
@@ -1924,7 +1931,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]

Reply via email to