From 16441a6914f594818576056a5a53a86344ab4ca6 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 2 Nov 2007 13:56:46 +0000 Subject: [PATCH] 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 --- src/insets/InsetHyperlink.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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; } -- 2.39.2