mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 14:15:32 +00:00
Simplify things just a little bit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24967 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
891cfdda68
commit
32f1dce79a
@ -21,6 +21,20 @@ using namespace std;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
namespace {
|
||||
class BranchNamesEqual : public std::unary_function<Branch, bool> {
|
||||
public:
|
||||
BranchNamesEqual(docstring const & name)
|
||||
: name_(name) {}
|
||||
bool operator()(Branch const & branch) const
|
||||
{
|
||||
return branch.getBranch() == name_;
|
||||
}
|
||||
private:
|
||||
docstring name_;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Branch::Branch() : selected_(false)
|
||||
{
|
||||
|
@ -115,17 +115,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class BranchNamesEqual : public std::unary_function<Branch, bool> {
|
||||
public:
|
||||
BranchNamesEqual(docstring const & name)
|
||||
: name_(name) {}
|
||||
bool operator()(Branch const & branch) const
|
||||
{
|
||||
return branch.getBranch() == name_;
|
||||
}
|
||||
private:
|
||||
docstring name_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -195,13 +195,10 @@ bool InsetBranch::isBranchSelected() const
|
||||
{
|
||||
Buffer const & realbuffer = *buffer().masterBuffer();
|
||||
BranchList const & branchlist = realbuffer.params().branchlist();
|
||||
BranchList::const_iterator const end = branchlist.end();
|
||||
BranchList::const_iterator it =
|
||||
find_if(branchlist.begin(), end,
|
||||
BranchNamesEqual(params_.branch));
|
||||
if (it == end)
|
||||
Branch const * ourBranch = branchlist.find(params_.branch);
|
||||
if (!ourBranch)
|
||||
return false;
|
||||
return it->getSelected();
|
||||
return ourBranch->getSelected();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user