]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
Support for \begin{math}
[lyx.git] / src / BufferView_pimpl.C
index 2ef0d9848538dd374036b496459ec370c61f7fca..ade488ad3a8fa5bb5eeb96148af496fdc908daf7 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);
@@ -905,6 +910,8 @@ Inset * BufferView::Pimpl::checkInset(LyXText const & text, LyXCursor const & cu
        Box b(insetDimensions(text, cursor));
 
        if (!b.contained(x, y)) {
+               lyxerr[Debug::GUI] << "Missed inset at x,y " << x << "," << y 
+                       << " box " << b << endl;
                return 0;
        }
  
@@ -3405,8 +3412,7 @@ void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty)
                                return;
                        }
                } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) {
-                       if (bv_->text->updateInset(bv_,
-                                                  bv_->theLockingInset())) {
+                       if (bv_->text->updateInset(bv_,  bv_->theLockingInset())) {
                                update();
                                if (mark_dirty){
                                        buffer_->markDirty();