Remove creator field from empty templates

This commit is contained in:
yflory 2025-10-03 14:39:41 +02:00
parent 058df1ed5c
commit 9309b06a2e

View File

@ -352,12 +352,23 @@ define([
cpIndex: 0
};
const fixProps = (title) => {
try {
const props = getEditor().asc_getCoreProps();
if (!props) { return; }
props.title = title;
if (!content.hashes || !content.hashes.length) {
// No CP: document is using our templates
// --> fix the "creator" field
props.creator = "";
}
getEditor().asc_setCoreProps(props);
} catch () {}
};
var getContent = function (title) {
try {
getEditor().asc_setCoreProps({
...getEditor().asc_getCoreProps(),
'title': title,
});
// Update document metadata with latest title
fixProps(title);
return getEditor().asc_nativeGetFile();
} catch (e) {
console.error(e);