diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2014-06-28 17:24:10 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-02 11:26:20 +0000 |
commit | bcdd1f3179ab6f4ae72c6ac5b82f7fb4d2e54c16 (patch) | |
tree | c3db9a3822311ee34e3d65a8eaa27281e6582ff2 /dbaccess/source/ui/dlg | |
parent | e9dd058ccd0de193cdbc9ae8638f603569249c5e (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 11 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 10 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 7 |
3 files changed, 16 insertions, 12 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index a3eb7543ae6b..ddb1a7672820 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 27d5b97134f1..094464971079 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 629239337f56..f4ffd3dadee0 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(); |