Commit cba9dab5 authored by SergeyLuzyanin's avatar SergeyLuzyanin

additional params for signatureLine

parent 9cdbde6c
......@@ -10738,7 +10738,7 @@ function ApplyPresetToChartSpace(oChartSpace, aPreset, bCreate){
}
function fCreateSignatureShape(sGuid, sSigner, sSigner2, sEmail, bWord, wsModel){
function fCreateSignatureShape(sGuid, sSigner, sSigner2, sEmail, bWord, wsModel, Width, Height, sImgUrl){
var oShape = new AscFormat.CShape();
oShape.setWordShape(bWord === true);
oShape.setBDeleted(false);
......@@ -10748,8 +10748,18 @@ function ApplyPresetToChartSpace(oChartSpace, aPreset, bCreate){
var oXfrm = new AscFormat.CXfrm();
oXfrm.setOffX(0);
oXfrm.setOffY(0);
oXfrm.setExtX(1828800/36000);
oXfrm.setExtY(1828800/36000);
if(AscFormat.isRealNumber(Width) && AscFormat.isRealNumber(Height)){
oXfrm.setExtX(1828800/36000);
oXfrm.setExtY(1828800/36000);
}
else{
oXfrm.setExtX(Width);
oXfrm.setExtY(Height);
}
if(typeof sImgUrl === "string" && sImgUrl.length > 0){
var oBlipFillUnifill = AscFormat.CreateBlipFillUniFillFromUrl(sImgUrl);
oSpPr.setFill(oBlipFillUnifill);
}
oSpPr.setXfrm(oXfrm);
oXfrm.setParent(oSpPr);
oSpPr.setFill(AscFormat.CreateNoFillUniFill());
......
......@@ -2531,12 +2531,6 @@ CShape.prototype.recalculateTextStyles = function (level) {
};
CShape.prototype.recalculateBrush = function () {
if(this.signatureLine){
this.brush = AscFormat.CreateBlipFillUniFillFromUrl("");
return;
}
var compiled_style = this.getCompiledStyle();
var RGBA = {R: 0, G: 0, B: 0, A: 255};
var parents = this.getParentObjects();
......@@ -4084,13 +4078,7 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
return;
}
if(this.signatureLine){
var sSignatureUrl = "";
if(typeof editor !== "undefined" && editor){
sSignatureUrl = editor.asc_getSignatureImage(this.signatureLine.id);
}
this.brush = AscFormat.CreateBlipFillUniFillFromUrl(sSignatureUrl);
}
var _transform = transform ? transform : this.transform;
var _transform_text = transformText ? transformText : this.transformText;
if (graphics.IsSlideBoundsCheckerType === true) {
......@@ -4132,6 +4120,17 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
return;
}
var _oldBrush = this.brush;
if(this.signatureLine){
var sSignatureUrl = null;
if(typeof editor !== "undefined" && editor){
sSignatureUrl = editor.asc_getSignatureImage(this.signatureLine.id);
}
if(typeof sSignatureUrl === "string" && sSignatureUrl.length > 0){
this.brush = AscFormat.CreateBlipFillUniFillFromUrl(sSignatureUrl);
}
}
if (this.spPr && this.spPr.geometry || this.style || (this.brush && this.brush.fill) || (this.pen && this.pen.Fill && this.pen.Fill.fill)) {
graphics.SetIntegerGrid(false);
graphics.transform3(_transform, false);
......@@ -4208,7 +4207,7 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
graphics.SetIntegerGrid(true);
}
}
this.brush = _oldBrush;
var oController = this.getDrawingObjectsController && this.getDrawingObjectsController();
if(!this.txWarpStruct && !this.txWarpStructParamarksNoTransform || (!this.txWarpStructParamarksNoTransform && oController && (AscFormat.getTargetTextObject(oController) === this) || (!this.txBody && !this.textBoxContent)) /*|| this.haveSelectedDrawingInContent()*/)
{
......
......@@ -1257,7 +1257,7 @@
{
};
baseEditorsApi.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail) {
baseEditorsApi.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail, Width, Height, sImgUrl) {
};
baseEditorsApi.prototype.asc_getAllSignatures = function () {
......
......@@ -3502,12 +3502,12 @@ background-repeat: no-repeat;\
};
// signatures
asc_docs_api.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail) {
asc_docs_api.prototype.asc_addSignatureLine = function (sGuid, sSigner, sSigner2, sEmail, Width, Height, sImgUrl) {
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Document_Content_Add))
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_InsertSignatureLine);
var oSignature = AscFormat.fCreateSignatureShape(sGuid, sSigner, sSigner2, sEmail, true, null);
var oSignature = AscFormat.fCreateSignatureShape(sGuid, sSigner, sSigner2, sEmail, true, null, Width, Height, sImgUrl);
var Drawing = new AscCommonWord.ParaDrawing(oSignature.spPr.xfrm.extX, oSignature.spPr.xfrm.extY, null, this.WordControl.m_oDrawingDocument, null, null);
oSignature.setParent(Drawing);
Drawing.Set_GraphicObject(oSignature);
......
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