]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
Remove indentation on screen after a plain separator inset
[lyx.git] / src / insets / InsetNote.cpp
index 45d89d0f13e924e233377d2030a9f4658d0e8ae5..a7a0dc16abf0fad7856075ad085271d6f600d724 100644 (file)
@@ -28,6 +28,7 @@
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "output_docbook.h"
+#include "output_latex.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -207,12 +208,12 @@ bool InsetNote::isMacroScope() const
 void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const
 {
        if (params_.type != InsetNoteParams::Greyedout
-           && runparams_in.for_search != OutputParams::NoSearch
-           && (runparams_in.for_search & OutputParams::SearchNonOutput) == 0)
+           && runparams_in.find_effective()
+           && !runparams_in.find_with_non_output())
                return;
 
        if (params_.type == InsetNoteParams::Note) {
-               if ((runparams_in.for_search & OutputParams::SearchNonOutput) != 0) {
+               if (runparams_in.find_with_non_output()) {
                        OutputParams runparams(runparams_in);
                        InsetCollapsible::latex(os, runparams);
                        runparams_in.encoding = runparams.encoding;
@@ -222,6 +223,12 @@ void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const
 
        OutputParams runparams(runparams_in);
        if (params_.type == InsetNoteParams::Comment) {
+               if (runparams_in.inComment) {
+                       // Nested comments should just output the contents.
+                       latexParagraphs(buffer(), text(), os, runparams);
+                       return;
+               }
+
                runparams.inComment = true;
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
@@ -251,11 +258,11 @@ void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const
 int InsetNote::plaintext(odocstringstream & os,
                         OutputParams const & runparams_in, size_t max_length) const
 {
-       if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0) {
+       if (!runparams_in.find_with_non_output()) {
                if (params_.type == InsetNoteParams::Note)
                        return 0;
                else if (params_.type == InsetNoteParams::Comment
-                   && (runparams_in.for_search != OutputParams::NoSearch))
+                   && runparams_in.find_effective())
                        return 0;
        }
 
@@ -265,10 +272,10 @@ int InsetNote::plaintext(odocstringstream & os,
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
        }
-       if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0)
+       if (!runparams_in.find_with_non_output())
                os << '[' << buffer().B_("note") << ":\n";
        InsetText::plaintext(os, runparams, max_length);
-       if ((runparams_in.for_search & OutputParams::SearchNonOutput) == 0)
+       if (!runparams_in.find_with_non_output())
                os << "\n]";
 
        return PLAINTEXT_NEWLINE + 1; // one char on a separate line