]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibtex.cpp
#7379 avoid the wrap spell check question when buffer is empty
[lyx.git] / src / insets / InsetBibtex.cpp
index 88ff6649676b3c9bfc5ec5a4038d82bb054e9d4c..56476d3d1b29382c363c72a691ba61a2e50e8329 100644 (file)
@@ -103,7 +103,8 @@ void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
                                throw message;
                        break;
                }
-               //
+
+               cur.recordUndo();
                setParams(p);
                buffer().invalidateBibfileCache();
                cur.forceBufferUpdate();
@@ -234,7 +235,7 @@ static string normalizeName(Buffer const & buffer,
 }
 
 
-int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
+void InsetBibtex::latex(otexstream & os, OutputParams const & runparams) const
 {
        // the sequence of the commands:
        // 1. \bibliographystyle{style}
@@ -327,9 +328,6 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                        style = split(style, bibtotoc, ',');
        }
 
-       // line count
-       int nlines = 0;
-
        if (!style.empty()) {
                string base = normalizeName(buffer(), runparams, style, ".bst");
                FileName const try_in_file = 
@@ -357,7 +355,6 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                os << "\\bibliographystyle{"
                   << from_utf8(latex_path(normalizeName(buffer(), runparams, base, ".bst")))
                   << "}\n";
-               nlines += 1;
        }
 
        // Post this warning only once.
@@ -377,7 +374,6 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                        btprint = from_ascii("btPrintCited");
                os << "\\" << btprint << "\n"
                   << "\\end{btSect}\n";
-               nlines += 3;
        }
 
        // bibtotoc-Option
@@ -395,13 +391,9 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                docstring btprint = getParam("btprint");
                if (btprint == "btPrintAll") {
                        os << "\\nocite{*}\n";
-                       nlines += 1;
                }
                os << "\\bibliography{" << db_out << "}\n";
-               nlines += 1;
        }
-
-       return nlines;
 }