Commit 113ad38b authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Вынес некоторые классы для совместного редактирование в common'ы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62481 954022d7-b5bf-4e40-9824-e11837661b57
parent 8e18c816
...@@ -1223,6 +1223,13 @@ CTableId.prototype.Read_Class_FromBinary = function(Reader) ...@@ -1223,6 +1223,13 @@ CTableId.prototype.Read_Class_FromBinary = function(Reader)
case historyitem_type_rad : Element = new CRadical(); break; case historyitem_type_rad : Element = new CRadical(); break;
case historyitem_type_deg_subsup : Element = new CDegreeSubSup(); break; case historyitem_type_deg_subsup : Element = new CDegreeSubSup(); break;
case historyitem_type_deg : Element = new CDegree(); break; case historyitem_type_deg : Element = new CDegree(); break;
case historyitem_type_Slide : Element = new Slide(); break;
case historyitem_type_SlideLayout : Element = new SlideLayout(); break;
case historyitem_type_SlideMaster : Element = new MasterSlide(); break;
case historyitem_type_SlideComments : Element = new SlideComments(); break;
case historyitem_type_PropLocker : Element = new PropLocker(); break;
case historyitem_type_Theme : Element = new CTheme(); break;
case historyitem_type_GraphicFrame : Element = new CGraphicFrame(); break;
} }
if ( null !== Element ) if ( null !== Element )
...@@ -1424,4 +1431,125 @@ CTableId.prototype.Load_Changes = function(Reader, Reader2) ...@@ -1424,4 +1431,125 @@ CTableId.prototype.Load_Changes = function(Reader, Reader2)
CTableId.prototype.Unlock = function(Data) CTableId.prototype.Unlock = function(Data)
{ {
// Ничего не делаем // Ничего не делаем
};
function CLock()
{
this.Type = locktype_None;
this.UserId = null;
}
CLock.prototype =
{
Get_Type : function()
{
return this.Type;
},
Set_Type : function(NewType, Redraw)
{
if ( NewType === locktype_None )
this.UserId = null;
this.Type = NewType;
if ( false != Redraw )
{
// TODO: переделать перерисовку тут
var DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
DrawingDocument.ClearCachePages();
DrawingDocument.FirePaint();
}
},
Check : function(Id)
{
if ( this.Type === locktype_Mine )
CollaborativeEditing.Add_CheckLock( false );
else if ( this.Type === locktype_Other || this.Type === locktype_Other2 || this.Type === locktype_Other3 )
CollaborativeEditing.Add_CheckLock( true );
else
CollaborativeEditing.Add_CheckLock( Id );
},
Lock : function(bMine)
{
if ( locktype_None === this.Type )
{
if ( true === bMine )
this.Type = locktype_Mine;
else
true.Type = locktype_Other;
}
},
Is_Locked : function()
{
if ( locktype_None != this.Type && locktype_Mine != this.Type )
return true;
return false;
},
Set_UserId : function(UserId)
{
this.UserId = UserId;
},
Get_UserId : function()
{
return this.UserId;
},
Have_Changes : function()
{
if ( locktype_Other2 === this.Type || locktype_Other3 === this.Type )
return true;
return false;
}
};
function CContentChanges()
{
this.m_aChanges = [];
}
CContentChanges.prototype =
{
Add : function(Changes)
{
this.m_aChanges.push( Changes );
},
Clear : function()
{
this.m_aChanges.length = 0;
},
Check : function(Type, Pos)
{
var CurPos = Pos;
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
{
var NewPos = this.m_aChanges[Index].Check_Changes(Type, CurPos);
if ( false === NewPos )
return false;
CurPos = NewPos;
}
return CurPos;
},
Refresh : function()
{
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.m_aChanges[Index].Refresh_BinaryData();
}
}
}; };
\ No newline at end of file
This diff is collapsed.
...@@ -858,82 +858,7 @@ var changestype_2_Comment = 3; // Работает с комме ...@@ -858,82 +858,7 @@ var changestype_2_Comment = 3; // Работает с комме
var changestype_2_Element_and_Type = 4; // Проверяем возможно ли сделать изменение заданного типа с заданным элементом(а не с текущим) var changestype_2_Element_and_Type = 4; // Проверяем возможно ли сделать изменение заданного типа с заданным элементом(а не с текущим)
var changestype_2_ElementsArray_and_Type = 5; // Аналогично предыдущему, только идет массив элементов var changestype_2_ElementsArray_and_Type = 5; // Аналогично предыдущему, только идет массив элементов
function CLock()
{
this.Type = locktype_None;
this.UserId = null;
}
CLock.prototype =
{
Get_Type : function()
{
return this.Type;
},
Set_Type : function(NewType, Redraw)
{
if ( NewType === locktype_None )
this.UserId = null;
this.Type = NewType;
if ( false != Redraw )
{
// TODO: переделать перерисовку тут
var DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
DrawingDocument.ClearCachePages();
DrawingDocument.FirePaint();
}
},
Check : function(Id)
{
if ( this.Type === locktype_Mine )
CollaborativeEditing.Add_CheckLock( false );
else if ( this.Type === locktype_Other || this.Type === locktype_Other2 || this.Type === locktype_Other3 )
CollaborativeEditing.Add_CheckLock( true );
else
CollaborativeEditing.Add_CheckLock( Id );
},
Lock : function(bMine)
{
if ( locktype_None === this.Type )
{
if ( true === bMine )
this.Type = locktype_Mine;
else
true.Type = locktype_Other;
}
},
Is_Locked : function()
{
if ( locktype_None != this.Type && locktype_Mine != this.Type )
return true;
return false;
},
Set_UserId : function(UserId)
{
this.UserId = UserId;
},
Get_UserId : function()
{
return this.UserId;
},
Have_Changes : function()
{
if ( locktype_Other2 === this.Type || locktype_Other3 === this.Type )
return true;
return false;
}
}
var contentchanges_Add = 1; var contentchanges_Add = 1;
var contentchanges_Remove = 2; var contentchanges_Remove = 2;
...@@ -1043,46 +968,3 @@ CContentChangesElement.prototype = ...@@ -1043,46 +968,3 @@ CContentChangesElement.prototype =
return Positions; return Positions;
} }
}; };
function CContentChanges()
{
this.m_aChanges = [];
}
CContentChanges.prototype =
{
Add : function(Changes)
{
this.m_aChanges.push( Changes );
},
Clear : function()
{
this.m_aChanges.length = 0;
},
Check : function(Type, Pos)
{
var CurPos = Pos;
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
{
var NewPos = this.m_aChanges[Index].Check_Changes(Type, CurPos);
if ( false === NewPos )
return false;
CurPos = NewPos;
}
return CurPos;
},
Refresh : function()
{
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.m_aChanges[Index].Refresh_BinaryData();
}
}
};
\ 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