mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
Fix bug #6217: Replacing a word in spellcheck does not update toolbar
Use the dispatch machinery when replacing a word in the spellchecker. Note that this implies a slight hack with lyxrc.auto_region_delete setting. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33445 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d1f2c9570b
commit
09ef9c67ef
@ -204,13 +204,16 @@ void GuiSpellchecker::on_replacePB_clicked()
|
||||
docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
|
||||
|
||||
LYXERR(Debug::GUI, "Replace (" << replacement << ")");
|
||||
BufferView * bv = const_cast<BufferView *>(bufferview());
|
||||
if (!bv->cursor().inTexted())
|
||||
return;
|
||||
cap::replaceSelectionWithString(bv->cursor(), replacement, true);
|
||||
bv->buffer().markDirty();
|
||||
// If we used an LFUN, we would not need that
|
||||
bv->processUpdateFlags(Update::Force | Update::FitCursor);
|
||||
/*
|
||||
Slight hack ahead: we want to use the dispatch machinery
|
||||
(see bug #6217), but self-insert honors the ``auto region
|
||||
delete'' setting, which is not wanted here. Creating a new
|
||||
ad-hoc LFUN seems overkill, but it could be an option (JMarc).
|
||||
*/
|
||||
bool const ard = lyxrc.auto_region_delete;
|
||||
lyxrc.auto_region_delete = true;
|
||||
dispatch(FuncRequest(LFUN_SELF_INSERT, replacement));
|
||||
lyxrc.auto_region_delete = ard;
|
||||
// fix up the count
|
||||
--d->count_;
|
||||
check();
|
||||
|
Loading…
Reference in New Issue
Block a user