Commit 8a95a871 authored by Sergey Luzyanin's avatar Sergey Luzyanin

bugs in builder

parent 7343e7a5
......@@ -339,7 +339,7 @@
* @returns {ApiShape}
* */
ApiWorksheet.prototype.AddShape = function(sType, nWidth, nHeight, oFill, oStroke, nFromCol, nColOffset, nFromRow, nRowOffset){
var oShape = AscFormat.builder_CreateShape(sType, nWidth/36000, nHeight/36000, oFill.UniFill, oStroke.Ln, null, this.worksheet.theme, this.worksheet.DrawingDocument, false);
var oShape = AscFormat.builder_CreateShape(sType, nWidth/36000, nHeight/36000, oFill.UniFill, oStroke.Ln, null, this.worksheet.workbook.theme, this.worksheet.DrawingDocument, false);
private_SetCoords(oShape, this.worksheet, nWidth, nHeight, nFromCol, nColOffset, nFromRow, nRowOffset);
return new ApiShape(oShape);
};
......
......@@ -11991,7 +11991,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
function builder_CreateShape(sType, nWidth, nHeight, oFill, oStroke, oParent, oTheme, oDrawingDocument, bWord){
var oShapeTrack = new AscFormat.NewShapeTrack(sType, 0, 0, oTheme, null, null, null, 0);
oShapeTrack.track({}, nWidth, nHeight);
var oShape = oShapeTrack.getShape(true, oDrawingDocument, null);
var oShape = oShapeTrack.getShape(bWord === true, oDrawingDocument, null);
oShape.setParent(oParent);
if(bWord){
oShape.createTextBoxContent();
......
......@@ -294,7 +294,17 @@
*/
Api.prototype.CreateParagraph = function()
{
return this.private_CreateApiParagraph(new Paragraph(private_GetDrawingDocument(), null));
var oDrawingDocument = null;
if(this.GetActiveSheet){
var oWorksheet = this.GetActiveSheet();
if(oWorksheet){
oDrawingDocument = oWorksheet.DrawingDocument;
}
}
else{
oDrawingDocument = private_GetDrawingDocument();
}
return this.private_CreateApiParagraph(new Paragraph(oDrawingDocument, null));
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment