mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
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:
parent
a10b503e59
commit
a2ef5d11b3
@ -339,7 +339,7 @@ string const BufferView::nextWord(float & value)
|
||||
return string();
|
||||
}
|
||||
|
||||
return text->selectNextWord(this, value);
|
||||
return text->selectNextWordToSpellcheck(this, value);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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!
|
||||
|
@ -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; }
|
||||
///
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
///
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
///
|
||||
|
@ -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 *);
|
||||
///
|
||||
|
14
src/text.C
14
src/text.C
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user