Commit 4f39bc0a authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51095 954022d7-b5bf-4e40-9824-e11837661b57
parent aa2ab166
......@@ -972,6 +972,8 @@ function CDrawingDocument()
this.m_sLockedCursorType = "";
this.TableOutlineDr = new CTableOutlineDr();
this.HorVerAnchors = [];
this.m_lCurrentRendererPage = -1;
this.m_oDocRenderer = null;
this.m_bOldShowMarks = false;
......@@ -2982,27 +2984,52 @@ function CDrawingDocument()
return g_comment_image_offsets[_index][3] * g_dKoef_pix_to_mm * 100 / this.m_oWordControl.m_nZoomValue;
}
this.DrawVerAnchor = function(xPos)
this.DrawVerAnchor = function(xPos, bIsFromDrawings)
{
if (undefined === bIsFromDrawings)
{
this.HorVerAnchors.push({ Type : 0, Pos : xPos });
return;
}
var _pos = this.ConvertCoordsToCursor(xPos, 0);
if (_pos.Error === false)
{
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#D08A78";
this.m_oWordControl.m_oOverlayApi.VertLine(_pos.X, true);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#FF0000";
this.m_oWordControl.m_oOverlayApi.VertLine2(_pos.X);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#000000";
}
}
this.DrawHorAnchor = function(yPos)
this.DrawHorAnchor = function(yPos, bIsFromDrawings)
{
if (undefined === bIsFromDrawings)
{
this.HorVerAnchors.push({ Type : 1, Pos : yPos });
return;
}
var _pos = this.ConvertCoordsToCursor(0, yPos);
if (_pos.Error === false)
{
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#D08A78";
this.m_oWordControl.m_oOverlayApi.HorLine(_pos.Y, true);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#FF0000";
this.m_oWordControl.m_oOverlayApi.HorLine2(_pos.Y);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#000000";
}
}
this.DrawHorVerAnchor = function()
{
for (var i = 0; i < this.HorVerAnchors.length; i++)
{
var _anchor = this.HorVerAnchors[i];
if (_anchor.Type == 0)
this.DrawVerAnchor(_anchor.Pos, true);
else
this.DrawHorAnchor(_anchor.Pos, true);
}
this.HorVerAnchors.splice(0, this.HorVerAnchors.length);
}
}
function CThPage()
......
......@@ -2325,6 +2325,8 @@ function CEditorPage(api)
}
}
drDoc.DrawHorVerAnchor();
return true;
}
......
......@@ -1856,6 +1856,8 @@ function CDrawingDocument()
this.Overlay = null;
this.IsTextMatrixUse = false;
this.HorVerAnchors = [];
// массивы ректов для поиска
this._search_HdrFtr_All = new Array(); // Поиск в колонтитуле, который находится на всех страницах
this._search_HdrFtr_All_no_First = new Array(); // Поиск в колонтитуле, который находится на всех страницах, кроме первой
......@@ -2673,6 +2675,22 @@ function CDrawingDocument()
return { X : x_pix, Y : y_pix, Error: false };
}
this.ConvertCoordsToCursor4 = function(x, y, pageIndex)
{
// теперь крутить всякие циклы нет смысла
if (pageIndex < 0 || pageIndex >= this.m_lPagesCount)
{
return { X : 0, Y : 0, Error: true };
}
var dKoef = (this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100);
var x_pix = (this.m_arrPages[pageIndex].drawingPage.left + x * dKoef + 0.5) >> 0;
var y_pix = (this.m_arrPages[pageIndex].drawingPage.top + y * dKoef + 0.5) >> 0;
return { X : x_pix, Y : y_pix, Error: false };
}
this.InitViewer = function()
{
}
......@@ -5613,27 +5631,52 @@ function CDrawingDocument()
}
}
this.DrawVerAnchor = function(pageNum, xPos)
this.DrawVerAnchor = function(pageNum, xPos, bIsFromDrawings)
{
var _pos = this.ConvetToPageCoords(xPos, 0, pageNum);
if (undefined === bIsFromDrawings)
{
this.HorVerAnchors.push({ Type : 0, Page : pageNum, Pos : xPos });
return;
}
var _pos = this.ConvertCoordsToCursor4(xPos, 0, pageNum);
if (_pos.Error === false)
{
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#D08A78";
this.m_oWordControl.m_oOverlayApi.VertLine(_pos.X, true);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#FF0000";
this.m_oWordControl.m_oOverlayApi.VertLine2(_pos.X);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#000000";
}
}
this.DrawHorAnchor = function(pageNum, yPos)
this.DrawHorAnchor = function(pageNum, yPos, bIsFromDrawings)
{
var _pos = this.ConvetToPageCoords(0, yPos, pageNum);
if (undefined === bIsFromDrawings)
{
this.HorVerAnchors.push({ Type : 1, Page : pageNum, Pos : yPos });
return;
}
var _pos = this.ConvertCoordsToCursor4(0, yPos, pageNum);
if (_pos.Error === false)
{
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#D08A78";
this.m_oWordControl.m_oOverlayApi.HorLine(_pos.Y, true);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#FF0000";
this.m_oWordControl.m_oOverlayApi.HorLine2(_pos.Y);
this.m_oWordControl.m_oOverlayApi.DashLineColor = "#000000";
}
}
this.DrawHorVerAnchor = function()
{
for (var i = 0; i < this.HorVerAnchors.length; i++)
{
var _anchor = this.HorVerAnchors[i];
if (_anchor.Type == 0)
this.DrawVerAnchor(_anchor.Page, _anchor.Pos, true);
else
this.DrawHorAnchor(_anchor.Page, _anchor.Pos, true);
}
this.HorVerAnchors.splice(0, this.HorVerAnchors.length);
}
}
function CStyleImage(_name, _ind, _type, _uiPriority)
......
......@@ -2856,6 +2856,8 @@ function CEditorPage(api)
{
drDoc.DrawFrameTrack(overlay);
}
drDoc.DrawHorVerAnchor();
}
else
{
......
......@@ -140,6 +140,45 @@ COverlay.prototype =
this.Show();
},
VertLine2 : function(position)
{
if (this.min_x > position)
this.min_x = position;
if (this.max_x < position)
this.max_x = position;
this.min_y = 0;
this.max_y = this.m_oControl.HtmlElement.height;
this.m_oContext.lineWidth = 1;
var x = ((position + 0.5) >> 0) + 0.5;
var y = 0;
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
this.m_oContext.moveTo(x, y);
this.m_oContext.lineTo(x, this.max_y);
this.m_oContext.stroke();
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
var dist = 5;
while (y < this.max_y)
{
this.m_oContext.moveTo(x, y);
y += dist;
this.m_oContext.lineTo(x, y);
y += dist;
}
this.m_oContext.stroke();
this.m_oContext.beginPath();
this.Show();
},
HorLine : function(position, bIsSimpleAdd)
{
if (bIsSimpleAdd !== true)
......@@ -206,6 +245,45 @@ COverlay.prototype =
this.Show();
},
HorLine2 : function(position)
{
if (this.min_y > position)
this.min_y = position;
if (this.max_y < position)
this.max_y = position;
this.min_x = 0;
this.max_x = this.m_oControl.HtmlElement.width;
this.m_oContext.lineWidth = 1;
var y = ((position + 0.5) >> 0) + 0.5;
var x = 0;
this.m_oContext.strokeStyle = "#FFFFFF";
this.m_oContext.beginPath();
this.m_oContext.moveTo(x, y);
this.m_oContext.lineTo(this.max_x, y);
this.m_oContext.stroke();
this.m_oContext.strokeStyle = this.DashLineColor;
this.m_oContext.beginPath();
var dist = 5;
while (x < this.max_x)
{
this.m_oContext.moveTo(x, y);
x += dist;
this.m_oContext.lineTo(x, y);
x += dist;
}
this.m_oContext.stroke();
this.m_oContext.beginPath();
this.Show();
},
CheckPoint1 : function(x,y)
{
if (x < this.min_x)
......
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