]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetCollapsable.cpp
* Lazy MathData to avoid unneeded interpretation of macro definitions
[features.git] / src / insets / InsetCollapsable.cpp
index 2a2d8db9f7d9859c35ab621f399f735fd0f1871f..fe747bc9e8b840db7e264d4d4a53d3e0edc0372d 100644 (file)
 
 #include "support/docstream.h"
 
+using namespace std;
 
 namespace lyx {
 
-using std::endl;
-using std::max;
-using std::ostream;
-using std::string;
-
 
 InsetCollapsable::CollapseStatus InsetCollapsable::status() const
 {
@@ -430,7 +426,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const
        docstring label;
        pos_type const max_length = 15;
        pos_type const p_siz = paragraphs().begin()->size();
-       pos_type const n = std::min(max_length, p_siz);
+       pos_type const n = min(max_length, p_siz);
        pos_type i = 0;
        pos_type j = 0;
        for (; i < n && j < p_siz; ++j) {
@@ -786,6 +782,22 @@ InsetCollapsable::Decoration InsetCollapsable::decoration() const
 }
 
 
+bool InsetCollapsable::isMacroScope(Buffer const & buf) const
+{
+       // layout_ == 0 leads to no latex output, so ignore 
+       // the macros outside
+       if (!layout_)
+               return true;
+
+       // see InsetCollapsable::latex(...) below. In these case
+       // an environment is opened there
+       if (!layout_->latexname.empty())
+               return true;
+
+       return false;
+}
+
+
 int InsetCollapsable::latex(Buffer const & buf, odocstream & os,
                          OutputParams const & runparams) const
 {