mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
* loadChildDocuments(): new function to load all child documents in a given buffer. This will be used for a new LFUN_LOAD_CHILD_DOCUMENTS and for pre-loading all child documents when certain action (latex export, bibtex parsing, label and reference).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19515 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c5ed92e7df
commit
8bb999b7ee
@ -23,8 +23,10 @@
|
||||
#include "Floating.h"
|
||||
#include "FloatList.h"
|
||||
#include "gettext.h"
|
||||
#include "InsetIterator.h"
|
||||
#include "Language.h"
|
||||
#include "LaTeX.h"
|
||||
#include "LyX.h"
|
||||
#include "TextClass.h"
|
||||
#include "Paragraph.h"
|
||||
#include "paragraph_funcs.h"
|
||||
@ -614,4 +616,25 @@ void checkBufferStructure(Buffer & buffer, ParIterator const & par_it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void loadChildDocuments(Buffer const & buf)
|
||||
{
|
||||
bool parse_error = false;
|
||||
|
||||
for (InsetIterator it = inset_iterator_begin(buf.inset()); it; ++it) {
|
||||
if (it->lyxCode() != Inset::INCLUDE_CODE)
|
||||
continue;
|
||||
InsetInclude const & inset = static_cast<InsetInclude const &>(*it);
|
||||
InsetCommandParams const & ip = inset.params();
|
||||
Buffer * child = loadIfNeeded(buf, ip);
|
||||
if (!child)
|
||||
continue;
|
||||
parse_error |= !child->errorList("Parse").empty();
|
||||
loadChildDocuments(*child);
|
||||
}
|
||||
|
||||
if (use_gui && buf.getMasterBuffer() == &buf)
|
||||
updateLabels(buf);
|
||||
}
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -71,6 +71,9 @@ void updateLabels(Buffer const &, ParIterator &);
|
||||
///
|
||||
void checkBufferStructure(Buffer &, ParIterator const &);
|
||||
|
||||
///
|
||||
void loadChildDocuments(Buffer const & buffer);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
#endif // BUFFER_FUNCS_H
|
||||
|
Loading…
Reference in New Issue
Block a user