From: Abdelrazak Younes Date: Fri, 2 Nov 2007 13:56:46 +0000 (+0000) Subject: Fix concatenation bug introduced in rev 21363 and simplify the code a bit. X-Git-Tag: 1.6.10~7531 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=16441a6914f594818576056a5a53a86344ab4ca6;p=features.git Fix concatenation bug introduced in rev 21363 and simplify the code a bit. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21370 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index 55058dffa3..d38509b60e 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -120,18 +120,13 @@ int InsetHyperlink::latex(Buffer const &, odocstream & os, } // end if (!name.empty()) - //for the case there is no name given, the target is set as name - docstring const urlname = url; - // set the hyperlink type - url += getParam("type"); - if (runparams.moving_arg) os << "\\protect"; - //set the target for the name when no name is given - if (!name.empty()) - os << "\\href{" << url << "}{" << name << '}'; - else - os << "\\href{" << url << "}{" << urlname << '}'; + + //for the case there is no name given, the target is set as name + os << "\\href{" << getParam("type") << url << "}{" + << (name.empty()? url : name) << '}'; + return 0; }