]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommand.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetcommand.C
index 3a05f4555660121b6d3b3264ad0ac18981947901..a5d2f391c5d230700939757af3c76fd4282d4bdd 100644 (file)
@@ -27,9 +27,9 @@ InsetCommandParams::InsetCommandParams()
 {}
 
 
-InsetCommandParams::InsetCommandParams( string const & n,
+InsetCommandParams::InsetCommandParams(string const & n,
                                        string const & c,
-                                       string const & o )
+                                       string const & o)
        : cmdname(n), contents(c), options(o)
 {}
 
@@ -40,7 +40,7 @@ string const InsetCommandParams::getAsString() const
 }
 
 
-void InsetCommandParams::setFromString( string const & b )
+void InsetCommandParams::setFromString(string const & b)
 {
        string::size_type idx = b.find("|++|");
        if (idx == string::npos) {
@@ -66,8 +66,8 @@ void InsetCommandParams::setFromString( string const & b )
 
 bool InsetCommandParams::operator==(InsetCommandParams const & o) const
 {
-       if (cmdname == o.cmdname && contents == o.contents && options == o.options) return true;
-       return false;
+       return cmdname == o.cmdname && contents == o.contents
+               && options == o.options;
 }
 
 
@@ -126,9 +126,9 @@ void InsetCommandParams::scanCommand(string const & cmd)
        }
 
        // Don't mess with this.
-       if (!tcmdname.empty())  setCmdName( tcmdname );
-       if (!toptions.empty())  setOptions( toptions );
-       if (!tcontents.empty()) setContents( tcontents ); 
+       if (!tcmdname.empty())  setCmdName(tcmdname);
+       if (!toptions.empty())  setOptions(toptions);
+       if (!tcontents.empty()) setContents(tcontents); 
 
        if (lyxerr.debugging(Debug::PARSER))
                lyxerr << "Command <" <<  cmd
@@ -144,14 +144,16 @@ void InsetCommandParams::read(LyXLex & lex)
 {    
        string token;
 
-       if (lex.EatLine()) {
-               token = lex.GetString();
+       if (lex.eatLine()) {
+               token = lex.getString();
                scanCommand(token);
-       } else
+       } else {
                lex.printError("InsetCommand: Parse error: `$$Token'");
-       while (lex.IsOK()) {
+       }
+       
+       while (lex.isOK()) {
                lex.nextToken();
-               token = lex.GetString();
+               token = lex.getString();
                if (token == "\\end_inset")
                        break;
        }
@@ -178,16 +180,16 @@ string const InsetCommandParams::getCommand() const
 }
 
 
-InsetCommand::InsetCommand( InsetCommandParams const & p )
-       : p_( p.getCmdName(), p.getContents(), p.getOptions() )
+InsetCommand::InsetCommand(InsetCommandParams const & p, bool)
+       : p_(p.getCmdName(), p.getContents(), p.getOptions())
 {}
 
 
-void InsetCommand::setParams(InsetCommandParams const & p )
+void InsetCommand::setParams(InsetCommandParams const & p)
 {
-       p_.setCmdName( p.getCmdName() );
-       p_.setContents( p.getContents() );
-       p_.setOptions( p.getOptions() );
+       p_.setCmdName(p.getCmdName());
+       p_.setContents(p.getContents());
+       p_.setOptions(p.getOptions());
 }
 
 
@@ -211,7 +213,7 @@ int InsetCommand::linuxdoc(Buffer const *, ostream &) const
 }
 
 
-int InsetCommand::docBook(Buffer const *, ostream &) const
+int InsetCommand::docbook(Buffer const *, ostream &) const
 {
        return 0;
 }