]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibtex.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetBibtex.cpp
index f8cc990cf97a0b664d5391a1141d25d3b2af3f56..40632057697579d6e06e7c325f73846043fbc884 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "DispatchResult.h"
-#include "support/debug.h"
 #include "EmbeddedFiles.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
-#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 
 #include "frontends/alert.h"
 
+#include "support/debug.h"
 #include "support/ExceptionMessage.h"
 #include "support/docstream.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Path.h"
 #include "support/textutils.h"
 
 #include <boost/tokenizer.hpp>
+#include <limits>
 
 using namespace std;
 using namespace lyx::support;
@@ -739,8 +740,7 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer,
                                docstring value;
                                docstring commaNewline;
                                docstring data;
-                               BibTeXInfo keyvalmap;
-                               keyvalmap.entryType = entryType;
+                               BibTeXInfo keyvalmap(key, entryType);
                                
                                bool readNext = removeWSAndComma(ifs);
  
@@ -766,15 +766,13 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer,
 
                                        keyvalmap[name] = value;
                                        data += "\n\n" + value;
-                                       keylist.fieldNames.insert(name);
+                                       keylist.addFieldName(name);
                                        readNext = removeWSAndComma(ifs);
                                }
 
                                // add the new entry
-                               keylist.entryTypes.insert(entryType);
-                               keyvalmap.allData = data;
-                               keyvalmap.isBibTeX = true;
-                               keyvalmap.bibKey = key;
+                               keylist.addEntryType(entryType);
+                               keyvalmap.setAllData(data);
                                keylist[key] = keyvalmap;
                        }
                } //< searching '@'