]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
comment
[lyx.git] / src / Buffer.cpp
index 377b9ef2a35b7d83e04e330e1a8a04f48f3812f3..b38a394b48d164d40455db83d492d09a4acc5494 100644 (file)
@@ -115,7 +115,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 336;
+int const LYX_FORMAT = 338; //Uwe: support for polytonic Greek
 
 typedef map<string, bool> DepClean;
 typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
@@ -275,6 +275,13 @@ Buffer::~Buffer()
        // GuiView already destroyed
        gui_ = 0;
 
+
+       // loop over children
+       Impl::BufferPositionMap::iterator it = d->children_positions.begin();
+       Impl::BufferPositionMap::iterator end = d->children_positions.end();
+       for (; it != end; ++it)
+               theBufferList().releaseChild(this, const_cast<Buffer *>(it->first));
+
        // clear references to children in macro tables
        d->children_positions.clear();
        d->position_to_children.clear();
@@ -286,7 +293,7 @@ Buffer::~Buffer()
        }
 
        // Remove any previewed LaTeX snippets associated with this buffer.
-       graphics::Previews::get().removeLoader(*this);
+       thePreviews().removeLoader(*this);
 
        delete d;
 }
@@ -991,7 +998,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
        }
        catch (...) {
                lyxerr << "Caught some really weird exception..." << endl;
-               LyX::cref().exit(1);
+               lyx_exit(1);
        }
 
        ofs.close();
@@ -1353,7 +1360,7 @@ void Buffer::updateBibfilesCache() const
 }
 
 
-void Buffer::invalidateBibfilesCache() 
+void Buffer::invalidateBibinfoCache() 
 {
        d->bibinfoCacheValid_ = false;
 }
@@ -1674,6 +1681,12 @@ Buffer const * Buffer::masterBuffer() const
 }
 
 
+bool Buffer::isChild(Buffer * child) const
+{
+       return d->children_positions.find(child) != d->children_positions.end();
+}
+
+
 template<typename M>
 typename M::iterator greatest_below(M & m, typename M::key_type const & x)
 {
@@ -2374,11 +2387,12 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
 
        string const error_type = (format == "program")
                ? "Build" : bufferFormat();
+       ErrorList & error_list = d->errorLists[error_type];
        string const ext = formats.extension(format);
        FileName const tmp_result_file(changeExtension(filename, ext));
        bool const success = theConverters().convert(this, FileName(filename),
                tmp_result_file, FileName(absFileName()), backend_format, format,
-               errorList(error_type));
+               error_list);
        // Emit the signal to show the error list.
        if (format != backend_format)
                errors(error_type);