]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetBranch.cpp
* Lazy MathData to avoid unneeded interpretation of macro definitions
[features.git] / src / insets / InsetBranch.cpp
index 9af5c9e8b77d00ea9377b97a1d277f42b4ff19af..0eed816e60643efde356f7693ca761b9a018f878 100644 (file)
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "OutputParams.h"
+#include "TextClass.h"
 
 #include <sstream>
 
+using namespace std;
 
 namespace lyx {
 
-using std::string;
-using std::istringstream;
-using std::ostream;
-using std::ostringstream;
-
 
 InsetBranch::InsetBranch(BufferParams const & bp,
                         InsetBranchParams const & params)
        : InsetCollapsable(bp), params_(params)
-{
-       setButtonLabel();
-}
+{}
 
 
 InsetBranch::InsetBranch(InsetBranch const & in)
        : InsetCollapsable(in), params_(in.params_)
-{
-       setButtonLabel();
-}
+{}
 
 
 InsetBranch::~InsetBranch()
@@ -213,7 +206,7 @@ bool InsetBranch::isBranchSelected(Buffer const & buffer) const
        BranchList const & branchlist = realbuffer.params().branchlist();
        BranchList::const_iterator const end = branchlist.end();
        BranchList::const_iterator it =
-               std::find_if(branchlist.begin(), end,
+               find_if(branchlist.begin(), end,
                             BranchNamesEqual(params_.branch));
        if (it == end)
                return false;
@@ -277,6 +270,12 @@ void InsetBranch::validate(LaTeXFeatures & features) const
 }
 
 
+bool InsetBranch::isMacroScope(Buffer const & buf) const 
+{
+       // Its own scope if not selected by buffer
+       return !isBranchSelected(buf);
+}
+
 
 string const InsetBranchMailer::name_("branch");