Revert returning Paragraph

This commit is contained in:
Dolan
2018-08-02 02:32:57 +01:00
parent 3fcfc29e3f
commit f7c02f4679
2 changed files with 5 additions and 5 deletions

View File

@ -61,14 +61,14 @@ export class Document extends XmlComponent {
this.body.push(pictureParagraph);
}
public createDrawing(imageData: IMediaData): Paragraph {
public createDrawing(imageData: IMediaData): PictureRun {
const paragraph = new Paragraph();
const run = new PictureRun(imageData);
paragraph.addRun(run);
this.addDrawing(paragraph);
return paragraph;
return run;
}
get Body(): Body {

View File

@ -10,7 +10,7 @@ import { FootNotes } from "./footnotes";
import { HeaderWrapper } from "./header-wrapper";
import { Media } from "./media";
import { Numbering } from "./numbering";
import { Bookmark, Hyperlink, Paragraph } from "./paragraph";
import { Bookmark, Hyperlink, Paragraph, PictureRun } from "./paragraph";
import { Relationships } from "./relationships";
import { Styles } from "./styles";
import { ExternalStylesFactory } from "./styles/external-styles-factory";
@ -125,7 +125,7 @@ export class File {
return this.document.createTable(rows, cols);
}
public createImage(filePath: string): Paragraph {
public createImage(filePath: string): PictureRun {
const mediaData = Media.addImage(this, filePath);
return this.document.createDrawing(mediaData);
}
@ -135,7 +135,7 @@ export class File {
return this;
}
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): Paragraph {
public createImageFromBuffer(buffer: Buffer, width?: number, height?: number): PictureRun {
const mediaData = Media.addImageFromBuffer(this, buffer, width, height);
return this.document.createDrawing(mediaData);
}