diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 08:29:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 12:57:22 +0200 |
commit | c45bc08dc6e64352e11cf632b8ad868c312a62fe (patch) | |
tree | 4b665726f2a4ffb556e51915dcc5e2515c21d1b7 /dbaccess | |
parent | 08495e24e899c2fd52b9724d993598189e12fc7e (diff) |
loplugin:stringview whitelist getLength and isEmpty
Change-Id: I38f3410c0b25ff579879b9de1f266af4d8fd51e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150256
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionPage.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/detailpages.cxx | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index e867ba266688..fa485a97b2df 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -204,7 +204,7 @@ namespace dbaui m_xJavaDriverLabel->set_visible(bEnableJDBC); m_xJavaDriver->set_visible(bEnableJDBC); m_xTestJavaDriver->set_visible(bEnableJDBC); - m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() ); + m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() ); m_xFL3->set_visible(bEnableJDBC); checkTestConnection(); @@ -244,7 +244,7 @@ namespace dbaui #if HAVE_FEATURE_JAVA try { - if ( !m_xJavaDriver->get_text().trim().isEmpty() ) + if ( !o3tl::trim(m_xJavaDriver->get_text()).empty() ) { ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); m_xJavaDriver->set_text(m_xJavaDriver->get_text().trim()); // fdo#68341 @@ -266,14 +266,14 @@ namespace dbaui OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); bool bEnableTestConnection = !m_xConnectionURL->get_visible() || !m_xConnectionURL->GetTextNoPrefix().isEmpty(); if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) - bEnableTestConnection = bEnableTestConnection && (!m_xJavaDriver->get_text().trim().isEmpty()); + bEnableTestConnection = bEnableTestConnection && (!o3tl::trim(m_xJavaDriver->get_text()).empty()); m_xTestConnection->set_sensitive(bEnableTestConnection); return true; } IMPL_LINK(OConnectionTabPage, OnEditModified, weld::Entry&, rEdit, void) { if (&rEdit == m_xJavaDriver.get()) - m_xTestJavaDriver->set_sensitive( !m_xJavaDriver->get_text().trim().isEmpty() ); + m_xTestJavaDriver->set_sensitive( !o3tl::trim(m_xJavaDriver->get_text()).empty() ); checkTestConnection(); // tell the listener we were modified diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 299dfa6b34cb..a5041ae2af12 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -448,7 +448,7 @@ using namespace ::com::sun::star; OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); // to get the correct value when saveValue was called by base class - if ( m_xETDriverClass->get_text().trim().isEmpty() ) + if ( o3tl::trim(m_xETDriverClass->get_text()).empty() ) { m_xETDriverClass->set_text(m_sDefaultJdbcDriverName); m_xETDriverClass->save_value(); @@ -467,7 +467,7 @@ using namespace ::com::sun::star; #if HAVE_FEATURE_JAVA try { - if ( !m_xETDriverClass->get_text().trim().isEmpty() ) + if ( !o3tl::trim(m_xETDriverClass->get_text()).empty() ) { // TODO change jvmaccess ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); @@ -488,8 +488,8 @@ using namespace ::com::sun::star; void OGeneralSpecialJDBCConnectionPageSetup::callModifiedHdl(weld::Widget* pControl) { if (pControl == m_xETDriverClass.get()) - m_xPBTestJavaDriver->set_sensitive( !m_xETDriverClass->get_text().trim().isEmpty() ); - bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !m_xETDriverClass->get_text().trim().isEmpty() )); + m_xPBTestJavaDriver->set_sensitive( !o3tl::trim(m_xETDriverClass->get_text()).empty() ); + bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !o3tl::trim(m_xETDriverClass->get_text()).empty() )); SetRoadmapStateValue(bRoadmapState); OGenericAdministrationPage::callModifiedHdl(); } diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 57ae3bd59fd7..1e8f94a89b79 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -442,7 +442,7 @@ namespace dbaui OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue); // to get the correct value when saveValue was called by base class - if ( m_bUseClass && m_xEDDriverClass->get_text().trim().isEmpty() ) + if ( m_bUseClass && o3tl::trim(m_xEDDriverClass->get_text()).empty() ) { m_xEDDriverClass->set_text(m_sDefaultJdbcDriverName); m_xEDDriverClass->save_value(); @@ -457,7 +457,7 @@ namespace dbaui #if HAVE_FEATURE_JAVA try { - if (!m_xEDDriverClass->get_text().trim().isEmpty()) + if (!o3tl::trim(m_xEDDriverClass->get_text()).empty()) { // TODO change jvmaccess ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() ); @@ -478,7 +478,7 @@ namespace dbaui void OGeneralSpecialJDBCDetailsPage::callModifiedHdl(weld::Widget* pControl) { if (m_bUseClass && pControl == m_xEDDriverClass.get()) - m_xTestJavaDriver->set_sensitive(!m_xEDDriverClass->get_text().trim().isEmpty()); + m_xTestJavaDriver->set_sensitive(!o3tl::trim(m_xEDDriverClass->get_text()).empty()); // tell the listener we were modified OGenericAdministrationPage::callModifiedHdl(); |