mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 14:05:59 +00:00
I forget this in rev 19515.
* InsetInclude: loadIfNeeded() - make it non anonymous (used in loadChildDocuments()). - now return the loaded buffer. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19520 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
63895cc32e
commit
4e7e580f54
@ -384,16 +384,17 @@ Buffer * getChildBuffer(Buffer const & buffer, InsetCommandParams const & params
|
||||
return childBuffer;
|
||||
}
|
||||
|
||||
} // namespace anon
|
||||
|
||||
/// return true if the file is or got loaded.
|
||||
bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
|
||||
|
||||
Buffer * loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
|
||||
{
|
||||
if (isVerbatim(params) || isListings(params))
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
FileName const included_file = includedFilename(buffer, params);
|
||||
if (!isLyXFilename(included_file.absFilename()))
|
||||
return false;
|
||||
return 0;
|
||||
|
||||
Buffer * buf = theBufferList().getBuffer(included_file.absFilename());
|
||||
if (!buf) {
|
||||
@ -416,13 +417,10 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
|
||||
return buf;
|
||||
}
|
||||
buf->setParentName(parentFilename(buffer));
|
||||
return true;
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
||||
int InsetInclude::latex(Buffer const & buffer, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
|
@ -159,6 +159,8 @@ private:
|
||||
InsetInclude & inset_;
|
||||
};
|
||||
|
||||
/// return loaded Buffer or zero if the file loading did not proceed.
|
||||
Buffer * loadIfNeeded(Buffer const & parent, InsetCommandParams const & params);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user