]> git.lyx.org Git - lyx.git/commitdiff
Use calculated labels in XHTML output.
authorRichard Heck <rgheck@comcast.net>
Fri, 8 Jan 2010 18:19:37 +0000 (18:19 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 8 Jan 2010 18:19:37 +0000 (18:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32892 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/insets/InsetCitation.cpp

index 9b8730d4658f080f398f3b1917b26efbc843ca04..b3e0864c7454b196af5de0ebc51bfc0f9fe4b0a3 100644 (file)
@@ -1458,7 +1458,7 @@ void Buffer::writeLyXHTMLSource(odocstream & os,
        validate(features);
        updateLabels(UpdateMaster, true);
        checkBibInfoCache();
        validate(features);
        updateLabels(UpdateMaster, true);
        checkBibInfoCache();
-       d->bibinfo_.collectCitedEntries(*this);
+       d->bibinfo_.makeCitationLabels(*this);
 
        if (!only_body) {
                os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
 
        if (!only_body) {
                os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
index 088b671ec3d35624c60b94fc2a4121c6d29438e7..6ba46a6546a9f7d3db53587f68538dbc8c917811 100644 (file)
@@ -533,10 +533,14 @@ docstring InsetCitation::xhtml(XHTMLStream & xs, OutputParams const &) const
                        xs << ", ";
                        first = false;
                }
                        xs << ", ";
                        first = false;
                }
-               docstring const & label = bibinfo.label();
-               docstring const & target = label.empty() ? *it : label;
+               docstring citekey = bibinfo.citeKey();
+               if (citekey.empty()) {
+                       citekey = bibinfo.label();
+                       if (citekey.empty())
+                               citekey = *it;
+               }
                string const attr = "href='#" + to_utf8(*it) + "'";
                string const attr = "href='#" + to_utf8(*it) + "'";
-               xs << StartTag("a", attr) << target << EndTag("a");
+               xs << StartTag("a", attr) << citekey << EndTag("a");
        }
 
        docstring const & after = getParam("after");
        }
 
        docstring const & after = getParam("after");