Kaydet (Commit) bcdd1f31 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Caolán McNamara

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/9953Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e9dd058c
...@@ -246,7 +246,7 @@ namespace dbaui ...@@ -246,7 +246,7 @@ namespace dbaui
m_aJavaDriverLabel.Show(bEnableJDBC); m_aJavaDriverLabel.Show(bEnableJDBC);
m_aJavaDriver.Show(bEnableJDBC); m_aJavaDriver.Show(bEnableJDBC);
m_aTestJavaDriver.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); m_aFL3.Show(bEnableJDBC);
checkTestConnection(); checkTestConnection();
...@@ -307,10 +307,11 @@ namespace dbaui ...@@ -307,10 +307,11 @@ namespace dbaui
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if ( !m_aJavaDriver.GetText().isEmpty() ) if ( !m_aJavaDriver.GetText().trim().isEmpty() )
{ {
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::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&) catch(Exception&)
...@@ -329,14 +330,14 @@ namespace dbaui ...@@ -329,14 +330,14 @@ namespace dbaui
OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty(); bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || !m_aConnectionURL.GetTextNoPrefix().isEmpty();
if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) 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); m_aTestConnection.Enable(bEnableTestConnection);
return true; return true;
} }
IMPL_LINK(OConnectionTabPage, OnEditModified, Edit*, _pEdit) IMPL_LINK(OConnectionTabPage, OnEditModified, Edit*, _pEdit)
{ {
if ( _pEdit == &m_aJavaDriver ) if ( _pEdit == &m_aJavaDriver )
m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().isEmpty() ); m_aTestJavaDriver.Enable( !m_aJavaDriver.GetText().trim().isEmpty() );
checkTestConnection(); checkTestConnection();
// tell the listener we were modified // tell the listener we were modified
......
...@@ -479,7 +479,7 @@ using namespace ::com::sun::star; ...@@ -479,7 +479,7 @@ using namespace ::com::sun::star;
OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
// to get the correct value when saveValue was called by base class // 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.SetText(m_sDefaultJdbcDriverName);
m_aETDriverClass.SetModifyFlag(); m_aETDriverClass.SetModifyFlag();
...@@ -498,10 +498,11 @@ using namespace ::com::sun::star; ...@@ -498,10 +498,11 @@ using namespace ::com::sun::star;
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if ( !m_aETDriverClass.GetText().isEmpty() ) if ( !m_aETDriverClass.GetText().trim().isEmpty() )
{ {
// TODO change jvmaccess // TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::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()); bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
} }
} }
...@@ -519,8 +520,8 @@ using namespace ::com::sun::star; ...@@ -519,8 +520,8 @@ using namespace ::com::sun::star;
IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit) IMPL_LINK(OGeneralSpecialJDBCConnectionPageSetup, OnEditModified, Edit*, _pEdit)
{ {
if ( _pEdit == &m_aETDriverClass ) if ( _pEdit == &m_aETDriverClass )
m_aPBTestJavaDriver.Enable( !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().isEmpty() )); bool bRoadmapState = ((!m_aETDatabasename.GetText().isEmpty() ) && ( !m_aETHostname.GetText().isEmpty() ) && (!m_aNFPortNumber.GetText().isEmpty() ) && ( !m_aETDriverClass.GetText().trim().isEmpty() ));
SetRoadmapStateValue(bRoadmapState); SetRoadmapStateValue(bRoadmapState);
callModifiedHdl(); callModifiedHdl();
return 0L; return 0L;
...@@ -611,6 +612,7 @@ using namespace ::com::sun::star; ...@@ -611,6 +612,7 @@ using namespace ::com::sun::star;
{ {
// TODO change jvmaccess // TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::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()); bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
} }
} }
......
...@@ -554,7 +554,7 @@ namespace dbaui ...@@ -554,7 +554,7 @@ namespace dbaui
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
// to get the correcxt value when saveValue was called by base class // 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.SetText(m_sDefaultJdbcDriverName);
m_aEDDriverClass.SetModifyFlag(); m_aEDDriverClass.SetModifyFlag();
...@@ -569,10 +569,11 @@ namespace dbaui ...@@ -569,10 +569,11 @@ namespace dbaui
#if HAVE_FEATURE_JAVA #if HAVE_FEATURE_JAVA
try try
{ {
if ( !m_aEDDriverClass.GetText().isEmpty() ) if ( !m_aEDDriverClass.GetText().trim().isEmpty() )
{ {
// TODO change jvmaccess // TODO change jvmaccess
::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); ::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()); bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aEDDriverClass.GetText());
} }
} }
...@@ -589,7 +590,7 @@ namespace dbaui ...@@ -589,7 +590,7 @@ namespace dbaui
IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit) IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit)
{ {
if ( m_bUseClass && _pEdit == &m_aEDDriverClass ) 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 // tell the listener we were modified
callModifiedHdl(); callModifiedHdl();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment