]> git.lyx.org Git - features.git/blobdiff - src/TextClass.cpp
Allow entering localized lengths with unit (#11852)
[features.git] / src / TextClass.cpp
index d3d2926d5ba051a61ec8358e26a74b7ad72885a3..3a131d9d8eb803254c42f60bedb546d6078f92fc 100644 (file)
@@ -59,7 +59,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 92; // spitz: ProvideInsetLayout and ModifyInsetLayout
+int const LAYOUT_FORMAT = 95; // tcuvelier: DocBookRenderAsImage
 
 
 // Layout format for the current lyx file format. Controls which format is
@@ -691,7 +691,7 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                case TC_PKGOPTS : {
                        lexrc.next();
                        string const pkg = lexrc.getString();
-                       lexrc.next();
+                       lexrc.eatLine();
                        string const options = lexrc.getString();
                        package_options_[pkg] = options;
                        break;
@@ -1402,8 +1402,10 @@ bool TextClass::readFloat(Lexer & lexrc)
                FT_HTMLATTR,
                FT_HTMLTAG,
                FT_DOCBOOKATTR,
+               FT_DOCBOOKFLOATTYPE,
                FT_DOCBOOKTAG,
                FT_DOCBOOKTAGTYPE,
+               FT_DOCBOOKCAPTION,
                FT_LISTCOMMAND,
                FT_REFPREFIX,
                FT_ALLOWED_PLACEMENT,
@@ -1418,6 +1420,8 @@ bool TextClass::readFloat(Lexer & lexrc)
                { "allowssideways", FT_ALLOWS_SIDEWAYS },
                { "allowswide", FT_ALLOWS_WIDE },
                { "docbookattr", FT_DOCBOOKATTR },
+               { "docbookcaption", FT_DOCBOOKCAPTION },
+               { "docbookfloattype", FT_DOCBOOKFLOATTYPE },
                { "docbooktag", FT_DOCBOOKTAG },
                { "docbooktagtype", FT_DOCBOOKTAGTYPE },
                { "end", FT_END },
@@ -1445,8 +1449,10 @@ bool TextClass::readFloat(Lexer & lexrc)
        docstring htmlstyle;
        string htmltag;
        string docbookattr;
+       string docbookcaption;
        string docbooktag;
        string docbooktagtype;
+       string docbookfloattype;
        string listname;
        string listcommand;
        string name;
@@ -1564,6 +1570,10 @@ bool TextClass::readFloat(Lexer & lexrc)
                        lexrc.next();
                        docbookattr = lexrc.getString();
                        break;
+               case FT_DOCBOOKCAPTION:
+                       lexrc.next();
+                       docbookcaption = lexrc.getString();
+                       break;
                case FT_DOCBOOKTAG:
                        lexrc.next();
                        docbooktag = lexrc.getString();
@@ -1572,9 +1582,16 @@ bool TextClass::readFloat(Lexer & lexrc)
                        lexrc.next();
                        docbooktagtype = lexrc.getString();
                        break;
+               case FT_DOCBOOKFLOATTYPE:
+                       lexrc.next();
+                       docbookfloattype = lexrc.getString();
+                       break;
                case FT_END:
                        getout = true;
                        break;
+               default:
+                       LYXERR0("Unhandled value " << le << " in TextClass::readFloat.");
+                       break;
                }
        }
 
@@ -1599,8 +1616,9 @@ bool TextClass::readFloat(Lexer & lexrc)
                }
                Floating fl(type, placement, ext, within, style, name,
                        listname, listcommand, refprefix, allowed_placement,
-                       htmltag, htmlattr, htmlstyle, docbookattr,
-                       docbooktagtype, required, usesfloat, ispredefined,
+                       htmltag, htmlattr, htmlstyle, docbooktag, docbookattr,
+                       docbooktagtype, docbookfloattype, docbookcaption,
+                       required, usesfloat, ispredefined,
                allowswide, allowssideways);
                floatlist_.newFloat(fl);
                // each float has its own counter
@@ -1749,7 +1767,7 @@ bool TextClass::load(string const & path) const
                       << to_utf8(makeDisplayPath(layout_file.absFileName()))
                       << "'\n(Check `" << name_
                       << "')\nCheck your installation and "
-                         "try Options/Reconfigure..."
+                         "try Tools/Reconfigure..."
                       << endl;
        }