]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
Fix assertion when checking if change in selection
[lyx.git] / src / insets / InsetBibitem.cpp
index afc30ae37d395647c16ac4391912fb0ea43c835d..f9b244c4603f556d3a5c68af74a1c182f4830b22 100644 (file)
@@ -112,7 +112,8 @@ ParamInfo const & InsetBibitem::findInfo(string const & /* cmdName */)
                param_info_.add("label", ParamInfo::LATEX_OPTIONAL,
                                ParamInfo::HANDLING_LATEXIFY);
                param_info_.add("key", ParamInfo::LATEX_REQUIRED,
-                               ParamInfo::HANDLING_ESCAPE);
+                               ParamInfo::ParamHandling(ParamInfo::HANDLING_ESCAPE
+                                                        | ParamInfo::HANDLING_LTRIM));
                param_info_.add("literal", ParamInfo::LYX_INTERNAL);
        }
        return param_info_;
@@ -248,6 +249,7 @@ docstring bibitemWidest(Buffer const & buffer, OutputParams const & runparams)
        ParagraphList::const_iterator it = buffer.paragraphs().begin();
        ParagraphList::const_iterator end = buffer.paragraphs().end();
 
+       bool is_literal = false;
        for (; it != end; ++it) {
                if (it->insetList().empty())
                        continue;
@@ -273,11 +275,14 @@ docstring bibitemWidest(Buffer const & buffer, OutputParams const & runparams)
                if (wx > w) {
                        w = wx;
                        lbl = label;
+                       is_literal = (bitem->getParam("literal") == "true");
                }
        }
 
        if (!lbl.empty()) {
                InsetCommandParams p(BIBITEM_CODE);
+               if (is_literal)
+                       p["literal"] = from_ascii("true");
                return p.prepareCommand(runparams, lbl, ParamInfo::HANDLING_LATEXIFY);
        }
 
@@ -285,7 +290,7 @@ docstring bibitemWidest(Buffer const & buffer, OutputParams const & runparams)
 }
 
 
-void InsetBibitem::collectBibKeys(InsetIterator const & it) const
+void InsetBibitem::collectBibKeys(InsetIterator const & it, FileNameList & /*checkedFiles*/) const
 {
        docstring const key = getParam("key");
        docstring const label = getParam("label");