]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Context.cpp
tex2lyx/text.cpp: take care of the brace pair after comment environments that are...
[lyx.git] / src / tex2lyx / Context.cpp
index ff3c85d114a7b1892311b3cc6a59db2caa22c6d4..1e05984bcfb7a4371ce1b8ee8517e0a35e23dea7 100644 (file)
 #include <iostream>
 
 using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
 namespace {
 
-void begin_layout(ostream & os, LayoutPtr const & layout, TeXFont const & font,
+void begin_layout(ostream & os, Layout const * const & layout, TeXFont const & font,
                  TeXFont const & normalfont)
 {
        os << "\n\\begin_layout " << to_utf8(layout->name()) << "\n";
@@ -82,8 +83,8 @@ bool Context::empty = true;
 
 
 Context::Context(bool need_layout_,
-                TextClass const & textclass_,
-                LayoutPtr layout_, LayoutPtr parent_layout_,
+                TeX2LyXDocClass const & textclass_,
+                Layout const * layout_, Layout const * parent_layout_,
                 TeXFont font_)
        : need_layout(need_layout_),
          need_end_layout(false), need_end_deeper(false),
@@ -92,10 +93,10 @@ Context::Context(bool need_layout_,
          layout(layout_), parent_layout(parent_layout_),
          font(font_)
 {
-       if (!layout.get())
-               layout = textclass.defaultLayout();
-       if (!parent_layout.get())
-               parent_layout = textclass.defaultLayout();
+       if (!layout)
+               layout = &textclass.defaultLayout();
+       if (!parent_layout)
+               parent_layout = &textclass.defaultLayout();
 }
 
 
@@ -131,7 +132,7 @@ void Context::check_layout(ostream & os)
                                // that this may require a begin_deeper.
                                if (!deeper_paragraph)
                                        begin_deeper(os);
-                               begin_layout(os, textclass.defaultLayout(),
+                               begin_layout(os, &textclass.defaultLayout(),
                                             font, normalfont);
                                deeper_paragraph = true;
                        }
@@ -206,7 +207,7 @@ void Context::new_paragraph(ostream & os)
 
 void Context::add_extra_stuff(string const & stuff)
 {
-       if (!lyx::support::contains(extra_stuff, stuff))
+       if (!contains(extra_stuff, stuff))
                extra_stuff += stuff;
 }