Tag: cws_src680_dba24d
User: fs      
Date: 2007-11-19 11:16:40+0000
Modified:
   dba/dbaccess/source/ui/dlg/generalpage.cxx
   dba/dbaccess/source/ui/dlg/generalpage.hxx

Log:
 #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.52&r2=1.52.2.1
Delta lines:  +31 -29
---------------------
--- generalpage.cxx     2007-11-01 15:13:21+0000        1.52
+++ generalpage.cxx     2007-11-19 11:16:37+0000        1.52.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: generalpage.cxx,v $
  *
- *  $Revision: 1.52 $
+ *  $Revision: 1.52.2.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/11/01 15:13:21 $
+ *  last change: $Author: fs $ $Date: 2007/11/19 11:16:37 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -228,8 +228,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 ) );
                                }
                        }
@@ -398,11 +397,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;
@@ -411,7 +410,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);
@@ -432,19 +431,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;
        }
 
 

File [changed]: generalpage.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/generalpage.hxx?r1=1.19&r2=1.19.2.1
Delta lines:  +4 -4
-------------------
--- generalpage.hxx     2007-11-01 15:13:35+0000        1.19
+++ generalpage.hxx     2007-11-19 11:16:38+0000        1.19.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: generalpage.hxx,v $
  *
- *  $Revision: 1.19 $
+ *  $Revision: 1.19.2.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/11/01 15:13:35 $
+ *  last change: $Author: fs $ $Date: 2007/11/19 11:16:38 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -128,7 +128,7 @@
         Link                m_aChooseDocumentHandler;       /// to be called 
when a recent document has been definately chosen
                sal_Bool                        m_bDisplayingInvalid : 1;       
// the currently displayed data source is deleted
                sal_Bool                        m_bUserGrabFocus : 1;
-               String                          
VerifyDisplayName(DATASOURCE_TYPE eType, String _sDisplayName);
+               bool                approveDataSourceType( DATASOURCE_TYPE 
eType, String& _inout_rDisplayName );
                void                            
insertDatasourceTypeEntryData(DATASOURCE_TYPE eType, String sDisplayName);
 
        public:




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

Reply via email to