#include "Buffer.h"
#include "Author.h"
-#include "Biblio.h"
+#include "BiblioInfo.h"
#include "BranchList.h"
#include "buffer_funcs.h"
#include "BufferList.h"
#include "Bullet.h"
#include "Chktex.h"
#include "debug.h"
+#include "DocIterator.h"
#include "Encoding.h"
#include "ErrorList.h"
#include "Exporter.h"
namespace {
-int const LYX_FORMAT = 279;
+int const LYX_FORMAT = 280;
} // namespace anon
// here the buffer should take care that it is
// saved properly, before it goes into the void.
- closing();
+ Buffer * master = getMasterBuffer();
+ if (master != this && use_gui)
+ // We are closing buf which was a child document so we
+ // must update the labels and section numbering of its master
+ // Buffer.
+ updateLabels(*master);
if (!temppath().empty() && !destroyDir(FileName(temppath()))) {
Alert::warning(_("Could not remove temporary directory"),
// Remove any previewed LaTeX snippets associated with this buffer.
graphics::Previews::get().removeLoader(*this);
+
+ closing(this);
}
}
-// This is also a buffer property (ale)
-void Buffer::fillWithBibKeys(biblio::BibKeyList & keys)
- const
-{
- biblio::fillWithBibKeys(this, keys);
-}
-
-
void Buffer::updateBibfilesCache()
{
// if this is a child document and the parent is already loaded
}
-void Buffer::saveCursor(StableDocIterator cur, StableDocIterator anc)
-{
- cursor_ = cur;
- anchor_ = anc;
-}
-
-
void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
Inset::Code code)
{
vector<docstring> labels;
if (code == Inset::CITE_CODE) {
- biblio::BibKeyList keys;
- fillWithBibKeys(keys);
- biblio::BibKeyList::const_iterator bit = keys.begin();
- biblio::BibKeyList::const_iterator bend = keys.end();
+ BiblioInfo keys;
+ keys.fillWithBibKeys(this);
+ BiblioInfo::const_iterator bit = keys.begin();
+ BiblioInfo::const_iterator bend = keys.end();
for (; bit != bend; ++bit)
// FIXME UNICODE
- labels.push_back(from_utf8(bit->first));
+ labels.push_back(bit->first);
} else
getLabelList(labels);