X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2Fcontext.C;h=12404d9d12711564dbd08203c6a5500425e4223b;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=e50d52bc9cfb0d342176e0da063cc00a80001da2;hpb=233c69505a3e6774fff3876f535dca4da7ec74f2;p=lyx.git diff --git a/src/tex2lyx/context.C b/src/tex2lyx/context.C index e50d52bc9c..12404d9d12 100644 --- a/src/tex2lyx/context.C +++ b/src/tex2lyx/context.C @@ -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