]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
more guii moving around.
[lyx.git] / src / BufferView_pimpl.C
index c9ea41585318962a581c609c32fa86c6ba4e2cad..aef9714b7d94a76864eb9cd760d1c50eff62271d 100644 (file)
@@ -5,12 +5,12 @@
 #endif
 
 #include "BufferView_pimpl.h"
-#include "WorkArea.h"
-#include "lyxscreen.h"
+#include "frontends/WorkArea.h"
+#include "frontends/screen.h"
 #include "lyxtext.h"
 #include "lyxrow.h"
 #include "paragraph.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
 #include "commandtags.h"
 #include "lyxfunc.h"
 #include "debug.h"
@@ -1530,6 +1530,7 @@ void BufferView::Pimpl::pasteClipboard(bool asPara)
        } else {
                bv_->getLyXText()->insertStringAsLines(bv_, clip);
        }
+       bv_->getLyXText()->clearSelection();
        update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
 }
 
@@ -1808,6 +1809,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);