]> git.lyx.org Git - features.git/commitdiff
Fix prettyref output.
authorRichard Heck <rgheck@comcast.net>
Fri, 29 Oct 2010 13:07:05 +0000 (13:07 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 29 Oct 2010 13:07:05 +0000 (13:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35906 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetRef.cpp

index 47747d36380c8a50df7bfea7cb480d9fcb6ae559..83d1bd863230b47a68ad5aaee1ee224556f0b031 100644 (file)
@@ -71,18 +71,24 @@ ParamInfo const & InsetRef::findInfo(string const & /* cmdName */)
 
 
 // for refstyle, given pfx:suffix, we want to return "\\pfxcmd"
-// and put "suffix" into label
+// and put "suffix" into label.
+// otherwise, we put the reference into label.
 docstring InsetRef::getFormattedCmd(
                docstring const & ref, docstring & label) const
 {
        static docstring const defcmd = from_ascii("\\ref");
-       if (!buffer().params().use_refstyle) 
+       // default is that label is data
+       // we'll change it if need be
+       if (!buffer().params().use_refstyle) {
+               label = ref;
                return from_ascii("\\prettyref");
+       }
 
        docstring prefix;
        label = split(ref, prefix, ':');
        if (prefix.empty()) {
                LYXERR0("Label `" << label << "' contains no prefix.");
+               label = ref;
                return defcmd;
        }