]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
John's Layout Tabular UI improvements and Martins fixes to clearing the
[lyx.git] / src / BufferView_pimpl.C
index 2ef0d9848538dd374036b496459ec370c61f7fca..da45676c33d8a96f95710361ae71e5a865b643c1 100644 (file)
@@ -28,6 +28,7 @@
 #include "gettext.h"
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"
+#include "lyxtextclasslist.h"
 
 #include "frontends/Dialogs.h"
 #include "frontends/Alert.h"
@@ -70,7 +71,7 @@
 #include <ctime>
 #include <unistd.h>
 #include <sys/wait.h>
-#include <locale.h>
+#include <clocale>
 
 
 extern lyx::layout_type current_layout;
@@ -682,25 +683,25 @@ void BufferView::Pimpl::doubleClick(int /*x*/, int /*y*/, unsigned int button)
 {
        // select a word
        if (!buffer_)
-           return;
+               return;
 
        LyXText * text = bv_->getLyXText();
 
        if (text->bv_owner && bv_->theLockingInset())
-           return;
+               return;
 
        if (screen_.get() && button == 1) {
-           if (text->bv_owner) {
-               screen_->hideCursor();
-               screen_->toggleSelection(text, bv_);
-               text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
-               screen_->toggleSelection(text, bv_, false);
-           } else {
-               text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
-           }
-           /* This will fit the cursor on the screen
-            * if necessary */
-           update(text, BufferView::SELECT|BufferView::FITCUR);
+               if (text->bv_owner) {
+                       screen_->hideCursor();
+                       screen_->toggleSelection(text, bv_);
+                       text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
+                       screen_->toggleSelection(text, bv_, false);
+               } else {
+                       text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
+               }
+               /* This will fit the cursor on the screen
+                * if necessary */
+               update(text, BufferView::SELECT|BufferView::FITCUR);
        }
 }
 
@@ -717,13 +718,17 @@ void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, unsigned int button)
            return;
 
        if (screen_.get() && (button == 1)) {
-               screen_->hideCursor();
-               screen_->toggleSelection(text, bv_);
+               if (text->bv_owner) {
+                       screen_->hideCursor();
+                       screen_->toggleSelection(text, bv_);
+               }
                text->cursorHome(bv_);
                text->selection.cursor = text->cursor;
                text->cursorEnd(bv_);
                text->setSelection(bv_);
-               screen_->toggleSelection(text, bv_, false);
+               if (text->bv_owner) {
+                       screen_->toggleSelection(text, bv_, false);
+               }
                /* This will fit the cursor on the screen
                 * if necessary */
                update(text, BufferView::SELECT|BufferView::FITCUR);