Display on/off quirks
Dear experts
(FM-13.0.5.547) I have discovered a strange behaviour:
In the following order the location is not restored after the actions. It seems that SetDisplay destroys it:
SetDisplay (false);
savedTR = goCurrentDoc.TextSelection;
// Do a lot of things (loop) on various places in the document
RestoreTR (goCurrentDoc, savedTR);
SetDisplay (true);
In the following order things work as expected. Cursor location is restored.
savedTR = goCurrentDoc.TextSelection;
SetDisplay (false);
// Do a lot of things (loop) on various places in the document
SetDisplay (true);
RestoreTR (goCurrentDoc, savedTR);
The two functions are
function RestoreTR (oTargetDoc, oSavedTR) {
// actions may have left us on a reference page
var bodyPage = oTargetDoc.FirstBodyPageInDoc;
oTargetDoc.CurrentPage = bodyPage;
oTargetDoc.TextSelection = oSavedTR;
oTargetDoc.ScrollToText(oSavedTR);
} //--- end RestoreTRfunction SetDisplay (bWanted) {
if (bWanted) { // switch ON
if (app.Displaying === 0) {
app.Displaying = 1;
}
} else { // switch OFF
if (app.Displaying === 1) {
app.Displaying = 0;
}
}
} //--- end SetDisplay
What may be the cause of this?

