Commit 54f0ce89 authored by Oleg Korshul's avatar Oleg Korshul

refactoring

parent 1fd21b34
...@@ -1465,11 +1465,6 @@ function CDrawingDocument(drawingObjects) ...@@ -1465,11 +1465,6 @@ function CDrawingDocument(drawingObjects)
this.TableStylesLastLook = null; this.TableStylesLastLook = null;
this.LastParagraphMargins = null; this.LastParagraphMargins = null;
// параметры для SelectShow
this.min_PageAddSelection = 100000;
this.max_PageAddSelection = -1;
this.IsShowSelectAttack = false;
this.AutoShapesTrack = null; this.AutoShapesTrack = null;
this.AutoShapesTrackLockPageNum = -1; this.AutoShapesTrackLockPageNum = -1;
...@@ -3208,87 +3203,6 @@ function CDrawingDocument(drawingObjects) ...@@ -3208,87 +3203,6 @@ function CDrawingDocument(drawingObjects)
} }
} }
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
return;
if (undefined === this.m_arrPages[pageIndex])
this.m_arrPages[pageIndex] = new CPage();
if (this.min_PageAddSelection > pageIndex)
this.min_PageAddSelection = pageIndex;
if (this.max_PageAddSelection < pageIndex)
this.max_PageAddSelection = pageIndex;
if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
{
this.m_oWordControl.ShowOverlay();
this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
}
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = width;
r.h = height;
this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
if (this.m_oWordControl.MobileTouchManager)
{
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
}
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
return;
if (undefined === this.m_arrPages[pageIndex])
this.m_arrPages[pageIndex] = new CPage();
if (this.min_PageAddSelection > pageIndex)
this.min_PageAddSelection = pageIndex;
if (this.max_PageAddSelection < pageIndex)
this.max_PageAddSelection = pageIndex;
if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
{
this.m_oWordControl.ShowOverlay();
this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
}
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = width;
r.h = height;
this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
if (this.m_oWordControl.MobileTouchManager)
{
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
}
this.SelectShow = function() this.SelectShow = function()
{ {
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
......
...@@ -1632,11 +1632,6 @@ function CDrawingDocument(drawingObjects) ...@@ -1632,11 +1632,6 @@ function CDrawingDocument(drawingObjects)
this.TableStylesLastLook = null; this.TableStylesLastLook = null;
this.LastParagraphMargins = null; this.LastParagraphMargins = null;
// параметры для SelectShow
this.min_PageAddSelection = 100000;
this.max_PageAddSelection = -1;
this.IsShowSelectAttack = false;
this.AutoShapesTrack = null; this.AutoShapesTrack = null;
this.AutoShapesTrackLockPageNum = -1; this.AutoShapesTrackLockPageNum = -1;
...@@ -3067,90 +3062,6 @@ function CDrawingDocument(drawingObjects) ...@@ -3067,90 +3062,6 @@ function CDrawingDocument(drawingObjects)
this.Native["DD_AddPageSelection"](pageIndex, x, y, w, h); this.Native["DD_AddPageSelection"](pageIndex, x, y, w, h);
} }
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
{
//TODO:
// //if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// // return;
// if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
//
// if (undefined === this.m_arrPages[pageIndex])
// this.m_arrPages[pageIndex] = new CPage();
//
// if (this.min_PageAddSelection > pageIndex)
// this.min_PageAddSelection = pageIndex;
// if (this.max_PageAddSelection < pageIndex)
// this.max_PageAddSelection = pageIndex;
//
// if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
// {
// this.m_oWordControl.ShowOverlay();
// this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
// }
//
// var r = new _rect();
// r.x = x;
// r.y = y;
// r.w = width;
// r.h = height;
// this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
//
// if (this.m_oWordControl.MobileTouchManager)
// {
// if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
// {
// this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
// }
//
// this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
// }
}
this.AddPageSelection2 = function(pageIndex, x, y, width, height)
{
//TODO:
// //if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// // return;
// if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
//
// if (undefined === this.m_arrPages[pageIndex])
// this.m_arrPages[pageIndex] = new CPage();
//
// if (this.min_PageAddSelection > pageIndex)
// this.min_PageAddSelection = pageIndex;
// if (this.max_PageAddSelection < pageIndex)
// this.max_PageAddSelection = pageIndex;
//
// if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
// {
// this.m_oWordControl.ShowOverlay();
// this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
// }
//
// var r = new _rect();
// r.x = x;
// r.y = y;
// r.w = width;
// r.h = height;
// this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
//
// if (this.m_oWordControl.MobileTouchManager)
// {
// if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
// {
// this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
// }
//
// this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
// }
}
this.SelectShow = function() this.SelectShow = function()
{ {
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
......
...@@ -1961,6 +1961,8 @@ ...@@ -1961,6 +1961,8 @@
this.CheckSelectEnd = function(bIsAttack) this.CheckSelectEnd = function(bIsAttack)
{ {
this.CheckSelectRects();
var _bIsRet = false; var _bIsRet = false;
if (!bIsAttack) if (!bIsAttack)
_bIsRet = this.IsTrackingCurrent; _bIsRet = this.IsTrackingCurrent;
...@@ -2092,8 +2094,42 @@ ...@@ -2092,8 +2094,42 @@
} }
} }
this.CheckSelectRects = function()
{
this.RectSelect1 = null;
this.RectSelect2 = null;
if (!this.LogicDocument)
return;
var _select = this.LogicDocument.Get_SelectionBounds();
if (!_select)
return;
var _rect1 = _select.Start;
var _rect2 = _select.End;
if (!_rect1 || !_rect2)
return;
this.RectSelect1 = new AscCommon._rect();
this.RectSelect1.x = _rect1.X;
this.RectSelect1.y = _rect1.Y;
this.RectSelect1.w = _rect1.W;
this.RectSelect1.h = _rect1.H;
this.PageSelect1 = _rect1.Page;
this.RectSelect2 = new AscCommon._rect();
this.RectSelect2.x = _rect2.X;
this.RectSelect2.y = _rect2.Y;
this.RectSelect2.w = _rect2.W;
this.RectSelect2.h = _rect2.H;
this.PageSelect2 = _rect2.Page;
}
this.CheckSelect = function(overlay) this.CheckSelect = function(overlay)
{ {
this.CheckSelectRects();
if (null == this.RectSelect1 || null == this.RectSelect2) if (null == this.RectSelect1 || null == this.RectSelect2)
return; return;
...@@ -2205,6 +2241,7 @@ ...@@ -2205,6 +2241,7 @@
this.CheckSelect2 = function(overlay) this.CheckSelect2 = function(overlay)
{ {
this.CheckSelectRects();
if (null == this.RectSelect1 || null == this.RectSelect2) if (null == this.RectSelect1 || null == this.RectSelect2)
return; return;
......
...@@ -2096,11 +2096,6 @@ function CDrawingDocument() ...@@ -2096,11 +2096,6 @@ function CDrawingDocument()
this.TableStylesSheckLook = null; this.TableStylesSheckLook = null;
this.TableStylesSheckLookFlag = false; this.TableStylesSheckLookFlag = false;
// параметры для SelectShow
this.min_PageAddSelection = 100000;
this.max_PageAddSelection = -1;
this.IsShowSelectAttack = false;
this.InlineTextTrackEnabled = false; this.InlineTextTrackEnabled = false;
this.InlineTextTrack = null; this.InlineTextTrack = null;
this.InlineTextTrackPage = -1; this.InlineTextTrackPage = -1;
...@@ -4473,28 +4468,6 @@ function CDrawingDocument() ...@@ -4473,28 +4468,6 @@ function CDrawingDocument()
this.IsTextMatrixUse = ((null != this.TextMatrix) && !global_MatrixTransformer.IsIdentity(this.TextMatrix)); this.IsTextMatrixUse = ((null != this.TextMatrix) && !global_MatrixTransformer.IsIdentity(this.TextMatrix));
if (pageIndex < this.m_lDrawingFirst || pageIndex > this.m_lDrawingEnd)
{
if (this.m_oWordControl.MobileTouchManager)
{
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = w;
r.h = h;
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
return;
}
var page = this.m_arrPages[pageIndex]; var page = this.m_arrPages[pageIndex];
var drawPage = page.drawingPage; var drawPage = page.drawingPage;
...@@ -4568,67 +4541,6 @@ function CDrawingDocument() ...@@ -4568,67 +4541,6 @@ function CDrawingDocument()
ctx.lineTo(x4, y4); ctx.lineTo(x4, y4);
ctx.closePath(); ctx.closePath();
} }
if (this.m_oWordControl.MobileTouchManager)
{
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = w;
r.h = h;
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
}
this.AddPageSelection2 = function (pageIndex, x, y, width, height)
{
this.IsTextMatrixUse = ((null != this.TextMatrix) && !global_MatrixTransformer.IsIdentity(this.TextMatrix));
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
return;
if (undefined === this.m_arrPages[pageIndex])
this.m_arrPages[pageIndex] = new CPage();
if (this.min_PageAddSelection > pageIndex)
this.min_PageAddSelection = pageIndex;
if (this.max_PageAddSelection < pageIndex)
this.max_PageAddSelection = pageIndex;
if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
{
this.m_oWordControl.ShowOverlay();
this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
}
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = width;
r.h = height;
this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
if (this.m_oWordControl.MobileTouchManager)
{
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
} }
this.CheckSelectMobile = function (overlay) this.CheckSelectMobile = function (overlay)
...@@ -4747,46 +4659,6 @@ function CDrawingDocument() ...@@ -4747,46 +4659,6 @@ function CDrawingDocument()
} }
} }
this.AddPageSelection2 = function (pageIndex, x, y, width, height)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
return;
if (undefined === this.m_arrPages[pageIndex])
this.m_arrPages[pageIndex] = new CPage();
if (this.min_PageAddSelection > pageIndex)
this.min_PageAddSelection = pageIndex;
if (this.max_PageAddSelection < pageIndex)
this.max_PageAddSelection = pageIndex;
if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
{
this.m_oWordControl.ShowOverlay();
this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
}
var r = new AscCommon._rect();
r.x = x;
r.y = y;
r.w = width;
r.h = height;
this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
if (this.m_oWordControl.MobileTouchManager)
{
if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
{
this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
}
this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
}
}
this.SelectShow = function () this.SelectShow = function ()
{ {
this.m_oWordControl.OnUpdateOverlay(); this.m_oWordControl.OnUpdateOverlay();
......
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