]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/context.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / tex2lyx / context.C
index e50d52bc9cfb0d342176e0da063cc00a80001da2..12404d9d12711564dbd08203c6a5500425e4223b 100644 (file)
@@ -15,6 +15,9 @@
 #include "support/lstrings.h"
 #include "context.h"
 
+
+namespace lyx {
+
 using std::ostream;
 using std::endl;
 using std::string;
@@ -23,7 +26,7 @@ using std::string;
 namespace {
 
 void begin_layout(ostream & os, LyXLayout_ptr layout, Font const & font,
-                  Font const & normalfont)
+                 Font const & normalfont)
 {
        os << "\n\\begin_layout " << layout->name() << "\n";
        // FIXME: This is not enough for things like
@@ -63,7 +66,7 @@ bool operator==(Font const & f1, Font const & f2)
 
 
 void output_font_change(ostream & os, Font const & oldfont,
-                        Font const & newfont)
+                       Font const & newfont)
 {
        if (oldfont.family != newfont.family)
                os << "\n\\family " << newfont.family << '\n';
@@ -77,6 +80,7 @@ void output_font_change(ostream & os, Font const & oldfont,
 
 
 Font Context::normalfont;
+bool Context::empty = true;
 
 
 Context::Context(bool need_layout_,
@@ -101,7 +105,7 @@ Context::~Context()
 {
        if (!extra_stuff.empty())
                std::cerr << "Bug: Ignoring extra stuff '" << extra_stuff
-                         << '\'' << std::endl;
+                         << '\'' << std::endl;
 }
 
 
@@ -130,21 +134,21 @@ void Context::check_layout(ostream & os)
                                if (!deeper_paragraph)
                                        begin_deeper(os);
                                begin_layout(os, textclass.defaultLayout(),
-                                            font, normalfont);
+                                            font, normalfont);
                                deeper_paragraph = true;
                        }
-                       need_layout = false;
                } else {
                        // No list-like environment
                        begin_layout(os, layout, font, normalfont);
-                       need_layout=false;
                }
+               need_layout = false;
                need_end_layout = true;
                if (!extra_stuff.empty()) {
                        os << extra_stuff;
                        extra_stuff.erase();
                }
                os << "\n";
+               empty = false;
        }
 }
 
@@ -232,3 +236,6 @@ void Context::dump(ostream & os, string const & desc) const
           << font.size << ' ' << font.family << ' ' << font.series << ' '
           << font.shape << ']' << endl;
 }
+
+
+} // namespace lyx