]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbib.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetbib.C
index 34cb2b53f941d3af4cddda0792a40dea923e3cfb..d314ad7013c235f5c9cf0a11f710e4496a4bbb11 100644 (file)
@@ -1,27 +1,30 @@
 #include <config.h>
 
-#include <fstream>
-#include <cstdlib>
-
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-#include "frontends/Dialogs.h"
 #include "insetbib.h"
 #include "buffer.h"
 #include "debug.h"
 #include "BufferView.h"
 #include "gettext.h"
 #include "lyxtext.h"
+#include "lyxrc.h"
+#include "font.h"
+#include "LyXView.h" 
+#include "lyxtextclasslist.h"
+
+#include "frontends/Dialogs.h"
+
 #include "support/filetools.h"
 #include "support/path.h"
 #include "support/os.h"
 #include "support/lstrings.h"
 #include "support/LAssert.h"
-#include "lyxrc.h"
-#include "font.h"
-#include "LyXView.h" 
+
+#include <fstream>
+#include <cstdlib>
 
 using std::ostream;
 using std::ifstream;
@@ -157,8 +160,8 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
        }
 
        if (!buffer->niceFile 
-           && IsFileReadable(MakeAbsPath(style, buffer->filepath) + ".bst")) {
-               style = MakeAbsPath(style, buffer->filepath);
+           && IsFileReadable(MakeAbsPath(style, buffer->filePath()) + ".bst")) {
+               style = MakeAbsPath(style, buffer->filePath());
        }
 
        if (!style.empty()) { // we want no \biblio...{}
@@ -193,10 +196,10 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
        // If we generate in a temp dir, we might need to give an
        // absolute path there. This is a bit complicated since we can
        // have a comma-separated list of bibliographies
-       while(!adb.empty()) {
+       while (!adb.empty()) {
                if (!buffer->niceFile &&
-                   IsFileReadable(MakeAbsPath(adb, buffer->filepath)+".bib")) 
-                         adb = os::external_path(MakeAbsPath(adb, buffer->filepath));
+                   IsFileReadable(MakeAbsPath(adb, buffer->filePath())+".bib")) 
+                         adb = os::external_path(MakeAbsPath(adb, buffer->filePath()));
                db_out += adb;
                db_out += ',';
                db_in= split(db_in, adb,',');
@@ -207,17 +210,17 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
 }
 
 
-vector<string> const InsetBibtex::getFiles(Buffer const &) const
+vector<string> const InsetBibtex::getFiles(Buffer const & buffer) const
 {
        // Doesn't appear to be used (Angus, 31 July 2001)
-       // Path p(buffer->filepath);
+       Path p(buffer.filePath());
 
        vector<string> vec;
 
        string tmp;
        string bibfiles = getContents();
        bibfiles = split(bibfiles, tmp, ',');
-       while(!tmp.empty()) {
+       while (!tmp.empty()) {
                string file = findtexfile(ChangeExtension(tmp, "bib"), "bib");
                lyxerr[Debug::LATEX] << "Bibfile: " << file << endl;
 
@@ -249,7 +252,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                string linebuf0;
                while (getline(ifs, linebuf0)) {
                        string linebuf = frontStrip(strip(linebuf0));
-                       if (linebuf.empty() ) continue;
+                       if (linebuf.empty()) continue;
                        if (prefixIs(linebuf, "@")) {
                                linebuf = subst(linebuf, '{', '(');
                                string tmp;