From: Uwe Stöhr Date: Tue, 19 Aug 2008 22:06:10 +0000 (+0000) Subject: InsetHyperlink.cpp: add "http://" when the hyperlink type is web and no protocol... X-Git-Tag: 1.6.10~3608 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a258a932d9d5f64dbc53f0577f704df2f61fd472;p=features.git InsetHyperlink.cpp: add "http://" when the hyperlink type is web and no protocol is specified (as requested on the lyx-devel list) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26218 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index fed64bece2..9b75a9e0a3 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -84,6 +84,13 @@ int InsetHyperlink::latex(odocstream & os, OutputParams const & runparams) const url.replace(pos, 1, backslash + chars_url[k]); } } + + // add "http://" when the type is web (type = empty) + // and no "://" is given + docstring type = getParam("type"); + if (url.find(from_ascii("://")) == string::npos && type == "") + url = from_ascii("http://") + url; + } // end if (!url.empty()) docstring name = getParam("name");