mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
#7740 Add undo for change of text language with LFUN_BUFFER_LANGUAGE
When a document is not multi-lingual the text contents is changed to the new language. This should be recorded for Undo. Because Undo wants a cursor the implemantation has to be moved to the BufferView class. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39594 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ee8f64e112
commit
fd2a6bb3da
@ -2212,18 +2212,6 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_BUFFER_LANGUAGE: {
|
||||
Language const * oldL = params().language;
|
||||
Language const * newL = languages.getLanguage(argument);
|
||||
if (!newL || oldL == newL)
|
||||
break;
|
||||
if (oldL->rightToLeft() == newL->rightToLeft() && !isMultiLingual()) {
|
||||
changeLanguage(oldL, newL);
|
||||
dr.forceBufferUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
dispatched = false;
|
||||
break;
|
||||
|
@ -1884,6 +1884,19 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_BUFFER_LANGUAGE: {
|
||||
Language const * oldL = buffer_.params().language;
|
||||
Language const * newL = languages.getLanguage(argument);
|
||||
if (!newL || oldL == newL)
|
||||
break;
|
||||
if (oldL->rightToLeft() == newL->rightToLeft() && !buffer_.isMultiLingual()) {
|
||||
cur.recordUndoFullDocument();
|
||||
buffer_.changeLanguage(oldL, newL);
|
||||
dr.forceBufferUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
// OK, so try the Buffer itself...
|
||||
buffer_.dispatch(cmd, dr);
|
||||
|
@ -49,6 +49,9 @@ What's new
|
||||
|
||||
- Group correctly Koma Book environments inside environment combo-box listing.
|
||||
|
||||
- Add undo for change of text language when document language is changed.
|
||||
When a document is not multi-lingual the text contents is changed to the
|
||||
new language. This should be recorded for Undo (bug 7740).
|
||||
|
||||
* ADVANCED FIND AND REPLACE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user