diff --git a/Word/Editor/Document.js b/Word/Editor/Document.js index edeeea2f34786b8bce34eb2212e3491b3a70aebb..16ad4f5e8a106e2081005d3fca57fe34f2b694e5 100644 --- a/Word/Editor/Document.js +++ b/Word/Editor/Document.js @@ -1132,6 +1132,11 @@ CDocument.prototype = return this.clrSchemeMap; }, + Get_AllBoundsRectOnPageForMath: function(nPageIndex) + { + return this.DrawingObjects.getAllBoundsRectOnPageForMath(nPageIndex); + }, + /** * Ð”Ð°Ð½Ð½Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð¿Ñ€ÐµÐ´Ð½Ð°Ð·Ð½Ð°Ñ‡ÐµÐ½Ð° Ð´Ð»Ñ Ð¾Ñ‚ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€ÐµÑчета. Ðто может быть полезно, Ñ‚.к. редактор вÑегда запуÑкает переÑчет поÑле каждого дейÑтвиÑ. * diff --git a/Word/Editor/FlowObjects.js b/Word/Editor/FlowObjects.js index 652ce2214536af9240ef4020a4a2b66c5f8fb708..96260c21e5e35cc57f8ed0370dbc20fee41bd58f 100644 --- a/Word/Editor/FlowObjects.js +++ b/Word/Editor/FlowObjects.js @@ -104,6 +104,13 @@ CFlowTable.prototype = }, + Get_Distance : function() + { + var oDist = this.Distance; + return new CDistance(getValOrDefault(oDist.L, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.T, 0), getValOrDefault(oDist.R, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.B, 0)); + + }, + getArrayWrapIntervals: function(x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret) { if(this.WrappingType === WRAPPING_TYPE_THROUGH || this.WrappingType === WRAPPING_TYPE_TIGHT) @@ -220,6 +227,13 @@ CFlowParagraph.prototype = }, + Get_Distance : function() + { + var oDist = this.Distance; + return new CDistance(getValOrDefault(oDist.L, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.T, 0), getValOrDefault(oDist.R, DISTANCE_TO_TEXT_LEFTRIGHT), getValOrDefault(oDist.B, 0)); + + }, + getArrayWrapIntervals: function(x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret) { return CFlowTable.prototype.getArrayWrapIntervals.call(this, x0,y0, x1, y1, Y0Sp, Y1Sp, LeftField, RightField, ret); diff --git a/Word/Editor/GraphicObjects/GraphicObjects.js b/Word/Editor/GraphicObjects/GraphicObjects.js index 3a8937b74dccd55035e1db2289a370ea028c8f60..8359b95352c7b229ef3916649779c3929e7726a2 100644 --- a/Word/Editor/GraphicObjects/GraphicObjects.js +++ b/Word/Editor/GraphicObjects/GraphicObjects.js @@ -1,4 +1,86 @@ "use strict"; + +function CBoundsRectForMath(oDrawing) +{ + this.L = 0; + this.T = 0; + this.R = 0; + this.B = 0; + + if(oDrawing) + { + this.Distance = oDrawing.Get_Distance(); + switch (oDrawing.Get_Type()) + { + case para_Drawing: + { + switch(oDrawing.wrappingType) + { + case WRAPPING_TYPE_NONE: + { + break; + } + case WRAPPING_TYPE_SQUARE : + case WRAPPING_TYPE_THROUGH: + case WRAPPING_TYPE_TIGHT: + { + this.L = oDrawing.wrappingPolygon.left + this.Distance.L; + this.R = oDrawing.wrappingPolygon.right - this.Distance.R; + this.T = oDrawing.wrappingPolygon.top + this.Distance.T; + this.B = oDrawing.wrappingPolygon.bottom - this.Distance.B; + break; + } + case WRAPPING_TYPE_TOP_AND_BOTTOM: + { + var oLimits = editor.WordControl.m_oLogicDocument.Get_PageLimits(oDrawing.PageNum); + this.L = oLimits.X; + this.R = oLimits.XLimit; + this.T = oDrawing.wrappingPolygon.top + this.Distance.T; + this.B = oDrawing.wrappingPolygon.bottom - this.Distance.B; + break; + } + } + break; + } + case flowobject_Paragraph: + case flowobject_Table: + { + switch(oDrawing.WrappingType) + { + case WRAPPING_TYPE_NONE: + { + break; + } + case WRAPPING_TYPE_SQUARE : + case WRAPPING_TYPE_THROUGH: + case WRAPPING_TYPE_TIGHT: + { + this.L = oDrawing.X; + this.R = oDrawing.X + oDrawing.W; + this.T = oDrawing.Y; + this.B = oDrawing.Y + oDrawing.H; + break; + } + case WRAPPING_TYPE_TOP_AND_BOTTOM: + { + var oLimits = editor.WordControl.m_oLogicDocument.Get_PageLimits(oDrawing.PageNum); + this.L = oLimits.X; + this.R = oLimits.XLimit; + this.T = oDrawing.Y; + this.B = oDrawing.Y + oDrawing.H; + break; + } + } + } + } + + } + else + { + this.Distance = new CDistance(0, 0, 0, 0); + } +} + function CGraphicObjects(document, drawingDocument, api) { this.api = api; @@ -164,6 +246,15 @@ CGraphicObjects.prototype = getChartSpace2: DrawingObjectsController.prototype.getChartSpace2, + getAllBoundsRectOnPageForMath: function(nPageIndex) + { + if(this.graphicPages[nPageIndex]) + { + return this.graphicPages[nPageIndex].getAllBoundsRectOnPageForMath(); + } + return []; + }, + clearPreTrackObjects: function() { diff --git a/Word/Editor/GraphicObjects/GraphicPage.js b/Word/Editor/GraphicObjects/GraphicPage.js index a41db045f18ae1c85a6d58ef9ab8bcbb34f4a657..2f792ac9da20815edd1581d980e7b4d74ce0e2ff 100644 --- a/Word/Editor/GraphicObjects/GraphicPage.js +++ b/Word/Editor/GraphicObjects/GraphicPage.js @@ -93,6 +93,23 @@ CGraphicPage.prototype = } }, + getAllBoundsRectOnPageForMath: function() + { + var aRet = [], i; + for(i = 0; i < this.wrappingObjects.length; ++i) + { + if(this.wrappingObjects[i].parent) + { + aRet.push(new CBoundsRectForMath(this.wrappingObjects[i].parent)); + } + } + for(i = 0; i < this.flowTables.length; ++i) + { + aRet.push(new CBoundsRectForMath(this.flowTables[i])); + } + return aRet; + }, + concatPage: function(page) { this.inlineObjects = this.inlineObjects.concat(page.inlineObjects); diff --git a/Word/Editor/GraphicObjects/WrapManager.js b/Word/Editor/GraphicObjects/WrapManager.js index bb859656fa96eefd62b56f81a625614019df6a79..1ff2bed46259462583bf0dfcf7e3468a37c2bea7 100644 --- a/Word/Editor/GraphicObjects/WrapManager.js +++ b/Word/Editor/GraphicObjects/WrapManager.js @@ -192,7 +192,7 @@ CWrapPolygon.prototype = getArrayWrapIntervals: function(x0, y0, x1, y1, LeftField, RightField, ret) { - if(y1 < this.top || y0 > this.bottom) + if(y1 - this.top < 0.0001 || this.bottom - y0 < 0.0001) return ret; var ret2 = [];