X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=bd7305701785929e0afe9bc9cb65aa89cb375e28;hb=f503ce67fc2d2f945a519a277c479a769c0d522c;hp=6da2e91de7b16061ea5412fad1abc3defd1f9cc5;hpb=45b0c6be478c155124101ba786a00c2905aa3df7;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 6da2e91de7..bd73057017 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -127,7 +127,7 @@ namespace { // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -int const LYX_FORMAT = 373; // jspitzm: merge g-brief class +int const LYX_FORMAT = 374; // rgheck: HTML output options typedef map DepClean; typedef map > RefCache; @@ -259,12 +259,14 @@ public: parent_buffer = pb; } - /// So we can force access via the accessors. - mutable Buffer const * parent_buffer; - /// If non zero, this buffer is a clone of existing buffer \p cloned_buffer_ /// This one is useful for preview detached in a thread. Buffer const * cloned_buffer_; + +private: + /// So we can force access via the accessors. + mutable Buffer const * parent_buffer; + }; @@ -293,7 +295,7 @@ Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_, read_only(readonly_), filename(file), file_fully_loaded(false), toc_backend(&parent), macro_lock(false), timestamp_(0), checksum_(0), wa_(0), undo_(parent), bibinfoCacheValid_(false), - parent_buffer(0), cloned_buffer_(cloned_buffer) + cloned_buffer_(cloned_buffer), parent_buffer(0) { if (!cloned_buffer_) { temppath = createBufferTmpDir(); @@ -350,7 +352,7 @@ Buffer::~Buffer() if (!isClean()) { docstring msg = _("LyX attempted to close a document that had unsaved changes!\n"); msg += emergencyWrite(); - frontend::Alert::warning(_("Attempting to close changed document!"), msg); + Alert::warning(_("Attempting to close changed document!"), msg); } // clear references to children in macro tables @@ -2329,9 +2331,8 @@ DocIterator Buffer::firstChildPosition(Buffer const * child) } -std::vector Buffer::getChildren(bool grand_children) const +void Buffer::getChildren(std::vector & clist, bool grand_children) const { - std::vector clist; // loop over children Impl::BufferPositionMap::iterator it = d->children_positions.begin(); Impl::BufferPositionMap::iterator end = d->children_positions.end(); @@ -2346,7 +2347,14 @@ std::vector Buffer::getChildren(bool grand_children) const clist.push_back(*git); } } - return clist; +} + + +std::vector Buffer::getChildren(bool grand_children) const +{ + std::vector v; + getChildren(v, grand_children); + return v; }