mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Partially fix #5108.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35984 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f0b79f00fc
commit
96dfec471f
@ -77,21 +77,24 @@ docstring InsetRef::getFormattedCmd(
|
||||
docstring const & ref, docstring & label) const
|
||||
{
|
||||
static docstring const defcmd = from_ascii("\\ref");
|
||||
// default is that label is data
|
||||
// we'll change it if need be
|
||||
if (!buffer().params().use_refstyle) {
|
||||
label = ref;
|
||||
return from_ascii("\\prettyref");
|
||||
}
|
||||
|
||||
static docstring const prtcmd = from_ascii("\\prettyref");
|
||||
|
||||
docstring prefix;
|
||||
label = split(ref, prefix, ':');
|
||||
|
||||
// we have to have xxx:xxxxx...
|
||||
if (prefix.empty()) {
|
||||
LYXERR0("Label `" << label << "' contains no prefix.");
|
||||
label = ref;
|
||||
return defcmd;
|
||||
}
|
||||
|
||||
if (!buffer().params().use_refstyle) {
|
||||
// \prettyref uses the whole label
|
||||
label = ref;
|
||||
return prtcmd;
|
||||
}
|
||||
|
||||
// make sure the prefix is legal for a latex command
|
||||
int const len = prefix.size();
|
||||
for (int i = 0; i < len; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user