User: vg      
Date: 05/03/10 08:48:22

Modified:
 /dba/dbaccess/source/ui/dlg/
  DbAdminImpl.cxx

Log:
 INTEGRATION: CWS dba24 (1.7.4); FILE MERGED
 2005/02/23 07:41:48 oj 1.7.4.4: #i42461# reinvent the opening of database 
documents
 2005/02/18 12:42:18 oj 1.7.4.3: #i42460# changes for the separation of 
datasource and database document(model)
 2005/02/09 10:08:00 oj 1.7.4.2: #i42289# check if host name was set, if not it 
could be a simple jdbc url which looks identical to oracle
 2005/01/27 07:16:57 oj 1.7.4.1: #i41271# check if ds name is empty

File Changes:

Directory: /dba/dbaccess/source/ui/dlg/
=======================================

File [changed]: DbAdminImpl.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/DbAdminImpl.cxx?r1=1.7&r2=1.8
Delta lines:  +43 -16
---------------------
--- DbAdminImpl.cxx     21 Jan 2005 17:12:45 -0000      1.7
+++ DbAdminImpl.cxx     10 Mar 2005 16:48:20 -0000      1.8
@@ -330,9 +330,19 @@
                        aDlg.SetName(pUser ? pUser->GetValue() : String());
                        aDlg.ClearPassword();  // this will give the password 
field the focus
 
+            String sName = pName ? pName->GetValue() : String();
                        String 
sLoginRequest(ModuleRes(STR_ENTER_CONNECTION_PASSWORD));
-                       sLoginRequest.SearchAndReplaceAscii("$name$", pName ? 
pName->GetValue() : String()),
+            ::rtl::OUString sTemp = sName;
+            sName = ::dbaui::getStrippedDatabaseName(NULL,sTemp);
+            if ( sName.Len() )
+                           sLoginRequest.SearchAndReplaceAscii("$name$", 
sName);
+            else
+            {
+                sLoginRequest.SearchAndReplaceAscii("\"$name$\"", String());
+                sLoginRequest.SearchAndReplaceAscii("$name$", String()); // 
just to be sure that in other languages the string will be deleted
+            }
                        aDlg.SetLoginRequestText(sLoginRequest);
+            
                        
aDlg.SetSavePasswordText(ModuleRes(STR_REMEMBERPASSWORD_SESSION));
                        aDlg.SetSavePassword(sal_True);
 
@@ -449,8 +459,8 @@
 {
        if ( !m_xDatasource.is() )
        {
-               m_xDatasource.set(m_aDataSourceName,UNO_QUERY);;
-               if ( !m_xDatasource.is() )
+               Reference<XInterface> xIn(m_aDataSourceName,UNO_QUERY);
+               if ( !xIn.is() )
                {
                        ::rtl::OUString sCurrentDatasource;
                        m_aDataSourceName >>= sCurrentDatasource;
@@ -459,13 +469,23 @@
                        {
                                if ( m_xDatabaseContext.is() )
                                        
m_xDatasource.set(m_xDatabaseContext->getByName(sCurrentDatasource),UNO_QUERY);
+                               xIn = m_xDatasource;
                        }
                        catch(const Exception&)
                        {
                        }
                }
+       m_xModel.set(getDataSourceOrModel(xIn),UNO_QUERY);
+               if ( m_xModel.is() )
+               m_xDatasource.set(xIn,UNO_QUERY);
+               else
+               {
+               m_xDatasource.set(getDataSourceOrModel(xIn),UNO_QUERY);
+               m_xModel.set(xIn,UNO_QUERY);
+               }
        }
        
+       
        DBG_ASSERT(m_xDatasource.is(), 
"ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!");
        return m_xDatasource;
 }
@@ -557,6 +577,8 @@
                                
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, 
DSID_CONN_HOSTNAME, sal_True);
                                
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, 
DSID_ORACLE_PORTNUMBER, sal_True);
                                
SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pDatabaseName, 
SfxStringItem, DSID_DATABASENAME, sal_True);
+                if ( pHostName && pHostName->GetValue().Len() )
+                {
                                sNewUrl = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("@"));
                                sNewUrl += 
lcl_createHostWithPort(pHostName,pPortNumber);
                                String sDatabaseName = pDatabaseName ? 
pDatabaseName->GetValue() : String();
@@ -568,6 +590,11 @@
                                        sNewUrl += sDatabaseName;
                                }
                        }
+                else
+                { // here someone entered a JDBC url which looks like oracle, 
so we have to use the url property
+
+                }
+                       }
                        break;
                case DST_LDAP:
                        {
@@ -679,7 +706,7 @@
        try
        {
                _rDest.Put(OPropertySetItem(DSID_DATASOURCE_UNO, _rxSource));
-               Reference<XStorable> xStore(_rxSource,UNO_QUERY);
+               Reference<XStorable> 
xStore(getDataSourceOrModel(_rxSource),UNO_QUERY);
                _rDest.Put(SfxBoolItem(DSID_READONLY, !xStore.is() || 
xStore->isReadonly() ));
        }
        catch(Exception&)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to