cui/source/dialogs/hlmailtp.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit a8795a983b48ed7b9820b746fb70c173a7d230b1
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Jan 18 14:00:44 2022 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Jan 18 17:49:02 2022 +0100

    Use "smart" INetURLObject ctor for user input right away
    
    ... instead of trying to process it strict, falling back to smart
    processing on error.
    
    Similar change was implemented to SvxHyperlinkInternetTp in
    commit 6b973753d407d66dfa5fda86547246c486ab7087. Trying to
    parse it strict initially there resulted in wrong detection
    of "generic" protocol in incomplete URLs missing scheme and
    having port. This change simply unifies the code, no specific
    behavior change intended.
    
    Change-Id: I48ba4187a27644f42f3fd5a3b6cd77e55038cb0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128534
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index 521af033b422..f02a8f7653ee 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -120,13 +120,7 @@ void SvxHyperlinkMailTp::GetCurentItemData ( OUString& 
rStrURL, OUString& aStrNa
 OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const
 {
     OUString aStrURL = m_xCbbReceiver->get_active_text();
-    INetURLObject aURL(aStrURL);
-
-    if( aURL.GetProtocol() == INetProtocol::NotValid )
-    {
-        aURL.SetSmartProtocol( INetProtocol::Mailto );
-        aURL.SetSmartURL(aStrURL);
-    }
+    INetURLObject aURL(aStrURL, INetProtocol::Mailto);
 
     // subject for EMail-url
     if( aURL.GetProtocol() == INetProtocol::Mailto )

Reply via email to