Commit bbf56004 authored by Sergey Konovalov's avatar Sergey Konovalov

add ObjectFile(ole object name in OOX) field to COleObject

parent a4a863f7
......@@ -56,6 +56,7 @@ function (window, undefined) {
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetData] = AscDFH.CChangesDrawingsString;
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetApplicationId] = AscDFH.CChangesDrawingsString;
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetPixSizes] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetObjectFile] = AscDFH.CChangesDrawingsString;
AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetData] = function(oClass, value){oClass.m_sData = value;};
......@@ -67,6 +68,7 @@ function (window, undefined) {
}
};
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ImageShapeSetPixSizes] = COleSize;
AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetObjectFile] = function(oClass, value){oClass.m_sObjectFile = value;};
function COleObject()
{
......@@ -77,6 +79,7 @@ function (window, undefined) {
this.m_nPixHeight = null;
this.m_fDefaultSizeX = null;
this.m_fDefaultSizeY = null;
this.m_sObjectFile = null;//ole object name in OOX
}
COleObject.prototype = Object.create(AscFormat.CImageShape.prototype);
......@@ -102,6 +105,11 @@ function (window, undefined) {
this.m_nPixWidth = nPixWidth;
this.m_nPixHeight = nPixHeight;
};
COleObject.prototype.setObjectFile = function(sObjectFile)
{
AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this, AscDFH.historyitem_ImageShapeSetObjectFile, this.m_sObjectFile, sObjectFile));
this.m_sObjectFile = sObjectFile;
};
COleObject.prototype.canRotate = function () {
return false;
......@@ -135,6 +143,7 @@ function (window, undefined) {
copy.setData(this.m_sData);
copy.setApplicationId(this.m_sApplicationId);
copy.setPixSizes(this.m_nPixWidth, this.m_nPixHeight);
copy.setObjectFile(this.m_sObjectFile);
copy.cachedImage = this.getBase64Img();
copy.cachedPixH = this.cachedPixH;
copy.cachedPixW = this.cachedPixW;
......
......@@ -2329,6 +2329,7 @@
window['AscDFH'].historyitem_ImageShapeSetData = window['AscDFH'].historyitem_type_ImageShape | 7;
window['AscDFH'].historyitem_ImageShapeSetApplicationId = window['AscDFH'].historyitem_type_ImageShape | 8;
window['AscDFH'].historyitem_ImageShapeSetPixSizes = window['AscDFH'].historyitem_type_ImageShape | 9;
window['AscDFH'].historyitem_ImageShapeSetObjectFile = window['AscDFH'].historyitem_type_ImageShape | 10;
window['AscDFH'].historyitem_GeometrySetParent = window['AscDFH'].historyitem_type_Geometry | 1;
window['AscDFH'].historyitem_GeometryAddAdj = window['AscDFH'].historyitem_type_Geometry | 2;
......
......@@ -4504,7 +4504,7 @@ function BinaryPPTYLoader()
}
case 7:
{
s.GetString2();
ole.setObjectFile(s.GetString2());
break;
}
default:
......@@ -9293,7 +9293,7 @@ function CPres()
}
case 7:
{
var sFileName = s.GetString2();
ole.setObjectFile(s.GetString2());
break;
}
default:
......
......@@ -2989,6 +2989,7 @@ function CBinaryFileWriter()
oThis._WriteInt2(3, ratio * ole.m_nPixHeight);
oThis._WriteUChar2(4, 0);
oThis._WriteUChar2(5, 0);
oThis._WriteString2(7, ole.m_sObjectFile);
oThis.WriteUChar(g_nodeAttributeEnd);
}
this.WriteTable = function(grObj)
......@@ -4792,6 +4793,7 @@ function CBinaryFileWriter()
_writer._WriteInt2(3, ratio * ole.m_nPixHeight);
_writer._WriteUChar2(4, 0);
_writer._WriteUChar2(5, 0);
_writer._WriteString2(7, ole.m_sObjectFile);
_writer.WriteUChar(g_nodeAttributeEnd);
}
......
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