Commit 866119f6 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

NativeApplyChangesData

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59456 954022d7-b5bf-4e40-9824-e11837661b57
parent 71b6d8f0
......@@ -297,6 +297,17 @@ function NativeCalculateFile()
_api.asc_nativeCalculateFile();
}
function NativeApplyChangesData(data)
{
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
{
_api.asc_nativeApplyChanges2(data);
}
else
{
}
}
function NativeApplyChanges()
{
if (window.NATIVE_DOCUMENT_TYPE == "presentation" || window.NATIVE_DOCUMENT_TYPE == "document")
......
......@@ -7740,6 +7740,70 @@ window["asc_docs_api"].prototype["asc_nativeApplyChanges"] = function(changes)
CollaborativeEditing.Apply_OtherChanges();
};
window["asc_docs_api"].prototype["asc_nativeApplyChanges2"] = function(data)
{
// Чтобы заново созданные параграфы не отображались залоченными
g_oIdCounter.Set_Load( true );
var stream = new FT_Stream2(data, data.length);
stream.obj = null;
var Loader = { Reader : stream, Reader2 : null };
var _color = new CDocumentColor( 191, 255, 199 );
// Применяем изменения, пока они есть
var _count = Loader.Reader.GetLong();
//console.log("count:" + _count);
var _pos = 4;
for (var i = 0; i < _count; i++)
{
if (window["NATIVE_EDITOR_ENJINE"] === true && window["native"]["CheckNextChange"])
{
if (!window["native"]["CheckNextChange"]())
break;
}
var _id = Loader.Reader.GetLong();
var _len = Loader.Reader.GetLong();
//console.log("change: [" + _id + ", " + _len + "]");
_pos += 8;
stream.size = _pos + _len;
var Type = Loader.Reader.GetLong();
var Class = null;
if ( historyitem_type_HdrFtr === Type )
{
Class = editor.WordControl.m_oLogicDocument.HdrFtr;
}
else
Class = g_oTableId.Get_ById( "" + _id );
stream.Seek2(_pos);
if ( null != Class )
Class.Load_Changes( Loader.Reader, Loader.Reader2, _color );
_pos += _len;
stream.Seek2(_pos);
stream.size = data.length;
}
CollaborativeEditing.m_aChanges = [];
// У новых элементов выставляем указатели на другие классы
CollaborativeEditing.Apply_LinkData();
// Делаем проверки корректности новых изменений
CollaborativeEditing.Check_MergeData();
CollaborativeEditing.OnEnd_ReadForeignChanges();
g_oIdCounter.Set_Load( false );
};
window["asc_docs_api"].prototype["asc_nativeGetFile"] = function()
{
var oBinaryFileWriter = new BinaryFileWriter(this.WordControl.m_oLogicDocument);
......
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