commit e93e50bf563929cdb1e60c261a9b1356d02ca990
Author: Thibaut Cuvelier <tcuvel...@lyx.org>
Date:   Mon Sep 27 03:30:45 2021 +0200

    DocBook: add the DocBookRenderAsImage tag.
---
 lib/layouts/linguistics.module |    1 +
 lib/scripts/layout2layout.py   |    7 +++++--
 src/TextClass.cpp              |    2 +-
 src/insets/InsetLayout.cpp     |    5 +++++
 src/insets/InsetLayout.h       |    4 ++++
 5 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module
index afbc733..3405748 100644
--- a/lib/layouts/linguistics.module
+++ b/lib/layouts/linguistics.module
@@ -276,6 +276,7 @@ InsetLayout Flex:Structure_Tree
        \useforestlibrary*{linguistics}
        }{}
        EndPreamble
+    DocBookRenderAsImage  true
 End
 
 
diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py
index e7eb307..7e40bfb 100644
--- a/lib/scripts/layout2layout.py
+++ b/lib/scripts/layout2layout.py
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 94
+currentFormat = 95
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -319,6 +319,9 @@ currentFormat = 94
 # Incremented to format 94, 19 September 2021 by tcuvelier
 # Add DocBookFloatType, DocBookCaption
 
+# Incremented to format 95, 27 September 2021 by tcuvelier
+# Add DocBookRenderAsImage
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -569,7 +572,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if 87 <= format <= 94:
+        if 87 <= format <= 95:
             # nothing to do.
             i += 1
             continue
diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index 9546cee..a04a6f6 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -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 = 94; // tcuvelier: DocBookFloatType, DocBookCaption
+int const LAYOUT_FORMAT = 95; // tcuvelier: DocBookRenderAsImage
 
 
 // Layout format for the current lyx file format. Controls which format is
diff --git a/src/insets/InsetLayout.cpp b/src/insets/InsetLayout.cpp
index 769a774..64258a8 100644
--- a/src/insets/InsetLayout.cpp
+++ b/src/insets/InsetLayout.cpp
@@ -111,6 +111,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & 
tclass,
                IL_DOCBOOKINNERTAGTYPE,
                IL_DOCBOOKINNERATTR,
         IL_DOCBOOKNOFONTINSIDE,
+        IL_DOCBOOKRENDERASIMAGE,
                IL_INTOC,
                IL_ISTOCCAPTION,
                IL_LABELFONT,
@@ -170,6 +171,7 @@ bool InsetLayout::read(Lexer & lex, TextClass const & 
tclass,
                { "docbookitemwrappertagtype", IL_DOCBOOKITEMWRAPPERTAGTYPE },
                { "docbooknofontinside", IL_DOCBOOKNOFONTINSIDE },
                { "docbooknotinpara", IL_DOCBOOKNOTINPARA },
+               { "docbookrenderasimage", IL_DOCBOOKRENDERASIMAGE },
                { "docbooksection", IL_DOCBOOKSECTION },
                { "docbooktag", IL_DOCBOOKTAG },
                { "docbooktagtype", IL_DOCBOOKTAGTYPE },
@@ -581,6 +583,9 @@ bool InsetLayout::read(Lexer & lex, TextClass const & 
tclass,
         case IL_DOCBOOKNOFONTINSIDE:
             lex >> docbooknofontinside_;
             break;
+        case IL_DOCBOOKRENDERASIMAGE:
+            lex >> docbookrenderasimage_;
+            break;
                case IL_REQUIRES: {
                        lex.eatLine();
                        vector<string> const req
diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index da003a9..ed3c9a9 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -192,6 +192,8 @@ public:
        ///
        bool docbooknofontinside() const { return docbooknofontinside_; }
        ///
+       bool docbookrenderasimage() const { return docbookrenderasimage_; }
+       ///
        std::set<std::string> required() const { return required_; }
        ///
        bool isMultiPar() const { return multipar_; }
@@ -361,6 +363,8 @@ private:
        ///
        bool docbooknofontinside_ = false;
        ///
+       bool docbookrenderasimage_ = false;
+       ///
        std::set<std::string> required_;
        ///
        bool multipar_ = true;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to