]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.cpp
Move editing, shortcuts, keyboard/mouse and completion to a separate category in...
[lyx.git] / src / Layout.cpp
index 134d6a1ad96af1ca9524d0aaf689b5617d0e34a4..e368f23bbda0e821d3928b0f58538e5290a9e577 100644 (file)
@@ -223,7 +223,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
 
                                if (tclass.hasLayout(style)) {
                                        docstring const tmpname = name_;
-                                       this->operator=(*tclass[style]);
+                                       this->operator=(tclass[style]);
                                        name_ = tmpname;
                                } else {
                                        lyxerr << "Cannot copy unknown style `"
@@ -233,7 +233,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                                        DocumentClass::const_iterator lit = tclass.begin();
                                        DocumentClass::const_iterator len = tclass.end();
                                        for (; lit != len; ++lit)
-                                               lyxerr << to_utf8((*lit)->name()) << endl;
+                                               lyxerr << to_utf8(lit->name()) << endl;
 
                                        //lexrc.printError("Cannot copy known "
                                        //               "style `$$Token'");
@@ -248,7 +248,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
 
                                if (tclass.hasLayout(style)) {
                                        docstring const tmpname = name_;
-                                       this->operator=(*tclass[style]);
+                                       this->operator=(tclass[style]);
                                        name_ = tmpname;
                                        if (obsoleted_by().empty())
                                                obsoleted_by_ = style;
@@ -830,6 +830,16 @@ docstring const & Layout::depends_on() const
 }
 
 
+bool Layout::operator==(Layout const & rhs) const
+{
+       // This is enough for the applications we actually make,
+       // at least at the moment. But we could check more.
+       return name() == rhs.name()
+               && latexname() == rhs.latexname()
+               && latextype == rhs.latextype;
+}
+
+
 Layout * Layout::forCaption()
 {
        Layout * lay = new Layout();