]> git.lyx.org Git - lyx.git/commitdiff
* 1 off error, leading to a crash with only one optional parameter
authorStefan Schimanski <sts@lyx.org>
Thu, 1 Nov 2007 22:15:00 +0000 (22:15 +0000)
committerStefan Schimanski <sts@lyx.org>
Thu, 1 Nov 2007 22:15:00 +0000 (22:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21357 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathMacroTemplate.cpp

index 773bac1e4e1bbd199a8534eaab14eca998f06b3e..b6dfba17b11ba6fabef83180dc23eab12d38539c 100644 (file)
@@ -481,7 +481,9 @@ void MathMacroTemplate::makeOptional(Cursor & cur) {
 void MathMacroTemplate::makeNonOptional(Cursor & cur) {
        if (numargs_ > 0 && optionals_ > 0) {
                --optionals_;
-               optionalValues_[optionals_ - 1] = cell(optIdx(optionals_));
+               
+               // store default value for later if the use changes his mind
+               optionalValues_[optionals_] = cell(optIdx(optionals_));
                cells_.erase(cells_.begin() + optIdx(optionals_));
 
                // fix cursor