"Correct" way to prevent spellchecking in the ERT inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2795 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2001-09-24 14:29:27 +00:00
parent 0e9148aa78
commit 506d970e27
6 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-09-24 Angus Leeming <a.leeming@ic.ac.uk>
* text.C (selectNextWordToSpellcheck): reverted change to if-block.
The ERT inset now returns string().
2001-09-21 Angus Leeming <a.leeming@ic.ac.uk>
* lyxtext.h, text.C (selectNextWord): renamed as

View File

@ -1,3 +1,8 @@
2001-09-24 Angus Leeming <a.leeming@ic.ac.uk>
* insetert.[Ch] (selectNextWordToSpellcheck): new method.
Returns string(), so nothing in an ERT inset is spellchecked.
2001-09-21 Angus Leeming <a.leeming@ic.ac.uk>
* various files (selectNextWord): renamed as

View File

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

View File

@ -582,3 +582,10 @@ void InsetERT::close(BufferView * bv) const
return;
status(bv, Collapsed);
}
string const InsetERT::selectNextWordToSpellcheck(BufferView * bv,float &) const
{
bv->unlockInset(const_cast<InsetERT *>(this));
return string();
}

View File

@ -97,6 +97,8 @@ public:
///
void close(BufferView *) const;
///
string const selectNextWordToSpellcheck(BufferView *, float &) const;
///
bool inlined() const { return status_ == Inlined; }
///
int ascent(BufferView *, LyXFont const &) const;

View File

@ -2306,9 +2306,7 @@ string const LyXText::selectNextWordToSpellcheck(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())->lyxCode() !=
Inset::ERT_CODE)))
!cursor.par()->getInset(cursor.pos())->isTextInset()))
|| (cursor.par()->size() == cursor.pos()
&& cursor.par()->next()))
{