[Libreoffice-commits] core.git: dbaccess/source

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Wed Jul 2 04:26:44 PDT 2014


 dbaccess/source/ui/dlg/ConnectionPage.cxx         |   11 ++++++-----
 dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx |   10 ++++++----
 dbaccess/source/ui/dlg/detailpages.cxx            |    7 ++++---
 3 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit bcdd1f3179ab6f4ae72c6ac5b82f7fb4d2e54c16
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sat Jun 28 17:24:10 2014 +0200

    fdo#68341 Remove space of java class when testing class
    
    When user hit "Test class" it trims the string
    User should test class name before going next step
    
    Change-Id: Ic4aa6cb4b821f156cf0ec8c0c09a27db8bd6d51c
    Reviewed-on: https://gerrit.libreoffice.org/9953
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index a3eb754..ddb1a76 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -246,7 +246,7 @@ namespace dbaui
             m_aJavaDriverLabel.Show(bEnableJDBC);
             m_aJavaDriver.Show(bEnableJDBC);
             m_aTestJavaDriver.Show(bEnableJDBC);
-            m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().isEmpty() );
+            m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().trim().isEmpty() );
             m_aFL3.Show(bEnableJDBC);
 
             checkTestConnection();
@@ -307,10 +307,11 @@ namespace dbaui
 #if HAVE_FEATURE_JAVA
         try
         {
-            if ( !m_aJavaDriver.GetText().isEmpty() )
+            if ( !m_aJavaDriver.GetText().trim().isEmpty() )
             {
                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
-                bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aJavaDriver.GetText());
+                m_aJavaDriver.SetText(m_aJavaDriver.GetText().trim()); // fdo#68341
+                bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aJavaDriver.GetText().trim());
             }
         }
         catch(Exception&)
@@ -329,14 +330,14 @@ namespace dbaui
         OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
         bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty();
         if ( m_pCollection->determineType(m_eType) ==  ::dbaccess::DST_JDBC )
-            bEnableTestConnection = bEnableTestConnection && (!m_aJavaDriver.GetText().isEmpty());
+            bEnableTestConnection = bEnableTestConnection && (!m_aJavaDriver.GetText().trim().isEmpty());
         m_aTestConnection.Enable(bEnableTestConnection);
         return true;
     }
     IMPL_LINK(OConnectionTabPage, OnEditModified, Edit*, _pEdit)
     {
         if ( _pEdit == &m_aJavaDriver )
-            m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().isEmpty() );
+            m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().trim().isEmpty() );
 
         checkTestConnection();
         // tell the listener we were modified
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 27d5b97..0944649 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -479,7 +479,7 @@ using namespace ::com::sun::star;
         OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
 
         // to get the correct value when saveValue was called by base class
-        if ( m_aETDriverClass.GetText().isEmpty() )
+        if ( m_aETDriverClass.GetText().trim().isEmpty() )
         {
             m_aETDriverClass.SetText(m_sDefaultJdbcDriverName);
             m_aETDriverClass.SetModifyFlag();
@@ -498,10 +498,11 @@ using namespace ::com::sun::star;
 #if HAVE_FEATURE_JAVA
         try
         {
-            if ( !m_aETDriverClass.GetText().isEmpty() )
+            if ( !m_aETDriverClass.GetText().trim().isEmpty() )
             {
 // TODO change jvmaccess
                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
+                m_aETDriverClass.SetText(m_aETDriverClass.GetText().trim()); // fdo#68341
                 bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
             }
         }
@@ -519,8 +520,8 @@ using namespace ::com::sun::star;
     IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
     {
         if ( _pEdit == &m_aETDriverClass )
-            m_aPBTestJavaDriver.Enable( !m_aETDriverClass.GetText().isEmpty() );
-        bool bRoadmapState = ((!m_aETDatabasename.GetText().isEmpty() ) && ( !m_aETHostname.GetText().isEmpty() ) && (!m_aNFPortNumber.GetText().isEmpty() ) && ( !m_aETDriverClass.GetText().isEmpty() ));
+            m_aPBTestJavaDriver.Enable( !m_aETDriverClass.GetText().trim().isEmpty() );
+        bool bRoadmapState = ((!m_aETDatabasename.GetText().isEmpty() ) && ( !m_aETHostname.GetText().isEmpty() ) && (!m_aNFPortNumber.GetText().isEmpty() ) && ( !m_aETDriverClass.GetText().trim().isEmpty() ));
         SetRoadmapStateValue(bRoadmapState);
         callModifiedHdl();
         return 0L;
@@ -611,6 +612,7 @@ using namespace ::com::sun::star;
             {
 // TODO change jvmaccess
                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
+                m_aETDriverClass.SetText(m_aETDriverClass.GetText().trim()); // fdo#68341
                 bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
             }
         }
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 6292393..f4ffd3d 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -554,7 +554,7 @@ namespace dbaui
         OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
 
         // to get the correcxt value when saveValue was called by base class
-        if ( m_bUseClass && m_aEDDriverClass.GetText().isEmpty() )
+        if ( m_bUseClass && m_aEDDriverClass.GetText().trim().isEmpty() )
         {
             m_aEDDriverClass.SetText(m_sDefaultJdbcDriverName);
             m_aEDDriverClass.SetModifyFlag();
@@ -569,10 +569,11 @@ namespace dbaui
 #if HAVE_FEATURE_JAVA
         try
         {
-            if ( !m_aEDDriverClass.GetText().isEmpty() )
+            if ( !m_aEDDriverClass.GetText().trim().isEmpty() )
             {
 // TODO change jvmaccess
                 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
+                m_aEDDriverClass.SetText(m_aEDDriverClass.GetText().trim()); // fdo#68341
                 bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aEDDriverClass.GetText());
             }
         }
@@ -589,7 +590,7 @@ namespace dbaui
     IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit)
     {
         if ( m_bUseClass && _pEdit == &m_aEDDriverClass )
-            m_aTestJavaDriver.Enable( !m_aEDDriverClass.GetText().isEmpty() );
+            m_aTestJavaDriver.Enable( !m_aEDDriverClass.GetText().trim().isEmpty() );
 
         // tell the listener we were modified
         callModifiedHdl();


More information about the Libreoffice-commits mailing list