Restore cursor after checkpoint in OO doc

This commit is contained in:
yflory 2021-10-26 15:29:23 +02:00
parent a9890f0c7b
commit 6541317f62

View file

@ -506,6 +506,19 @@ define([
}
myUniqueOOId = undefined;
setMyId();
var editor = getEditor();
if (editor) {
var app = common.getMetadataMgr().getPrivateData().ooType;
var d;
if (app === 'doc') {
d = editor.GetDocument().Document;
} else if (app === 'presentation') {
d = editor.GetPresentation().Presentation;
}
if (d) {
APP.oldCursor = d.GetSelectionState();
}
}
if (APP.docEditor) { APP.docEditor.destroyEditor(); } // Kill the old editor
$('iframe[name="frameEditor"]').after(h('div#cp-app-oo-placeholder-a')).remove();
ooLoaded = false;
@ -1713,6 +1726,21 @@ define([
var l = w.Common.util.LanguageInfo.getLocalLanguageCode(lang);
getEditor().asc_setDefaultLanguage(l);
}
if (APP.oldCursor) {
var app = common.getMetadataMgr().getPrivateData().ooType;
var d;
if (app === 'doc') {
d = getEditor().GetDocument().Document;
} else if (app === 'presentation') {
d = getEditor().GetPresentation().Presentation;
}
if (d) {
d.SetSelectionState(APP.oldCursor);
d.UpdateSelection();
}
delete APP.oldCursor;
}
}
delete APP.startNew;