diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-10 12:09:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-11 08:44:09 +0200 |
commit | 71337b4327805b73e92c995153c5746d89793b13 (patch) | |
tree | fd66764b57912cb2a8b86618e97f1e90d607d2cd /sw/source/uibase/dbui | |
parent | bab44a97d21d0ac8a8a06678e71024c1a830943f (diff) |
use more string_view in sw
Change-Id: Ibefb8549834ba5011286e3221f1ae276e2c0c0bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141153
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dbui')
-rw-r--r-- | sw/source/uibase/dbui/mailmergehelper.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index b123b2df7ebd..d6efcfc675c5 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -78,13 +78,13 @@ OUString CallSaveAsDialog(weld::Window* pParent, OUString& rFilter) for at least one character before the dot and for at least two characters after the dot */ -bool CheckMailAddress( const OUString& rMailAddress ) +bool CheckMailAddress( std::u16string_view aMailAddress ) { - const sal_Int32 nPosAt = rMailAddress.indexOf('@'); - if (nPosAt<0 || rMailAddress.lastIndexOf('@')!=nPosAt) + const size_t nPosAt = aMailAddress.find('@'); + if (nPosAt == std::u16string_view::npos || aMailAddress.rfind('@')!=nPosAt) return false; - const sal_Int32 nPosDot = rMailAddress.indexOf('.', nPosAt); - return !(nPosDot<0 || nPosDot-nPosAt<2 || rMailAddress.getLength()-nPosDot<3); + const size_t nPosDot = aMailAddress.find('.', nPosAt); + return !(nPosDot==std::u16string_view::npos || nPosDot-nPosAt<2 || aMailAddress.size()-nPosDot<3); } uno::Reference< mail::XSmtpService > ConnectToSmtpServer( |