]> 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 14:33:41 +0000 (09:33 -0500)
files work better when converted to refstyle.
(cherry picked from commit 1b7d812e5116a39d3319cda234c652f64bec9dd3)

src/insets/InsetRef.cpp
status.20x

index 9f606ff0a2a94c81c0bfe32659bbafb04b22bb69..78e4fa1de47ada87287f6c1a738f3df28c126b08 100644 (file)
@@ -315,12 +315,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
index 3cafc49cea17835a7a01fabb93fe1e3c2f6fb3aa..bbf4fd1398b23f34d44a1528e2fc23a8a2666508 100644 (file)
@@ -102,6 +102,9 @@ What's new
 
 - Fix TeX crash involving font changes in URLs.
 
+- Properly output alias for formatted chapter references, so prettyref
+  documents work when converted tor refstyle.
+
 
 * USER INTERFACE