]> git.lyx.org Git - features.git/commitdiff
ork around missing argument for
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 8 May 2002 17:20:55 +0000 (17:20 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 8 May 2002 17:20:55 +0000 (17:20 +0000)
layout

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4140 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog

index c9ea41585318962a581c609c32fa86c6ba4e2cad..e106c4181edc1e8bef84e9458a696985050e4638 100644 (file)
@@ -1808,6 +1808,17 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                lyxerr[Debug::INFO] << "LFUN_LAYOUT: (arg) "
                                    << argument << endl;
 
+               // This is not the good solution to the empty argument
+               // problem, but it will hopefully suffice for 1.2.0.
+               // The correct solution would be to augument the
+               // function list/array with information about what
+               // functions needs arguments and their type.
+               if (argument.empty()) {
+                       owner_->getLyXFunc()->setErrorMessage(
+                               _("LyX function 'layout' needs an argument."));
+                       break;
+               }
+
                // Derive layout number from given argument (string)
                // and current buffer's textclass (number). */
                bool hasLayout = tclass.hasLayout(argument);
index a2c9ac154154620b7dbeb1bcf99ad9978f3018ec..ea75c3ad25c7a2a4b7a8a0e17f5308d26a2358ba 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-08  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * BufferView_pimpl.C (Dispatch): work around missing argument for
+       'layout'
+
 2002-05-08  Juergen Vigna  <jug@sad.it>
 
        * text.C (leftMargin): handle paragraph leftindent.
 2002-05-05  Dekel Tsur  <dekelts@tau.ac.il>
 
        * paragraph.C (isRightToLeftPar): Return false for a paragraph
-       inside insetERT.
+       inside insetERT.
 
        * text.C (computeBidiTables): No bidi in insetERT.
 
        * BufferView_pimpl.C (setState): Fix keymap handling inside insetERT
-       in RTL documents.
+       in RTL documents.
 
 2002-05-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>