]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.cpp
Fix bug #7983: Do not modify params before we know we have
[lyx.git] / src / insets / InsetBox.cpp
index ccd1d12107123e332696d460ef15a788d44a18fb..ec48bd20b1184cf5904f8728b20d25382827d510 100644 (file)
@@ -312,7 +312,7 @@ void InsetBox::latex(otexstream & os, OutputParams const & runparams) const
                os << "\\shadowbox{";
                break;
        case Shaded:
-               // must be set later becaue e.g. the width settings only work when
+               // must be set later because e.g. the width settings only work when
                // it is inside a minipage or parbox
                break;
        case Doublebox:
@@ -530,9 +530,9 @@ void InsetBox::validate(LaTeXFeatures & features) const
 }
 
 
-docstring InsetBox::contextMenuName() const
+string InsetBox::contextMenuName() const
 {
-       return from_ascii("context-box");
+       return "context-box";
 }
 
 
@@ -547,7 +547,6 @@ string InsetBox::params2string(InsetBoxParams const & params)
 
 void InsetBox::string2params(string const & in, InsetBoxParams & params)
 {
-       params = InsetBoxParams(string());
        if (in.empty())
                return;
 
@@ -572,6 +571,7 @@ void InsetBox::string2params(string const & in, InsetBoxParams & params)
                                          "Expected arg 2 to be \"Box\"\n");
        }
 
+       params = InsetBoxParams(string());
        params.read(lex);
 }