Merge pull request #279 from filippomuscolino/settings-fix
Fix: settings are ignored by Word without relationship and content type
This commit is contained in:
@ -79,6 +79,26 @@ describe("ContentTypes", () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
expect(tree["Types"][13]).to.deep.equal({
|
||||||
|
Override: [
|
||||||
|
{
|
||||||
|
_attr: {
|
||||||
|
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",
|
||||||
|
PartName: "/word/footnotes.xml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
expect(tree["Types"][14]).to.deep.equal({
|
||||||
|
Override: [
|
||||||
|
{
|
||||||
|
_attr: {
|
||||||
|
ContentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",
|
||||||
|
PartName: "/word/settings.xml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -88,7 +108,7 @@ describe("ContentTypes", () => {
|
|||||||
contentTypes.addFooter(102);
|
contentTypes.addFooter(102);
|
||||||
const tree = new Formatter().format(contentTypes);
|
const tree = new Formatter().format(contentTypes);
|
||||||
|
|
||||||
expect(tree["Types"][14]).to.deep.equal({
|
expect(tree["Types"][15]).to.deep.equal({
|
||||||
Override: [
|
Override: [
|
||||||
{
|
{
|
||||||
_attr: {
|
_attr: {
|
||||||
@ -99,7 +119,7 @@ describe("ContentTypes", () => {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree["Types"][15]).to.deep.equal({
|
expect(tree["Types"][16]).to.deep.equal({
|
||||||
Override: [
|
Override: [
|
||||||
{
|
{
|
||||||
_attr: {
|
_attr: {
|
||||||
@ -118,7 +138,7 @@ describe("ContentTypes", () => {
|
|||||||
contentTypes.addHeader(202);
|
contentTypes.addHeader(202);
|
||||||
const tree = new Formatter().format(contentTypes);
|
const tree = new Formatter().format(contentTypes);
|
||||||
|
|
||||||
expect(tree["Types"][14]).to.deep.equal({
|
expect(tree["Types"][15]).to.deep.equal({
|
||||||
Override: [
|
Override: [
|
||||||
{
|
{
|
||||||
_attr: {
|
_attr: {
|
||||||
@ -129,7 +149,7 @@ describe("ContentTypes", () => {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree["Types"][15]).to.deep.equal({
|
expect(tree["Types"][16]).to.deep.equal({
|
||||||
Override: [
|
Override: [
|
||||||
{
|
{
|
||||||
_attr: {
|
_attr: {
|
||||||
|
@ -30,6 +30,7 @@ export class ContentTypes extends XmlComponent {
|
|||||||
this.root.push(new Override("application/vnd.openxmlformats-officedocument.extended-properties+xml", "/docProps/app.xml"));
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.extended-properties+xml", "/docProps/app.xml"));
|
||||||
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", "/word/numbering.xml"));
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", "/word/numbering.xml"));
|
||||||
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", "/word/footnotes.xml"));
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", "/word/footnotes.xml"));
|
||||||
|
this.root.push(new Override("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", "/word/settings.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public addFooter(index: number): void {
|
public addFooter(index: number): void {
|
||||||
|
@ -324,6 +324,11 @@ export class File {
|
|||||||
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",
|
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",
|
||||||
"footnotes.xml",
|
"footnotes.xml",
|
||||||
);
|
);
|
||||||
|
this.docRelationships.createRelationship(
|
||||||
|
this.currentRelationshipId++,
|
||||||
|
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",
|
||||||
|
"settings.xml",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private groupHeaders(headers: IDocumentHeader[], group: IHeaderFooterGroup<HeaderWrapper> = {}): IHeaderFooterGroup<HeaderWrapper> {
|
private groupHeaders(headers: IDocumentHeader[], group: IHeaderFooterGroup<HeaderWrapper> = {}): IHeaderFooterGroup<HeaderWrapper> {
|
||||||
|
Reference in New Issue
Block a user