]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
Add a document-wide default bibliography style \biblio_style.
[lyx.git] / src / insets / InsetBibitem.cpp
index d3a10ae63c645bb653a161109434dc75047e42ac..779ef7035c5cf2a1422a4897e3a05d0e64323d21 100644 (file)
@@ -25,7 +25,7 @@
 #include "FuncRequest.h"
 #include "InsetIterator.h"
 #include "InsetList.h"
-#include "Language.h" 
+#include "Language.h"
 #include "Lexer.h"
 #include "output_xhtml.h"
 #include "OutputParams.h"
@@ -166,12 +166,12 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
                                                if (label[previous] != '{')
                                                        label.replace(pos, 1, lbrace + brackets_escape[k] + rbrace);
                                }
+               }
 
-                       if (old_label != label) {
-                               p["label"] = label;
-                               cur.forceBufferUpdate();
-                               buffer().invalidateBibinfoCache();
-                       }
+               if (old_label != label) {
+                       p["label"] = label;
+                       cur.forceBufferUpdate();
+                       buffer().invalidateBibinfoCache();
                }
 
                setParam("label", p["label"]);
@@ -316,9 +316,10 @@ void InsetBibitem::collectBibKeys(InsetIterator const & it) const
        docstring const key = getParam("key");
        BibTeXInfo keyvalmap(false);
        keyvalmap.label(bibLabel());
-       DocIterator doc_it(it); 
+       DocIterator doc_it(it);
        doc_it.forwardPos();
-       keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString();
+       keyvalmap[from_ascii("ref")] = doc_it.paragraph().asString(
+               AS_STR_INSETS | AS_STR_SKIPDELETE);
        buffer().addBibTeXInfo(key, keyvalmap);
 }