]> git.lyx.org Git - features.git/commitdiff
Fix really silly logic error. This should make prettyref-based
authorRichard Heck <rgheck@lyx.org>
Thu, 7 Feb 2013 13:44:42 +0000 (08:44 -0500)
committerRichard Heck <rgheck@lyx.org>
Thu, 7 Feb 2013 13:45:21 +0000 (08:45 -0500)
files work better when converted to refstyle.

src/insets/InsetRef.cpp

index bae4992f66f156cb22cf9126ec652698adf30bca..49743ceea836ea460a01079c6fa88e6848a65352 100644 (file)
@@ -319,12 +319,13 @@ void InsetRef::validate(LaTeXFeatures & features) const
                string const fcmd = to_utf8(getFormattedCmd(data, label, prefix));
                if (buffer().params().use_refstyle) {
                        features.require("refstyle");
-                       if (!prefix.empty()) {
+                       if (prefix == "cha")
+                               features.addPreambleSnippet("\\let\\charef=\\chapref");
+                       else if (!prefix.empty()) {
                                string lcmd = "\\AtBeginDocument{\\providecommand" + 
                                                fcmd + "[1]{\\ref{" + to_utf8(prefix) + ":#1}}}";
                                features.addPreambleSnippet(lcmd);
-                       } else if (prefix == "cha")
-                               features.addPreambleSnippet("\\let\\charef=\\chapref");
+                       }
                } else {
                        features.require("prettyref");
                        // prettyref uses "cha" for chapters, so we provide a kind of