commit 181ecc51a7d758f2d5d24f8ba571f7d313ed31ff
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Wed Sep 21 16:11:53 2016 +0200

    Do not hardcode required packages for Note inset
    
    This does not change the default behavior, but allows to customize it.
    
    (cherry picked from commit db1270765573eafc453fe903fcfb6f9ba91f9f31)
---
 lib/layouts/stdinsets.inc |    2 ++
 src/insets/InsetNote.cpp  |    6 +++---
 status.22x                |    2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index 7432b29..5d07e28 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -115,6 +115,7 @@ InsetLayout Note:Comment
        LabelString           Comment
        LatexType             environment
        LatexName             comment
+       Requires              verbatim
        BgColor               commentbg
        LabelFont
          Color               comment
@@ -151,6 +152,7 @@ InsetLayout Note:Greyedout
        LabelString           Greyedout
        LatexType             environment
        LatexName             lyxgreyedout
+       Requires              color,lyxgreyedout
        BgColor               greyedoutbg
        Font
          Color               greyedouttext
diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index e483cf2..3f42277 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -329,15 +329,15 @@ void InsetNote::validate(LaTeXFeatures & features) const
 {
        switch (params_.type) {
        case InsetNoteParams::Comment:
-               features.require("verbatim");
                if (features.runparams().flavor == OutputParams::HTML)
                        // we do output this but set display to "none" by 
default,
                        // but people might want to use it.
                        InsetCollapsable::validate(features);
+               else
+                       // Only do the requires
+                       features.useInsetLayout(getLayout());
                break;
        case InsetNoteParams::Greyedout:
-               features.require("color");
-               features.require("lyxgreyedout");
                InsetCollapsable::validate(features);
                break;
        case InsetNoteParams::Note:
diff --git a/status.22x b/status.22x
index ea92658..acae4f6 100644
--- a/status.22x
+++ b/status.22x
@@ -36,6 +36,8 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Do not hardcode required packages for Note inset.
+
 
 * LYX2LYX
 

Reply via email to