From 4e7e580f54145a946a0a9a446048c7ff31651c60 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 13 Aug 2007 19:40:54 +0000 Subject: [PATCH] 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 --- src/insets/InsetInclude.cpp | 14 ++++++-------- src/insets/InsetInclude.h | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 6ab2324a2b..ac0eb6b06a 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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 { diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h index 2f834d4aa6..4eb0409269 100644 --- a/src/insets/InsetInclude.h +++ b/src/insets/InsetInclude.h @@ -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