]> git.lyx.org Git - features.git/commitdiff
1/ call InsetCollapsable::validate instead of InsetText::validate in several
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Dec 2008 15:38:52 +0000 (15:38 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 Dec 2008 15:38:52 +0000 (15:38 +0000)
  to allow customization in layout files

2/ do not add preamble chunks for features that are used in inactive insets
  (notes, inactive branches)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27859 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetNote.cpp

index cc45619e0c25f4f038967923e667fd2b9b8fba31..43d29d8dcd66f73398588a95fdb7ff0c3c3fb26c 100644 (file)
@@ -508,7 +508,7 @@ void InsetBox::validate(LaTeXFeatures & features) const
                features.require("framed");
                break;
        }
-       InsetText::validate(features);
+       InsetCollapsable::validate(features);
 }
 
 
index 968abf04005884967c7ee87f73c3a30bf635f637..d33069f62b3ec635518200af8f5b47372c6dcff8 100644 (file)
@@ -241,7 +241,8 @@ void InsetBranch::tocString(odocstream & os) const
 
 void InsetBranch::validate(LaTeXFeatures & features) const
 {
-       InsetText::validate(features);
+       if (isBranchSelected())
+               InsetCollapsable::validate(features);
 }
 
 
index 91258a891ecd9c0e106401b4475c48c57ebabb14..f7f924bc0aab55c956d454d5967d21398e746b24 100644 (file)
@@ -328,13 +328,18 @@ int InsetNote::docbook(odocstream & os, OutputParams const & runparams_in) const
 
 void InsetNote::validate(LaTeXFeatures & features) const
 {
-       if (params_.type == InsetNoteParams::Comment)
+       switch (params_.type) {
+       case InsetNoteParams::Comment:
                features.require("verbatim");
-       if (params_.type == InsetNoteParams::Greyedout) {
+               break;
+       case InsetNoteParams::Greyedout:
                features.require("color");
                features.require("lyxgreyedout");
+               InsetCollapsable::validate(features);
+               break;
+       case InsetNoteParams::Note:
+               break;
        }
-       InsetText::validate(features);
 }