Commit 59f5ec1f authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55730 954022d7-b5bf-4e40-9824-e11837661b57
parent 97cf2539
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
this.TableMatrix = null; this.TableMatrix = null;
this.CurrentPageIndex = null; this.CurrentPageIndex = null;
this.Native = window.native; this.Native = window["native"];
this.checkMouseDown = function(pos, drDoc) this.checkMouseDown = function(pos, drDoc)
{ {
......
function CDrawingStream() function CDrawingStream()
{ {
this.Native = window.native; this.Native = window["native"];
this.m_oTextPr = null; this.m_oTextPr = null;
this.m_oGrFonts = new CGrRFonts(); this.m_oGrFonts = new CGrRFonts();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
this.PageIndex = -1; this.PageIndex = -1;
this.CurrentPageInfo = null; this.CurrentPageInfo = null;
this.Native = window.native["CreateAutoShapesTrackControl"](); this.Native = window["native"]["CreateAutoShapesTrackControl"]();
} }
CAutoshapeTrack.prototype = CAutoshapeTrack.prototype =
......
...@@ -82,7 +82,7 @@ CShapeDrawer.prototype = ...@@ -82,7 +82,7 @@ CShapeDrawer.prototype =
this.Shape = shape; this.Shape = shape;
this.Graphics = graphics; this.Graphics = graphics;
this.NativeGraphics = window.native; this.NativeGraphics = window["native"];
if (graphics.IsSlideBoundsCheckerType) if (graphics.IsSlideBoundsCheckerType)
{ {
......
...@@ -20,7 +20,7 @@ CTextMeasurerWrapper.prototype = ...@@ -20,7 +20,7 @@ CTextMeasurerWrapper.prototype =
{ {
Init : function() Init : function()
{ {
this.Measurer["Initialize"](window.native); this.Measurer["Initialize"](window["native"]);
}, },
SetFont : function(font) SetFont : function(font)
......
...@@ -9,4 +9,183 @@ asc_docs_api.prototype.Internal_Update_Ind_Left = function(Left) ...@@ -9,4 +9,183 @@ asc_docs_api.prototype.Internal_Update_Ind_Left = function(Left)
asc_docs_api.prototype.Internal_Update_Ind_Right = function(Right) asc_docs_api.prototype.Internal_Update_Ind_Right = function(Right)
{ {
}; };
\ No newline at end of file
// editor
asc_docs_api.prototype["GetNativePageMeta"] = function(pageIndex)
{
this.WordControl.m_oDrawingDocument.LogicDocument = _api.WordControl.m_oDrawingDocument.m_oLogicDocument;
this.WordControl.m_oDrawingDocument.RenderPage(pageIndex);
};
// HTML page interface
asc_docs_api.prototype["Call_OnUpdateOverlay"] = function(param)
{
this.WordControl.m_oDrawingDocument.OnUpdateOverlay();
};
asc_docs_api.prototype["Call_OnMouseDown"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnMouseDown(e);
};
asc_docs_api.prototype["Call_OnMouseUp"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnMouseUp(e);
};
asc_docs_api.prototype["Call_OnMouseMove"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnMouseMove(e);
};
asc_docs_api.prototype["Call_OnKeyDown"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnKeyDown(e);
};
asc_docs_api.prototype["Call_OnKeyPress"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnKeyPress(e);
};
asc_docs_api.prototype["Call_OnKeyUp"] = function(e)
{
this.WordControl.m_oDrawingDocument.OnKeyUp(e);
};
asc_docs_api.prototype["Call_CalculateResume"] = function()
{
Document_Recalculate_Page();
};
asc_docs_api.prototype["Call_TurnOffRecalculate"] = function()
{
this.WordControl.m_oLogicDocument.TurnOffRecalc = true;
};
asc_docs_api.prototype["Call_TurnOnRecalculate"] = function()
{
this.WordControl.m_oLogicDocument.TurnOffRecalc = false;
this.WordControl.m_oLogicDocument.Recalculate();
};
asc_docs_api.prototype["Call_CheckTargetUpdate"] = function()
{
this.WordControl.m_oLogicDocument.CheckTargetUpdate();
};
asc_docs_api.prototype["Call_HR_Tabs"] = function(arrT, arrP)
{
var _arr = new CParaTabs();
var _c = arrT.length;
for (var i = 0; i < _c; i++)
{
if (arrT[i] == 1)
_arr.Add( new CParaTab( tab_Left, arrP[i] ) );
if (arrT[i] == 2)
_arr.Add( new CParaTab( tab_Right, arrP[i] ) );
if (arrT[i] == 3)
_arr.Add( new CParaTab( tab_Center, arrP[i] ) );
}
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Paragraph_Properties) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_ParagraphTabs(_arr);
}
};
asc_docs_api.prototype["Call_HR_Pr"] = function(_indent_left, _indent_right, _indent_first)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Paragraph_Properties) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_ParagraphIndent( { Left : _indent_left, Right : _indent_right, FirstLine: _indent_first } );
_logic.Document_UpdateInterfaceState();
}
};
asc_docs_api.prototype["Call_HR_Margins"] = function(_margin_left, _margin_right)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Document_SectPr) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_DocumentMargin( { Left : _margin_left, Right : _margin_right });
}
};
asc_docs_api.prototype["Call_HR_Table"] = function(_params, _cols, _margins, _rows)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
_logic.Create_NewHistoryPoint();
var _table_murkup = Deserialize_Table_Markup(_params, _cols, _margins, _rows);
_table_murkup.Table = this.WordControl.m_oDrawingDocument.Table;
_table_murkup.CorrectTo();
_table_murkup.Table.Update_TableMarkupFromRuler(_table_murkup, true, _params[6]);
_table_murkup.CorrectFrom();
}
};
asc_docs_api.prototype["Call_VR_Margins"] = function(_top, _bottom)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Document_SectPr) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_DocumentMargin( { Top : _top, Bottom : _bottom });
}
};
asc_docs_api.prototype["Call_VR_Header"] = function(_header_top, _header_bottom)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_HdrFtr) )
{
_logic.Create_NewHistoryPoint();
_logic.Document_SetHdrFtrBounds(_header_top, _header_bottom);
}
};
asc_docs_api.prototype["Call_VR_Table"] = function(_params, _cols, _margins, _rows)
{
var _logic = this.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
_logic.Create_NewHistoryPoint();
var _table_murkup = Deserialize_Table_Markup(_params, _cols, _margins, _rows);
_table_murkup.Table = this.WordControl.m_oDrawingDocument.Table;
_table_murkup.CorrectTo();
_table_murkup.Table.Update_TableMarkupFromRuler(_table_murkup, false, _params[6]);
_table_murkup.CorrectFrom();
}
};
function Deserialize_Table_Markup(_params, _cols, _margins, _rows)
{
var _markup = new CTableMarkup(null);
_markup.Internal.RowIndex = _params[0];
_markup.Internal.CellIndex = _params[1];
_markup.Internal.PageNum = _params[2];
_markup.X = _params[3];
_markup.CurCol = _params[4];
_markup.CurRow = _params[5];
// 6 - DragPos
_markup.TransformX = _params[7];
_markup.TransformY = _params[8];
_markup.Cols = _cols;
var _len = _margins.length;
for (var i = 0; i < _len; i += 2)
{
_markup.Margins.push({ Left : _margins[i], Right : _margins[i + 1] });
}
_len = _rows.length;
for (var i = 0; i < _len; i += 2)
{
_markup.Rows.push({ Y : _rows[i], H : _rows[i + 1] });
}
return _markup;
}
\ No newline at end of file
...@@ -355,8 +355,7 @@ function GetNativePageBase64(pageIndex) ...@@ -355,8 +355,7 @@ function GetNativePageBase64(pageIndex)
function GetNativePageMeta(pageIndex) function GetNativePageMeta(pageIndex)
{ {
_api.WordControl.m_oDrawingDocument.LogicDocument = _api.WordControl.m_oDrawingDocument.m_oLogicDocument; return _api.GetNativePageMeta(pageIndex);
_api.WordControl.m_oDrawingDocument.RenderPage(pageIndex);
} }
function GetNativeId() function GetNativeId()
...@@ -384,171 +383,80 @@ var console = { ...@@ -384,171 +383,80 @@ var console = {
// HTML page interface // HTML page interface
window.native.Call_OnUpdateOverlay = function(param) window.native.Call_OnUpdateOverlay = function(param)
{ {
_api.WordControl.m_oDrawingDocument.OnUpdateOverlay(); return _api.Call_OnUpdateOverlay(param);
}; };
window.native.Call_OnMouseDown = function(e) window.native.Call_OnMouseDown = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnMouseDown(e); return _api.Call_OnMouseDown(e);
}; };
window.native.Call_OnMouseUp = function(e) window.native.Call_OnMouseUp = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnMouseUp(e); return _api.Call_OnMouseUp(e);
}; };
window.native.Call_OnMouseMove = function(e) window.native.Call_OnMouseMove = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnMouseMove(e); return _api.Call_OnMouseMove(e);
}; };
window.native.Call_OnKeyDown = function(e) window.native.Call_OnKeyDown = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnKeyDown(e); return _api.Call_OnKeyDown(e);
}; };
window.native.Call_OnKeyPress = function(e) window.native.Call_OnKeyPress = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnKeyPress(e); return _api.Call_OnKeyPress(e);
}; };
window.native.Call_OnKeyUp = function(e) window.native.Call_OnKeyUp = function(e)
{ {
_api.WordControl.m_oDrawingDocument.OnKeyUp(e); return _api.Call_OnKeyUp(e);
}; };
window.native.Call_CalculateResume = function() window.native.Call_CalculateResume = function()
{ {
Document_Recalculate_Page(); return _api.Call_CalculateResume();
}; };
window.native.Call_TurnOffRecalculate = function() window.native.Call_TurnOffRecalculate = function()
{ {
_api.WordControl.m_oLogicDocument.TurnOffRecalc = true; return _api.Call_TurnOffRecalculate();
}; };
window.native.Call_TurnOnRecalculate = function() window.native.Call_TurnOnRecalculate = function()
{ {
_api.WordControl.m_oLogicDocument.TurnOffRecalc = false; return _api.Call_TurnOnRecalculate();
_api.WordControl.m_oLogicDocument.Recalculate();
}; };
window.native.Call_CheckTargetUpdate = function() window.native.Call_CheckTargetUpdate = function()
{ {
_api.WordControl.m_oLogicDocument.CheckTargetUpdate(); return _api.Call_CheckTargetUpdate();
}; };
window.native.Call_HR_Tabs = function(arrT, arrP) window.native.Call_HR_Tabs = function(arrT, arrP)
{ {
var _arr = new CParaTabs(); return _api.Call_HR_Tabs(arrT, arrP);
var _c = arrT.length;
for (var i = 0; i < _c; i++)
{
if (arrT[i] == 1)
_arr.Add( new CParaTab( tab_Left, arrP[i] ) );
if (arrT[i] == 2)
_arr.Add( new CParaTab( tab_Right, arrP[i] ) );
if (arrT[i] == 3)
_arr.Add( new CParaTab( tab_Center, arrP[i] ) );
}
var _logic = _api.WordControl.m_oLogicDocument;
if ( false === _logic.Document_Is_SelectionLocked(changestype_Paragraph_Properties) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_ParagraphTabs(_arr);
}
}; };
window.native.Call_HR_Pr = function(_indent_left, _indent_right, _indent_first) window.native.Call_HR_Pr = function(_indent_left, _indent_right, _indent_first)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_HR_Pr(_indent_left, _indent_right, _indent_first);
if ( false === _logic.Document_Is_SelectionLocked(changestype_Paragraph_Properties) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_ParagraphIndent( { Left : _indent_left, Right : _indent_right, FirstLine: _indent_first } );
_logic.Document_UpdateInterfaceState();
}
}; };
window.native.Call_HR_Margins = function(_margin_left, _margin_right) window.native.Call_HR_Margins = function(_margin_left, _margin_right)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_HR_Margins(_margin_left, _margin_right);
if ( false === _logic.Document_Is_SelectionLocked(changestype_Document_SectPr) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_DocumentMargin( { Left : _margin_left, Right : _margin_right });
}
}; };
window.native.Call_HR_Table = function(_params, _cols, _margins, _rows) window.native.Call_HR_Table = function(_params, _cols, _margins, _rows)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_HR_Table(_params, _cols, _margins, _rows);
if ( false === _logic.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
_logic.Create_NewHistoryPoint();
var _table_murkup = Deserialize_Table_Markup(_params, _cols, _margins, _rows);
_table_murkup.Table = _api.WordControl.m_oDrawingDocument.Table;
_table_murkup.CorrectTo();
_table_murkup.Table.Update_TableMarkupFromRuler(_table_murkup, true, _params[6]);
_table_murkup.CorrectFrom();
}
}; };
window.native.Call_VR_Margins = function(_top, _bottom) window.native.Call_VR_Margins = function(_top, _bottom)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_VR_Margins(_top, _bottom);
if ( false === _logic.Document_Is_SelectionLocked(changestype_Document_SectPr) )
{
_logic.Create_NewHistoryPoint();
_logic.Set_DocumentMargin( { Top : _top, Bottom : _bottom });
}
}; };
window.native.Call_VR_Header = function(_header_top, _header_bottom) window.native.Call_VR_Header = function(_header_top, _header_bottom)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_VR_Header(_header_top, _header_bottom);
if ( false === _logic.Document_Is_SelectionLocked(changestype_HdrFtr) )
{
_logic.Create_NewHistoryPoint();
_logic.Document_SetHdrFtrBounds(_header_top, _header_bottom);
}
}; };
window.native.Call_VR_Table = function(_params, _cols, _margins, _rows) window.native.Call_VR_Table = function(_params, _cols, _margins, _rows)
{ {
var _logic = _api.WordControl.m_oLogicDocument; return _api.Call_VR_Table(_params, _cols, _margins, _rows);
if ( false === _logic.Document_Is_SelectionLocked(changestype_Table_Properties) ) };
{ \ No newline at end of file
_logic.Create_NewHistoryPoint();
var _table_murkup = Deserialize_Table_Markup(_params, _cols, _margins, _rows);
_table_murkup.Table = _api.WordControl.m_oDrawingDocument.Table;
_table_murkup.CorrectTo();
_table_murkup.Table.Update_TableMarkupFromRuler(_table_murkup, false, _params[6]);
_table_murkup.CorrectFrom();
}
};
function Deserialize_Table_Markup(_params, _cols, _margins, _rows)
{
var _markup = new CTableMarkup(null);
_markup.Internal.RowIndex = _params[0];
_markup.Internal.CellIndex = _params[1];
_markup.Internal.PageNum = _params[2];
_markup.X = _params[3];
_markup.CurCol = _params[4];
_markup.CurRow = _params[5];
// 6 - DragPos
_markup.TransformX = _params[7];
_markup.TransformY = _params[8];
_markup.Cols = _cols;
var _len = _margins.length;
for (var i = 0; i < _len; i += 2)
{
_markup.Margins.push({ Left : _margins[i], Right : _margins[i + 1] });
}
_len = _rows.length;
for (var i = 0; i < _len; i += 2)
{
_markup.Rows.push({ Y : _rows[i], H : _rows[i + 1] });
}
return _markup;
}
\ No newline at end of file
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