]> git.lyx.org Git - features.git/commitdiff
Fix bug, and introduce MultiPar parameter for flex insets
authorMartin Vermeer <martin.vermeer@hut.fi>
Tue, 9 Oct 2007 17:07:24 +0000 (17:07 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Tue, 9 Oct 2007 17:07:24 +0000 (17:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20869 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextClass.cpp
src/TextClass.h
src/insets/InsetFlex.cpp

index 83a7bf9e3332d844e7f8552d008ca6752ee73213..eb71d7380b1bd950533f8feb2cedb682e949d671 100644 (file)
@@ -620,6 +620,7 @@ enum InsetLayoutTags {
        IL_LATEXPARAM,
        IL_LATEXTYPE,
        IL_LYXTYPE,
+       IL_MULTIPAR,
        IL_PREAMBLE,
        IL_END
 };
@@ -638,6 +639,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                { "latexparam", IL_LATEXPARAM },
                { "latextype", IL_LATEXTYPE },
                { "lyxtype", IL_LYXTYPE },
+               { "multipar", IL_MULTIPAR },
                { "preamble", IL_PREAMBLE }
        };
 
@@ -649,10 +651,11 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
        string decoration;
        string latexname;
        string latexparam;
-       Font font(Font::ALL_INHERIT);
-       Font labelfont(Font::ALL_INHERIT);
+       Font font(defaultfont());
+       Font labelfont(defaultfont());
        Color::color bgcolor(Color::background);
        string preamble;
+       bool multipar(false);
 
        bool getout = false;
        while (!getout && lexrc.isOK()) {
@@ -692,6 +695,10 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                        labelfont.lyxRead(lexrc);
                        labelfont.realize(defaultfont());
                        break;
+               case IL_MULTIPAR:
+                       lexrc.next();
+                       multipar = lexrc.getBool();
+                       break;
                case IL_FONT:
                        font.lyxRead(lexrc);
                        font.realize(defaultfont());
@@ -724,6 +731,7 @@ void TextClass::readInsetLayout(Lexer & lexrc, docstring const & name)
                il.latextype = latextype;
                il.latexname = latexname;
                il.latexparam = latexparam;
+               il.multipar = multipar;
                il.font = font;
                il.labelfont = labelfont;
                il.bgcolor = bgcolor;           
index 4b432a15c0a201eeffd8710eaf9df6570492a958..4f50311df3caa7791d2a8dc5712eb0e916191fca 100644 (file)
@@ -45,6 +45,7 @@ public:
        Font labelfont;
        Color::color bgcolor;
        std::string preamble;
+       bool multipar;
 };
 
 
index 378a21ad0c3bae8a8fb0e4b39add1c73d458c37d..4a4b3856a36d83fe408014ef372a3d12d9efe164 100644 (file)
@@ -137,7 +137,7 @@ bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd,
                // paragraph breaks not allowed in flex insets
                case LFUN_BREAK_PARAGRAPH:
                case LFUN_BREAK_PARAGRAPH_SKIP:
-                       status.enabled(false);
+                       status.enabled(layout_.multipar);
                        return true;
 
                default: