Restore cursor after checkpoint in OO doc

pull/1/head
yflory 3 years ago
parent a9890f0c7b
commit 6541317f62

@ -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;

Loading…
Cancel
Save