]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
adjust
[lyx.git] / src / Buffer.cpp
index 5903009e35b13d02cd3921dc08ff6c3f2093002a..6499c89f9bc461d91e97e4575fb036d22a51f08e 100644 (file)
@@ -119,7 +119,6 @@ using std::vector;
 using std::string;
 using std::time_t;
 
-
 namespace lyx {
 
 using support::addName;
@@ -155,7 +154,7 @@ namespace fs = boost::filesystem;
 
 namespace {
 
-int const LYX_FORMAT = 290; //Uwe Stöhr, wrap table
+int const LYX_FORMAT = 295; //Uwe: htmlurl, href
 
 } // namespace anon
 
@@ -1486,14 +1485,14 @@ void Buffer::updateBibfilesCache()
 
        bibfilesCache_.clear();
        for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
-               if (it->lyxCode() == Inset::BIBTEX_CODE) {
+               if (it->lyxCode() == BIBTEX_CODE) {
                        InsetBibtex const & inset =
                                static_cast<InsetBibtex const &>(*it);
                        vector<FileName> const bibfiles = inset.getFiles(*this);
                        bibfilesCache_.insert(bibfilesCache_.end(),
                                bibfiles.begin(),
                                bibfiles.end());
-               } else if (it->lyxCode() == Inset::INCLUDE_CODE) {
+               } else if (it->lyxCode() == INCLUDE_CODE) {
                        InsetInclude & inset =
                                static_cast<InsetInclude &>(*it);
                        inset.updateBibfilesCache(*this);
@@ -1824,7 +1823,7 @@ void Buffer::buildMacros()
                InsetList::const_iterator end = insets.end();
                for ( ; it != end; ++it) {
                        //lyxerr << "found inset code " << it->inset->lyxCode() << std::endl;
-                       if (it->inset->lyxCode() == Inset::MATHMACRO_CODE) {
+                       if (it->inset->lyxCode() == MATHMACRO_CODE) {
                                MathMacroTemplate const & mac
                                        = static_cast<MathMacroTemplate const &>(*it->inset);
                                insertMacro(mac.name(), mac.asMacroData());
@@ -1835,14 +1834,14 @@ void Buffer::buildMacros()
 
 
 void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
-       Inset::Code code)
+       InsetCode code)
 {
        //FIXME: This does not work for child documents yet.
-       BOOST_ASSERT(code == Inset::CITE_CODE || code == Inset::REF_CODE);
+       BOOST_ASSERT(code == CITE_CODE || code == REF_CODE);
        // Check if the label 'from' appears more than once
        vector<docstring> labels;
 
-       if (code == Inset::CITE_CODE) {
+       if (code == CITE_CODE) {
                BiblioInfo keys;
                keys.fillWithBibKeys(this);
                BiblioInfo::const_iterator bit  = keys.begin();
@@ -2020,13 +2019,17 @@ private:
 };
 
 
+#if !defined (HAVE_FORK)
+# define fork() -1
+#endif
+
 int AutoSaveBuffer::generateChild()
 {
        // tmp_ret will be located (usually) in /tmp
        // will that be a problem?
-       pid_t const pid = fork(); // If you want to debug the autosave
-       // you should set pid to -1, and comment out the
-       // fork.
+       pid_t const pid = fork();
+       // If you want to debug the autosave
+       // you should set pid to -1, and comment out the fork.
        if (pid == 0 || pid == -1) {
                // pid = -1 signifies that lyx was unable
                // to fork. But we will do the save