Commit 6f0aff3d authored by SergeyLuzyanin's avatar SergeyLuzyanin

asc_addSignatureLine, asc_getAllSignatures

parent d52c1646
......@@ -171,18 +171,31 @@
}
else{
if(_end.bounds.t > _begin.bounds.b){
sPreset = "4";
flipH = true;
oMapAdj["adj1"] = -((100000*(_begin.bounds.r + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0);
oMapAdj["adj2"] = (100000*((_end.bounds.t + _begin.bounds.b)/2.0 - _begin.y)/extY) >> 0;
if(_end.x < _begin.x){
sPreset = "4";
flipH = true;
oMapAdj["adj1"] = -((100000*(_begin.bounds.r + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0);
oMapAdj["adj2"] = (100000*((_end.bounds.t + _begin.bounds.b)/2.0 - _begin.y)/extY) >> 0;
}
else{
sPreset = "2";
}
}
else if(_end.bounds.b < _begin.bounds.t){
sPreset = "4";
flipH = true;
flipV = true;
oMapAdj["adj1"] = -((100000*(_begin.bounds.r + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0);
oMapAdj["adj2"] = (100000*(_begin.y - (_end.bounds.t - CONNECTOR_MARGIN))/extY + 0.5) >> 0;
if(_end.x < _begin.x){
sPreset = "4";
flipH = true;
flipV = true;
oMapAdj["adj1"] = -((100000*(_begin.bounds.r + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0);
oMapAdj["adj2"] = (100000*(_begin.y - (_end.bounds.t - CONNECTOR_MARGIN))/extY + 0.5) >> 0;
}
else{
sPreset = "4";
flipV = true;
oMapAdj["adj1"] = (100000*(Math.max(_begin.bounds.r, _end.bounds.r) + CONNECTOR_MARGIN - _begin.x)/extX) >> 0;
oMapAdj["adj2"] = (100000*(_begin.y - (_end.bounds.t - CONNECTOR_MARGIN))/extY + 0.5) >> 0;
}
}
else{
......@@ -202,18 +215,18 @@
}
}
else{
if(_end.x > _begin.x){
sPreset = "2";
}
else{
sPreset = "4";
flipH = true;
oMapAdj["adj1"] = -(100000*(Math.max(_begin.bounds.r, _end.bounds.r) + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0;
oMapAdj["adj2"] = -((100000*(_begin.y - (Math.min(_begin.bounds.t, _end.bounds.t) - CONNECTOR_MARGIN))/extY + 0.5) >> 0);
}
}
//if(_end.x < _begin.x){
// sPreset = "4";
// flipH = true;
// oMapAdj["adj1"] = -(100000*(Math.max(_end.bounds.r, _begin.bounds.r) + CONNECTOR_MARGIN - _begin.x)/extX + 0.5) >> 0;
// oMapAdj["adj2"] = (100000*(((_begin.bounds.b + _end.bounds.t)/2 - _begin.y)/extY) + 0.5) >> 0;
//}
//else{
// sPreset = "2";
//}
}
}
}
break;
......
......@@ -15235,6 +15235,11 @@ CDocument.prototype.GetContentControl = function(Id)
return this.TableId.Get_ById(Id);
};
CDocument.prototype.GetAllSignatures = function()
{
return this.DrawingObjects.getAllSignatures();
};
function CDocumentSelectionState()
{
this.Id = null;
......
......@@ -1420,6 +1420,34 @@ CGraphicObjects.prototype =
}
},
getDrawingArray: function()
{
var ret = [];
for(var i = 0; i < this.drawingObjects.length; ++i) {
if(this.drawingObjects[i] && this.drawingObjects[i].GraphicObj && !this.drawingObjects[i].GraphicObj.bDeleted){
ret.push(this.drawingObjects[i].GraphicObj);
}
}
return ret;
},
getAllSignatures: function(){
var _ret = [];
this.getAllSignatures2(_ret, this.getDrawingArray());
return _ret;
},
getAllSignatures2: function(aRet, spTree){
for(var i = 0; i < spTree.length; ++i){
if(spTree[i].getObjectType() === AscDFH.historyitem_type_GroupShape){
this.getAllSignatures2(aRet, spTree[i].spTree);
}
else if(spTree[i].signatureLine){
aRet.push(spTree[i].signatureLine);
}
}
},
addOleObject: function(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId)
{
var content = this.getTargetDocContent();
......@@ -2952,6 +2980,9 @@ CGraphicObjects.prototype =
for(var i = 0; i < this.selectedObjects.length; ++i)
{
this.selectedObjects[i].parent.Remove_FromDocument(false);
if(this.selectedObjects[i].signatureLine){
this.document.Api.sendEvent("asc_onAddSignature", this.selectedObjects[i].signatureLine.id);
}
arr_drawings_.push(this.selectedObjects[i].parent);
}
this.resetSelection();
......
......@@ -3511,9 +3511,14 @@ background-repeat: no-repeat;\
oSignature.setParent(Drawing);
Drawing.Set_GraphicObject(oSignature);
this.WordControl.m_oLogicDocument.AddSignatureLine(Drawing);
this.sendEvent("asc_onAddSignature", sGuid);
}
};
asc_docs_api.prototype.asc_getAllSignatures = function(){
return this.WordControl.m_oLogicDocument.GetAllSignatures();
};
asc_docs_api.prototype.IncreaseIndent = function()
{
this.WordControl.m_oLogicDocument.IncreaseIndent();
......@@ -8234,6 +8239,10 @@ background-repeat: no-repeat;\
asc_docs_api.prototype["asc_Remove"] = asc_docs_api.prototype.asc_Remove;
asc_docs_api.prototype["asc_OnHideContextMenu"] = asc_docs_api.prototype.asc_OnHideContextMenu;
asc_docs_api.prototype["asc_OnShowContextMenu"] = asc_docs_api.prototype.asc_OnShowContextMenu;
asc_docs_api.prototype["asc_addSignatureLine"] = asc_docs_api.prototype.asc_addSignatureLine;
asc_docs_api.prototype["asc_getAllSignatures"] = asc_docs_api.prototype.asc_getAllSignatures;
CDocInfoProp.prototype['get_PageCount'] = CDocInfoProp.prototype.get_PageCount;
CDocInfoProp.prototype['put_PageCount'] = CDocInfoProp.prototype.put_PageCount;
......
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