]> git.lyx.org Git - features.git/commitdiff
Fix bug with output of prettyref chapter references.
authorRichard Heck <rgheck@comcast.net>
Wed, 13 Jul 2011 15:19:38 +0000 (15:19 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 13 Jul 2011 15:19:38 +0000 (15:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39289 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetRef.cpp
status.20x

index 7b6cf6d98109d455bb50d92c4ecf7b3065f7e306..cd00e0d023f9df83dbec16ff70a063cbe82ea83d 100644 (file)
@@ -302,13 +302,13 @@ void InsetRef::validate(LaTeXFeatures & features) const
        string const cmd = getCmdName();
        if (cmd == "vref" || cmd == "vpageref")
                features.require("varioref");
-       else if (getCmdName() == "formatted") {
+       else if (cmd == "formatted") {
                docstring const data = getEscapedLabel(features.runparams());
                docstring label;
                docstring prefix;
+               string const fcmd = to_utf8(getFormattedCmd(data, label, prefix));
                if (buffer().params().use_refstyle) {
                        features.require("refstyle");
-                       string const fcmd = to_utf8(getFormattedCmd(data, label, prefix));
                        if (!prefix.empty()) {
                                string lcmd = "\\AtBeginDocument{\\providecommand" + 
                                                fcmd + "[1]{\\ref{" + to_utf8(prefix) + ":#1}}}";
@@ -322,7 +322,7 @@ void InsetRef::validate(LaTeXFeatures & features) const
                        if (prefix == "chap")
                                features.addPreambleSnippet("\\let\\pr@chap=\\pr@cha");
                }
-       } else if (getCmdName() == "eqref" && !buffer().params().use_refstyle)
+       } else if (cmd == "eqref" && !buffer().params().use_refstyle)
                // refstyle defines its own version
                features.require("amsmath");
        else if (cmd == "nameref")
index 8d91ab5c28fe9dcfa7b1868876799005854227e7..705b04f105f709633eae6d68dc444860eb4d02e0 100644 (file)
@@ -146,6 +146,8 @@ What's new
 
 - Fix missing VCS revision information for RCS (author/date/time).
 
+- Fix output of chapter references when using prettyref.
+
 
 * USER INTERFACE