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
This commit is contained in:
Abdelrazak Younes 2007-11-02 13:56:46 +00:00
parent 668ed52302
commit 16441a6914

View File

@ -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;
}