Commit 93fdcd09 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/Drawings/Format/Image to function-closure

parent 14505fe7
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"../common/Drawings/Format/Format.js", "../common/Drawings/Format/Format.js",
"../common/Drawings/Format/Shape.js", "../common/Drawings/Format/Shape.js",
"../common/Drawings/Format/Path.js", "../common/Drawings/Format/Path.js",
"../common/Drawings/Format/Image.js",
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -95,7 +96,6 @@ ...@@ -95,7 +96,6 @@
"../common/Drawings/TrackObjects/MoveTracks.js", "../common/Drawings/TrackObjects/MoveTracks.js",
"../common/Drawings/CommonController.js", "../common/Drawings/CommonController.js",
"../common/Drawings/Format/GroupShape.js", "../common/Drawings/Format/GroupShape.js",
"../common/Drawings/Format/Image.js",
"../common/Drawings/Format/ChartSpace.js", "../common/Drawings/Format/ChartSpace.js",
"../common/Drawings/Format/ChartFormat.js", "../common/Drawings/Format/ChartFormat.js",
"../common/Drawings/Format/TextBody.js", "../common/Drawings/Format/TextBody.js",
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"../common/Drawings/Format/Format.js", "../common/Drawings/Format/Format.js",
"../common/Drawings/Format/Shape.js", "../common/Drawings/Format/Shape.js",
"../common/Drawings/Format/Path.js", "../common/Drawings/Format/Path.js",
"../common/Drawings/Format/Image.js",
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -82,7 +83,6 @@ ...@@ -82,7 +83,6 @@
"../common/Drawings/CommonController.js", "../common/Drawings/CommonController.js",
"../cell/view/DrawingObjectsController.js", "../cell/view/DrawingObjectsController.js",
"../slide/Editor/DrawingObjectsController.js", "../slide/Editor/DrawingObjectsController.js",
"../common/Drawings/Format/Image.js",
"../common/Drawings/Format/GroupShape.js", "../common/Drawings/Format/GroupShape.js",
"../common/Drawings/Format/ChartSpace.js", "../common/Drawings/Format/ChartSpace.js",
"../common/Drawings/Format/ChartFormat.js", "../common/Drawings/Format/ChartFormat.js",
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
"../common/Drawings/Format/Format.js", "../common/Drawings/Format/Format.js",
"../common/Drawings/Format/Shape.js", "../common/Drawings/Format/Shape.js",
"../common/Drawings/Format/Path.js", "../common/Drawings/Format/Path.js",
"../common/Drawings/Format/Image.js",
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -57,7 +58,6 @@ ...@@ -57,7 +58,6 @@
"../common/Drawings/DrawingObjectsHandlers.js", "../common/Drawings/DrawingObjectsHandlers.js",
"../common/Drawings/Hit.js", "../common/Drawings/Hit.js",
"../common/Drawings/Joined.js", "../common/Drawings/Joined.js",
"../common/Drawings/Format/Image.js",
"../common/Drawings/Format/GroupShape.js", "../common/Drawings/Format/GroupShape.js",
"../common/Drawings/Format/ChartSpace.js", "../common/Drawings/Format/ChartSpace.js",
"../common/Drawings/Format/ChartFormat.js", "../common/Drawings/Format/ChartFormat.js",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Import // Import
var CShape = AscFormat.CShape; var CShape = AscFormat.CShape;
var CImageShape = AscFormat.CImageShape;
CImageShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects; CImageShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects;
CImageShape.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects; CImageShape.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects;
......
...@@ -1777,7 +1777,7 @@ function DrawingObjects() { ...@@ -1777,7 +1777,7 @@ function DrawingObjects() {
if ( graphicObject && ctx ) { if ( graphicObject && ctx ) {
// Image // Image
if ( graphicObject instanceof CImageShape ) if ( graphicObject instanceof AscFormat.CImageShape )
printImage(graphicObject, ctx, top, left); printImage(graphicObject, ctx, top, left);
// Shape // Shape
else if ( graphicObject instanceof AscFormat.CShape ) else if ( graphicObject instanceof AscFormat.CShape )
...@@ -1793,7 +1793,7 @@ function DrawingObjects() { ...@@ -1793,7 +1793,7 @@ function DrawingObjects() {
// Print functions // Print functions
function printImage(graphicObject, ctx, top, left) { function printImage(graphicObject, ctx, top, left) {
if ( (graphicObject instanceof CImageShape) && graphicObject && ctx ) { if ( (graphicObject instanceof AscFormat.CImageShape) && graphicObject && ctx ) {
// Save // Save
var tx = graphicObject.transform.tx; var tx = graphicObject.transform.tx;
var ty = graphicObject.transform.ty; var ty = graphicObject.transform.ty;
...@@ -1872,7 +1872,7 @@ function DrawingObjects() { ...@@ -1872,7 +1872,7 @@ function DrawingObjects() {
for ( var i = 0; i < graphicObject.arrGraphicObjects.length; i++ ) { for ( var i = 0; i < graphicObject.arrGraphicObjects.length; i++ ) {
var graphicItem = graphicObject.arrGraphicObjects[i]; var graphicItem = graphicObject.arrGraphicObjects[i];
if ( graphicItem instanceof CImageShape ) if ( graphicItem instanceof AscFormat.CImageShape )
printImage(graphicItem, ctx, top, left); printImage(graphicItem, ctx, top, left);
else if ( graphicItem instanceof AscFormat.CShape ) else if ( graphicItem instanceof AscFormat.CShape )
......
...@@ -7011,7 +7011,7 @@ DrawingObjectsController.prototype = ...@@ -7011,7 +7011,7 @@ DrawingObjectsController.prototype =
createImage: function(rasterImageId, x, y, extX, extY) createImage: function(rasterImageId, x, y, extX, extY)
{ {
var image = new CImageShape(); var image = new AscFormat.CImageShape();
image.setSpPr(new AscFormat.CSpPr()); image.setSpPr(new AscFormat.CSpPr());
image.spPr.setParent(image); image.spPr.setParent(image);
image.spPr.setGeometry(AscFormat.CreateGeometry("rect")); image.spPr.setGeometry(AscFormat.CreateGeometry("rect"));
......
"use strict"; "use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
// Import // Import
var CShape = AscFormat.CShape; var CShape = AscFormat.CShape;
...@@ -1015,4 +1021,9 @@ CImageShape.prototype = ...@@ -1015,4 +1021,9 @@ CImageShape.prototype =
Load_LinkData: function(linkData) Load_LinkData: function(linkData)
{ {
} }
}; };
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].CImageShape = CImageShape;
})(window);
...@@ -5168,7 +5168,7 @@ function BinaryPPTYLoader() ...@@ -5168,7 +5168,7 @@ function BinaryPPTYLoader()
{ {
var s = this.stream; var s = this.stream;
var pic = new CImageShape(this.TempMainObject); var pic = new AscFormat.CImageShape(this.TempMainObject);
pic.setBDeleted(false); pic.setBDeleted(false);
......
...@@ -2080,7 +2080,7 @@ CTableId.prototype.Read_Class_FromBinary = function(Reader) ...@@ -2080,7 +2080,7 @@ CTableId.prototype.Read_Class_FromBinary = function(Reader)
case AscDFH.historyitem_type_Shape : Element = new AscFormat.CShape(); break; case AscDFH.historyitem_type_Shape : Element = new AscFormat.CShape(); break;
case AscDFH.historyitem_type_DispUnits : Element = new CDispUnits(); break; case AscDFH.historyitem_type_DispUnits : Element = new CDispUnits(); break;
case AscDFH.historyitem_type_GroupShape : Element = new CGroupShape(); break; case AscDFH.historyitem_type_GroupShape : Element = new CGroupShape(); break;
case AscDFH.historyitem_type_ImageShape : Element = new CImageShape(); break; case AscDFH.historyitem_type_ImageShape : Element = new AscFormat.CImageShape(); break;
case AscDFH.historyitem_type_Geometry : Element = new AscFormat.Geometry(); break; case AscDFH.historyitem_type_Geometry : Element = new AscFormat.Geometry(); break;
case AscDFH.historyitem_type_Path : Element = new AscFormat.Path(); break; case AscDFH.historyitem_type_Path : Element = new AscFormat.Path(); break;
case AscDFH.historyitem_type_TextBody : Element = new CTextBody(); break; case AscDFH.historyitem_type_TextBody : Element = new CTextBody(); break;
......
...@@ -2014,7 +2014,7 @@ CopyProcessor.prototype = ...@@ -2014,7 +2014,7 @@ CopyProcessor.prototype =
{ {
this.oPresentationWriter.WriteShape(oGraphicObj); this.oPresentationWriter.WriteShape(oGraphicObj);
} }
else if(oGraphicObj instanceof CImageShape) else if(oGraphicObj instanceof AscFormat.CImageShape)
{ {
this.oPresentationWriter.WriteImage(oGraphicObj); this.oPresentationWriter.WriteImage(oGraphicObj);
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Import // Import
var CShape = AscFormat.CShape; var CShape = AscFormat.CShape;
var CImageShape = AscFormat.CImageShape;
CImageShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects; CImageShape.prototype.addToDrawingObjects = CShape.prototype.addToDrawingObjects;
CImageShape.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects; CImageShape.prototype.setDrawingObjects = CShape.prototype.setDrawingObjects;
......
...@@ -221,7 +221,7 @@ Slide.prototype = ...@@ -221,7 +221,7 @@ Slide.prototype =
_index = _glyph.nvSpPr.nvPr.ph.idx; _index = _glyph.nvSpPr.nvPr.ph.idx;
_type = _glyph.nvSpPr.nvPr.ph.type; _type = _glyph.nvSpPr.nvPr.ph.type;
} }
if(_glyph instanceof CImageShape) if(_glyph instanceof AscFormat.CImageShape)
{ {
_index = _glyph.nvPicPr.nvPr.ph.idx; _index = _glyph.nvPicPr.nvPr.ph.idx;
_type = _glyph.nvPicPr.nvPr.ph.type; _type = _glyph.nvPicPr.nvPr.ph.type;
...@@ -284,7 +284,7 @@ Slide.prototype = ...@@ -284,7 +284,7 @@ Slide.prototype =
{ {
_type = _glyph.nvSpPr.nvPr.ph.type; _type = _glyph.nvSpPr.nvPr.ph.type;
} }
if(_glyph instanceof CImageShape) if(_glyph instanceof AscFormat.CImageShape)
{ {
_type = _glyph.nvPicPr.nvPr.ph.type; _type = _glyph.nvPicPr.nvPr.ph.type;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Import // Import
var CShape = AscFormat.CShape; var CShape = AscFormat.CShape;
var CImageShape = AscFormat.CImageShape;
CImageShape.prototype.Get_Theme = CShape.prototype.Get_Theme; CImageShape.prototype.Get_Theme = CShape.prototype.Get_Theme;
CImageShape.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap; CImageShape.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
......
...@@ -436,7 +436,7 @@ function CPPTXContentLoader() ...@@ -436,7 +436,7 @@ function CPPTXContentLoader()
{ {
var s = this.stream; var s = this.stream;
var pic = new CImageShape(); var pic = new AscFormat.CImageShape();
pic.setBDeleted(false); pic.setBDeleted(false);
pic.setParent(this.TempMainObject == null ? this.ParaDrawing : null); pic.setParent(this.TempMainObject == null ? this.ParaDrawing : 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