From 7d36b9e4fa89e804ca7cf07daf81eec817e6b21d Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Sat, 25 Apr 2020 22:27:09 -0400 Subject: [PATCH] Remove method that is now unneeded. --- src/Buffer.cpp | 6 +++--- src/insets/InsetInclude.cpp | 10 ++-------- src/insets/InsetInclude.h | 7 +++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8b5fae1802..0cc1d23f06 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3017,7 +3017,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr) // get buffer of external file InsetInclude const & ins = static_cast(*it); - Buffer * child = ins.getChildBuffer(); + Buffer * child = ins.loadIfNeeded(); if (!child) continue; child->dispatch(func, dr); @@ -3805,7 +3805,7 @@ void Buffer::Impl::updateMacros(DocIterator & it, DocIterator & scope) InsetInclude const & incinset = static_cast(*insit.inset); macro_lock = true; - Buffer * child = incinset.getChildBuffer(); + Buffer * child = incinset.loadIfNeeded(); macro_lock = false; if (!child) continue; @@ -3900,7 +3900,7 @@ void Buffer::getUsedBranches(std::list & result, bool const from_mast // get buffer of external file InsetInclude const & ins = static_cast(*it); - Buffer * child = ins.getChildBuffer(); + Buffer * child = ins.loadIfNeeded(); if (!child) continue; child->getUsedBranches(result, true); diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index be823a77d5..6dca350078 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -446,12 +446,6 @@ docstring InsetInclude::screenLabel() const } -Buffer * InsetInclude::getChildBuffer() const -{ - return loadIfNeeded(); -} - - Buffer * InsetInclude::loadIfNeeded() const { // This is for background export and preview. We don't even want to @@ -1330,7 +1324,7 @@ void InsetInclude::addToToc(DocIterator const & cpit, bool output_active, b.pushItem(cpit, screenLabel(), output_active); b.pop(); } else { - Buffer const * const childbuffer = getChildBuffer(); + Buffer const * const childbuffer = loadIfNeeded(); TocBuilder & b = backend.builder("child"); docstring str = childbuffer ? childbuffer->fileName().displayName() @@ -1386,7 +1380,7 @@ void InsetInclude::updateCommand() void InsetInclude::updateBuffer(ParIterator const & it, UpdateType utype, bool const deleted) { file_exist_ = includedFileExist(); - Buffer const * const childbuffer = getChildBuffer(); + Buffer const * const childbuffer = loadIfNeeded(); if (childbuffer) { if (!checkForRecursiveInclude(childbuffer)) childbuffer->updateBuffer(Buffer::UpdateChildOnly, utype); diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h index 6636583e6c..66487bc934 100644 --- a/src/insets/InsetInclude.h +++ b/src/insets/InsetInclude.h @@ -48,8 +48,9 @@ public: /// void setChildBuffer(Buffer * buffer); - /// \return the child buffer if the file is a LyX doc and could be loaded - Buffer * getChildBuffer() const; + + /// \return loaded Buffer or zero if the file loading did not proceed. + Buffer * loadIfNeeded() const; /** Update the cache with all bibfiles in use of the child buffer * (including bibfiles of grandchild documents). @@ -131,8 +132,6 @@ private: * and the preview should be regenerated. */ void fileChanged() const; - /// \return loaded Buffer or zero if the file loading did not proceed. - Buffer * loadIfNeeded() const; /// launch external application void editIncluded(std::string const & file); /// -- 2.39.2