Fix bug #50640
Fix bug #50640

Fix the problem with calculating header/footer after calculating the number of document pages in native editors

ONLYOFFICE/sdkjs,ONLYOFFICE/sdkjs,ONLYOFFICE/sdkjs,ONLYOFFICE/sdkjs,ONLYOFFICE/sdkjs