Fixed tripleClick inside InsetText.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3264 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2001-12-24 14:11:31 +00:00
parent 35dc964fe7
commit 2f64c235d3
2 changed files with 22 additions and 16 deletions

View File

@ -682,25 +682,25 @@ void BufferView::Pimpl::doubleClick(int /*x*/, int /*y*/, unsigned int button)
{ {
// select a word // select a word
if (!buffer_) if (!buffer_)
return; return;
LyXText * text = bv_->getLyXText(); LyXText * text = bv_->getLyXText();
if (text->bv_owner && bv_->theLockingInset()) if (text->bv_owner && bv_->theLockingInset())
return; return;
if (screen_.get() && button == 1) { if (screen_.get() && button == 1) {
if (text->bv_owner) { if (text->bv_owner) {
screen_->hideCursor(); screen_->hideCursor();
screen_->toggleSelection(text, bv_); screen_->toggleSelection(text, bv_);
text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT); text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
screen_->toggleSelection(text, bv_, false); screen_->toggleSelection(text, bv_, false);
} else { } else {
text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT); text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
} }
/* This will fit the cursor on the screen /* This will fit the cursor on the screen
* if necessary */ * if necessary */
update(text, BufferView::SELECT|BufferView::FITCUR); update(text, BufferView::SELECT|BufferView::FITCUR);
} }
} }
@ -717,13 +717,17 @@ void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, unsigned int button)
return; return;
if (screen_.get() && (button == 1)) { if (screen_.get() && (button == 1)) {
screen_->hideCursor(); if (text->bv_owner) {
screen_->toggleSelection(text, bv_); screen_->hideCursor();
screen_->toggleSelection(text, bv_);
}
text->cursorHome(bv_); text->cursorHome(bv_);
text->selection.cursor = text->cursor; text->selection.cursor = text->cursor;
text->cursorEnd(bv_); text->cursorEnd(bv_);
text->setSelection(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 /* This will fit the cursor on the screen
* if necessary */ * if necessary */
update(text, BufferView::SELECT|BufferView::FITCUR); update(text, BufferView::SELECT|BufferView::FITCUR);

View File

@ -1,5 +1,7 @@
2001-12-24 Juergen Vigna <jug@sad.it> 2001-12-24 Juergen Vigna <jug@sad.it>
* BufferView_pimpl.C (tripleClick): fixed for InsetText.
* buffer.C (parseSingleLyXformat2Token): fixed 2 compatibility read * buffer.C (parseSingleLyXformat2Token): fixed 2 compatibility read
problems. First check a minipage also if we have some ert-contents problems. First check a minipage also if we have some ert-contents
(not only on par->size(), second set the right depth of the paragraph (not only on par->size(), second set the right depth of the paragraph