Commit 2b5bbc90 authored by Sergey Luzyanin's avatar Sergey Luzyanin

вынес изменение ватермарка в TableId

parent 25e3763d
...@@ -2889,18 +2889,6 @@ Workbook.prototype.DeserializeHistory = function(aChanges, fCallback){ ...@@ -2889,18 +2889,6 @@ Workbook.prototype.DeserializeHistory = function(aChanges, fCallback){
for (var k = 0, length3 = item.oData.elem.length; k < length3; ++k) for (var k = 0, length3 = item.oData.elem.length; k < length3; ++k)
oFontMap[item.oData.elem[k]] = 1; oFontMap[item.oData.elem[k]] = 1;
} }
if(g_oUndoRedoWorkbook == item.oClass && historyitem_Common_AddWatermark == item.nActionType)
{
var oWsModel = window["Asc"]["editor"].wbModel.aWorksheets[0];
if(oWsModel)
{
var objectRender = new DrawingObjects();
var oNewDrawing = objectRender.createDrawingObject(c_oAscCellAnchorType.cellanchorAbsolute);
var oImage = DrawingObjectsController.prototype.createWatermarkImage();
oNewDrawing.graphicObject = oImage;
oWsModel.Drawings.push(oNewDrawing);
}
}
aUndoRedoElems.push(item); aUndoRedoElems.push(item);
} }
......
...@@ -2088,6 +2088,12 @@ CTableId.prototype.Save_Changes = function(Data, Writer) ...@@ -2088,6 +2088,12 @@ CTableId.prototype.Save_Changes = function(Data, Writer)
break; break;
} }
case historyitem_Common_AddWatermark:
{
Writer.WriteString2("AVSUnregisteredVersion.emf");
break;
}
} }
}; };
CTableId.prototype.Save_Changes2 = function(Data, Writer) CTableId.prototype.Save_Changes2 = function(Data, Writer)
...@@ -2108,6 +2114,47 @@ CTableId.prototype.Load_Changes = function(Reader, Reader2) ...@@ -2108,6 +2114,47 @@ CTableId.prototype.Load_Changes = function(Reader, Reader2)
switch ( Type ) switch ( Type )
{ {
case historyitem_Common_AddWatermark:
{
var sUrl = Reader.GetString2();
if('undefined' != typeof editor && editor.WordControl && editor.WordControl.m_oLogicDocument)
{
var oLogicDocument = editor.WordControl.m_oLogicDocument;
if(oLogicDocument instanceof CDocument)
{
var oParaDrawing = oLogicDocument.DrawingObjects.getTrialImage(sUrl);
var oFirstParagraph = oLogicDocument.Get_FirstParagraph();
ExecuteNoHistory(function(){
var oRun = new CRun();
oRun.Content.splice(0, oParaDrawing);
oFirstParagraph.Content.splice(0, oRun);
}, this, []);
}
else if(oLogicDocument instanceof CPresentation)
{
if(oLogicDocument.Slides[0])
{
var oDrawing = oLogicDocument.Slides[0].graphicObjects.createWatermarkImage(sUrl);
oDrawing.spPr.xfrm.offX = (oLogicDocument.Width - oDrawing.spPr.extX)/2;
oDrawing.spPr.xfrm.offY = (oLogicDocument.Height - oDrawing.spPr.extY)/2;
oLogicDocument.Slides[0].cSld.spTree.push(oDrawing);
}
}
}
else
{
var oWsModel = window["Asc"]["editor"].wbModel.aWorksheets[0];
if(oWsModel)
{
var objectRender = new DrawingObjects();
var oNewDrawing = objectRender.createDrawingObject(c_oAscCellAnchorType.cellanchorAbsolute);
var oImage = DrawingObjectsController.prototype.createWatermarkImage();
oNewDrawing.graphicObject = oImage;
oWsModel.Drawings.push(oNewDrawing);
}
}
break;
}
case historyitem_TableId_Add: case historyitem_TableId_Add:
{ {
// String : Id элемента // String : Id элемента
......
...@@ -4705,18 +4705,6 @@ CPresentation.prototype = ...@@ -4705,18 +4705,6 @@ CPresentation.prototype =
switch ( Type ) switch ( Type )
{ {
case historyitem_Common_AddWatermark:
{
if(this.Slides[0])
{
var sUrl = Reader.GetString2();
var oDrawing = this.Slides[0].graphicObjects.createWatermarkImage(sUrl);
oDrawing.spPr.xfrm.offX = (this.Width - oDrawing.spPr.extX)/2;
oDrawing.spPr.xfrm.offY = (this.Height - oDrawing.spPr.extY)/2;
this.Slides[0].cSld.spTree.push(oDrawing);
}
break;
}
case historyitem_Presentation_SetShowPr: case historyitem_Presentation_SetShowPr:
{ {
if(Reader.GetBool()){ if(Reader.GetBool()){
......
...@@ -14014,13 +14014,6 @@ CDocument.prototype = ...@@ -14014,13 +14014,6 @@ CDocument.prototype =
switch ( Type ) switch ( Type )
{ {
case historyitem_Common_AddWatermark:
{
var sUrl = Reader.GetString2();
var oParaDrawing = this.DrawingObjects.getTrialImage(sUrl);
break;
}
case historyitem_Document_AddItem: case historyitem_Document_AddItem:
{ {
// Long : Количество элементов // Long : Количество элементов
......
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