Renamed selectNextWord as selectNextWordToSpellcheck.

Modified selectNextWordToSpellcheck to not select words inside an ERT inset.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2785 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2001-09-21 16:21:23 +00:00
parent a10b503e59
commit a2ef5d11b3
13 changed files with 34 additions and 21 deletions

View File

@ -339,7 +339,7 @@ string const BufferView::nextWord(float & value)
return string();
}
return text->selectNextWord(this, value);
return text->selectNextWordToSpellcheck(this, value);
}

View File

@ -1,3 +1,11 @@
2001-09-21 Angus Leeming <a.leeming@ic.ac.uk>
* lyxtext.h, text.C (selectNextWord): renamed as
selectNextWordToSpellcheck.
* text.C (selectNextWordToSpellcheck): Modified to not select
words inside an ERT inset.
2001-09-21 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_cb.C (MenuLayoutSave): change a bit the question

View File

@ -1,5 +1,8 @@
2001-09-21 Angus Leeming <a.leeming@ic.ac.uk>
* various files (selectNextWord): renamed as
selectNextWordToSpellcheck.
* insetgraphics.C (draw): remove the previous change. Right place
is in imageLoaderXPM.C.
(draw): don't display the image if params.display == NONE.

View File

@ -345,7 +345,7 @@ LyXCursor const & Inset::cursor(BufferView * bv) const
}
string const UpdatableInset::selectNextWord(BufferView *bv,
string const UpdatableInset::selectNextWordToSpellcheck(BufferView *bv,
float & value) const
{
// we have to unlock ourself in this function by default!

View File

@ -471,7 +471,7 @@ public:
///
// needed for spellchecking text
///
virtual string const selectNextWord(BufferView *, float & value) const;
virtual string const selectNextWordToSpellcheck(BufferView *, float & value) const;
///
virtual void selectSelectedWord(BufferView *) { return; }
///

View File

@ -644,10 +644,10 @@ bool InsetCollapsable::searchBackward(BufferView * bv, string const & str,
}
string const InsetCollapsable::selectNextWord(BufferView * bv,
string const InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
float & value) const
{
string const str = inset.selectNextWord(bv, value);
string const str = inset.selectNextWordToSpellcheck(bv, value);
if (first_after_edit && str.empty())
close(bv);
first_after_edit = false;

View File

@ -175,7 +175,7 @@ public:
///
void close(BufferView *) const;
///
string const selectNextWord(BufferView * bv, float & value) const;
string const selectNextWordToSpellcheck(BufferView * bv, float & value) const;
void selectSelectedWord(BufferView * bv) {
inset.selectSelectedWord(bv);

View File

@ -2490,10 +2490,10 @@ Inset * InsetTabular::getInsetFromID(int id_arg) const
}
string const InsetTabular::selectNextWord(BufferView * bv, float & value) const
string const InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
{
if (the_locking_inset) {
string const str(the_locking_inset->selectNextWord(bv, value));
string const str(the_locking_inset->selectNextWordToSpellcheck(bv, value));
if (!str.empty())
return str;
if (tabular->IsLastCell(actcell)) {
@ -2520,7 +2520,7 @@ string InsetTabular::selectNextWordInt(BufferView * bv, float & value) const
// when entering this function the inset should be ALWAYS locked!
lyx::Assert(the_locking_inset);
string const str(the_locking_inset->selectNextWord(bv, value));
string const str(the_locking_inset->selectNextWordToSpellcheck(bv, value));
if (!str.empty())
return str;

View File

@ -212,7 +212,7 @@ public:
///
LyXCursor const & cursor(BufferView *) const;
///
string const selectNextWord(BufferView *, float & value) const;
string const selectNextWordToSpellcheck(BufferView *, float & value) const;
void selectSelectedWord(BufferView *);
void toggleSelection(BufferView *, bool kill_selection);
///

View File

@ -2186,7 +2186,7 @@ Inset * InsetText::getInsetFromID(int id_arg) const
}
string const InsetText::selectNextWord(BufferView * bv, float & value) const
string const InsetText::selectNextWordToSpellcheck(BufferView * bv, float & value) const
{
bool clear = false;
string str;
@ -2196,7 +2196,7 @@ string const InsetText::selectNextWord(BufferView * bv, float & value) const
clear = true;
}
if (the_locking_inset) {
str = the_locking_inset->selectNextWord(bv, value);
str = the_locking_inset->selectNextWordToSpellcheck(bv, value);
if (!str.empty()) {
value += cy(bv);
if (clear)
@ -2208,7 +2208,7 @@ string const InsetText::selectNextWord(BufferView * bv, float & value) const
// we have to go on checking so move cusor to the right
lt->cursor.pos(lt->cursor.pos() + 1);
}
str = lt->selectNextWord(bv, value);
str = lt->selectNextWordToSpellcheck(bv, value);
if (str.empty())
bv->unlockInset(const_cast<InsetText *>(this));
else

View File

@ -229,7 +229,7 @@ public:
///
void paragraph(Paragraph *);
///
string const selectNextWord(BufferView *, float & value) const;
string const selectNextWordToSpellcheck(BufferView *, float & value) const;
void selectSelectedWord(BufferView *);
void toggleSelection(BufferView *, bool kill_selection);
///

View File

@ -295,7 +295,7 @@ public:
to the beginning of this word.
With SelectSelectedWord can this be highlighted really
*/
string const selectNextWord(BufferView *, float & value) const;
string const selectNextWordToSpellcheck(BufferView *, float & value) const;
///
void selectSelectedWord(BufferView *);
///

View File

@ -2271,11 +2271,11 @@ bool LyXText::selectWordWhenUnderCursor(BufferView * bview,
// This function is only used by the spellchecker for NextWord().
// It doesn't handle LYX_ACCENTs and probably never will.
string const LyXText::selectNextWord(BufferView * bview,
string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
float & value) const
{
if (the_locking_inset) {
string str = the_locking_inset->selectNextWord(bview, value);
string str = the_locking_inset->selectNextWordToSpellcheck(bview, value);
if (!str.empty()) {
value += float(cursor.y())/float(height);
return str;
@ -2306,10 +2306,12 @@ string const LyXText::selectNextWord(BufferView * bview,
while ((cursor.par()->size() > cursor.pos()
&& (!cursor.par()->isLetter(cursor.pos()))
&& (!cursor.par()->isInset(cursor.pos()) ||
!cursor.par()->getInset(cursor.pos())->isTextInset()))
!(cursor.par()->getInset(cursor.pos())->isTextInset() &&
cursor.par()->getInset(cursor.pos())->lyxCode() !=
Inset::ERT_CODE)))
|| (cursor.par()->size() == cursor.pos()
&& cursor.par()->next()))
{
{
if (cursor.pos() == cursor.par()->size()) {
cursor.par(cursor.par()->next());
cursor.pos(0);
@ -2319,13 +2321,13 @@ string const LyXText::selectNextWord(BufferView * bview,
// now check if we hit an inset so it has to be a inset containing text!
if (cursor.pos() < cursor.par()->size() &&
cursor.par()->isInset(cursor.pos()))
cursor.par()->isInset(cursor.pos()))
{
// lock the inset!
cursor.par()->getInset(cursor.pos())->edit(bview);
// now call us again to do the above trick
// but obviously we have to start from down below ;)
return bview->text->selectNextWord(bview, value);
return bview->text->selectNextWordToSpellcheck(bview, value);
}
// Update the value if we changed paragraphs