]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibtex.cpp
Change tracking cue: for instant preview
[lyx.git] / src / insets / InsetBibtex.cpp
index eaec7f9c22b6a375a4963eb86a7bb72df5a0de2b..e3202ec5d35285d8eff70b2934f2c1c14bcf7940 100644 (file)
@@ -103,7 +103,7 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
                                Alert::warning(message.title_, message.details_);
                                cur.noScreenUpdate();
                        } else
-                               throw message;
+                               throw;
                        break;
                }
 
@@ -173,21 +173,16 @@ docstring InsetBibtex::screenLabel() const
 
 docstring InsetBibtex::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/) const
 {
-       docstring item = from_ascii("* ");
-       docstring tip = _("Databases:") + "\n";
+       docstring tip = _("Databases:");
        vector<docstring> bibfilelist = getVectorFromString(getParam("bibfiles"));
 
-       if (bibfilelist.empty()) {
-               tip += item;
-               tip += _("none");
-       } else {
-               vector<docstring>::const_iterator it = bibfilelist.begin();
-               vector<docstring>::const_iterator en = bibfilelist.end();
-               for (; it != en; ++it) {
-                       tip += item;
-                       tip += *it + "\n";
-               }
-       }
+       tip += "<ul>";
+       if (bibfilelist.empty())
+               tip += "<li>" + _("none") + "</li>";
+       else
+               for (docstring const & bibfile : bibfilelist)
+                       tip += "<li>" + bibfile + "</li>";
+       tip += "</ul>";
 
        // Style-Options
        bool toc = false;
@@ -199,14 +194,10 @@ docstring InsetBibtex::toolTip(BufferView const & /*bv*/, int /*x*/, int /*y*/)
                        style = split(style, bibtotoc, char_type(','));
        }
 
-       tip += _("Style File:") +"\n";
-       tip += item;
-       if (!style.empty())
-               tip += style;
-       else
-               tip += _("none");
+       tip += _("Style File:");
+       tip += "<ul><li>" + (style.empty() ? _("none") : style) + "</li></ul>";
 
-       tip += "\n" + _("Lists:") + " ";
+       tip += _("Lists:") + " ";
        docstring btprint = getParam("btprint");
                if (btprint == "btPrintAll")
                        tip += _("all references");
@@ -338,7 +329,7 @@ void InsetBibtex::latex(otexstream & os, OutputParams const & runparams) const
        if (style == "default")
                style = buffer().params().biblio_style;
 
-       if (!style.empty()) {
+       if (!style.empty() && !buffer().params().use_bibtopic) {
                string base = normalizeName(buffer(), runparams, style, ".bst");
                FileName const try_in_file =
                        makeAbsPath(base + ".bst", buffer().filePath());
@@ -377,7 +368,10 @@ void InsetBibtex::latex(otexstream & os, OutputParams const & runparams) const
        }
 
        if (!db_out.empty() && buffer().params().use_bibtopic) {
-               os << "\\begin{btSect}{" << db_out << "}\n";
+               os << "\\begin{btSect}";
+               if (!style.empty())
+                       os << "[" << style << "]";
+               os << "{" << db_out << "}\n";
                docstring btprint = getParam("btprint");
                if (btprint.empty())
                        // default
@@ -1022,6 +1016,12 @@ docstring InsetBibtex::xhtml(XHTMLStream & xs, OutputParams const &) const
 }
 
 
+void InsetBibtex::write(ostream & os) const
+{
+       params().Write(os, &buffer());
+}
+
+
 string InsetBibtex::contextMenuName() const
 {
        return "context-bibtex";