]> git.lyx.org Git - features.git/blobdiff - src/Text.cpp
Convenience LFUN to split an environment
[features.git] / src / Text.cpp
index c61e9e1bb1f87a55e7c27b5f73b7fad6d6507cca..48f8c82491fc40db4c3f867a5a52fb6e7a67848f 100644 (file)
@@ -265,6 +265,17 @@ bool Text::isFirstInSequence(pit_type par_offset) const
 }
 
 
+int Text::getTocLevel(pit_type par_offset) const
+{
+       Paragraph const & par = pars_[par_offset];
+
+       if (par.layout().isEnvironment() && !isFirstInSequence(par_offset))
+               return Layout::NOT_IN_TOC;
+
+       return par.layout().toclevel;
+}
+
+
 Font const Text::outerFont(pit_type par_offset) const
 {
        depth_type par_depth = pars_[par_offset].getDepth();
@@ -1812,6 +1823,7 @@ bool Text::read(Lexer & lex,
        return res;
 }
 
+
 // Returns the current font and depth as a message.
 docstring Text::currentState(Cursor const & cur) const
 {