User: rt      
Date: 2008-01-30 08:45:45+0000
Modified:
   dba/dbaccess/source/ui/dlg/generalpage.cxx

Log:
 INTEGRATION: CWS dba24d (1.52.2); FILE MERGED
 2007/12/01 13:40:52 fs 1.52.2.2: RESYNC: (1.52-1.53); FILE MERGED
 2007/11/19 11:16:37 fs 1.52.2.1: #i83593# filter embedded HSQL from the list 
of database types to connect to

File Changes:

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

File [changed]: generalpage.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/generalpage.cxx?r1=1.53&r2=1.54
Delta lines:  +28 -26
---------------------
--- generalpage.cxx     2007-11-21 15:57:53+0000        1.53
+++ generalpage.cxx     2008-01-30 08:45:43+0000        1.54
@@ -225,8 +225,7 @@
                                String sDisplayName = 
aTypeLoop.getDisplayName();
                                if ( m_pDatasourceType->GetEntryPos( 
sDisplayName ) == LISTBOX_ENTRY_NOTFOUND )
                                {
-                                       sDisplayName = VerifyDisplayName(eType, 
sDisplayName);
-                                       if ( sDisplayName.Len() > 0 )
+                                       if ( approveDataSourceType( eType, 
sDisplayName ) )
                         aDisplayedTypes.push_back( DisplayedTypes::value_type( 
eType, sDisplayName ) );
                                }
                        }
@@ -400,11 +399,11 @@
                        implSetCurrentType( m_pCollection->getType(sConnectURL) 
);
                        sDisplayName = 
m_pCollection->getTypeDisplayName(m_eCurrentSelection);
                }
-               sDisplayName = VerifyDisplayName(m_eCurrentSelection, 
sDisplayName);
+
                // select the correct datasource type
-               if (LISTBOX_ENTRY_NOTFOUND == 
m_pDatasourceType->GetEntryPos(sDisplayName))
-               {       // the type is not available on this platform (we 
omitted it in initializeTypeList)
-                       if (sDisplayName.Len())
+               if  (   approveDataSourceType( m_eCurrentSelection, 
sDisplayName )
+            &&  ( LISTBOX_ENTRY_NOTFOUND == m_pDatasourceType->GetEntryPos( 
sDisplayName ) )
+            )
                        {       // this indicates it's really a type which is 
known in general, but not supported on the current platform
                                // show a message saying so
                                //      eSpecialMessage = smUnsupportedType;
@@ -413,7 +412,7 @@
                                // type again (without changing the data source)
                                m_eNotSupportedKnownType = m_eCurrentSelection;
                        }
-               }
+
                if (m_aRB_CreateDatabase.IsChecked() && m_DBWizardMode)
             sDisplayName = m_pCollection->getTypeDisplayName(DST_JDBC);
                m_pDatasourceType->SelectEntry(sDisplayName);
@@ -434,19 +433,22 @@
 
        // For the databaseWizard we only have one entry for the MySQL Database,
        // because we have a seperate tabpage to retrieve the respective 
datasource type
-       //(DST_MYSQL_ODBC || DST_MYSQL_JDBC) Therefor we use DST_MYSQL_JDBC as 
a temporary
+       // (DST_MYSQL_ODBC || DST_MYSQL_JDBC). Therefore we use DST_MYSQL_JDBC 
as a temporary
        // representative for all MySQl databases)
-       String OGeneralPage::VerifyDisplayName(DATASOURCE_TYPE eType, String 
_sDisplayName)
-       {
-               String sLocDisplayName =  ::rtl::OUString::createFromAscii("");
-               if ((!m_DBWizardMode) || (eType != DST_MYSQL_ODBC))
+    // Also, embedded databases (embedded HSQL, at the moment), are not to 
appear in the list of
+    // databases to connect to.
+       bool OGeneralPage::approveDataSourceType( DATASOURCE_TYPE eType, 
String& _inout_rDisplayName )
                {
-                       if ((m_DBWizardMode) && (eType == DST_MYSQL_JDBC))
-                               sLocDisplayName = m_sMySQLEntry;
-                       else
-                               sLocDisplayName = _sDisplayName;
-               }
-               return sLocDisplayName;
+               if ( m_DBWizardMode && ( eType == DST_MYSQL_JDBC ) )
+                       _inout_rDisplayName = m_sMySQLEntry;
+
+        if ( m_DBWizardMode && ( eType == DST_MYSQL_ODBC ) )
+            _inout_rDisplayName = String();
+
+        if ( eType == DST_EMBEDDED_HSQLDB )
+            _inout_rDisplayName = String();
+
+        return _inout_rDisplayName.Len() > 0;
        }
 
 




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

Reply via email to