Commit 0c34e932 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Удалены ненужные файлы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55662 954022d7-b5bf-4e40-9824-e11837661b57
parent f984e470
......@@ -133,9 +133,8 @@ function CTableId()
{
case historyitem_type_Paragraph : Element = new Paragraph(); break;
case historyitem_type_TextPr : Element = new ParaTextPr(); break;
case historyitem_type_Hyperlink : if ( true !== Debug_ParaRunMode ) Element = new ParaHyperlinkStart(); else Element = new ParaHyperlink(); break;
case historyitem_type_Hyperlink : Element = new ParaHyperlink(); break;
case historyitem_type_Drawing : Element = new ParaDrawing(); break;
case historyitem_type_DrawingObjects : Element = new CDrawingObjects(); break;
case historyitem_type_Table : Element = new CTable(); break;
case historyitem_type_TableRow : Element = new CTableRow(); break;
case historyitem_type_TableCell : Element = new CTableCell(); break;
......
......@@ -474,11 +474,6 @@ function CDocument(DrawingDocument)
this.NeedUpdateTarget = false;
// Массив укзателей на все инлайновые графические объекты
this.DrawingObjects = null;
if (typeof CDrawingObjects !== "undefined")
this.DrawingObjects = new CDrawingObjects();
// Класс для работы с колонтитулами
this.HdrFtr = new CHeaderFooterController(this, this.DrawingDocument);
......@@ -513,6 +508,9 @@ function CDocument(DrawingDocument)
this.m_oContentChanges = new CContentChanges(); // список изменений(добавление/удаление элементов)
// Массив укзателей на все инлайновые графические объекты
this.DrawingObjects = null;
if (typeof CGraphicObjects !== "undefined")
this.DrawingObjects = new CGraphicObjects(this, this.DrawingDocument, editor);
this.theme = GenerateDefaultTheme(this);
......
This diff is collapsed.
/**
* User: Ilja.Kirillov
* Date: 24.04.12
* Time: 13:05
*/
function CDrawingObjects()
{
this.Id = g_oIdCounter.Get_NewId();
this.Objects = new Array();
// Id ( )
g_oTableId.Add( this, this.Id );
}
CDrawingObjects.prototype =
{
Set_Id : function(newId)
{
g_oTableId.Reset_Id(this, newId, this.Id);
this.Id = newId;
},
Get_Id : function()
{
return this.Id;
},
Add : function(DrawingObj)
{
History.Add( this, { Type : historyitem_DrawingObjects_AddItem, Pos : this.Objects.length, Item : DrawingObj } );
this.Objects.push( DrawingObj );
return this.Objects.length - 1;
},
Remove_ByPos : function(Pos)
{
History.Add( this, { Type : historyitem_DrawingObjects_RemoveItem, Pos : Pos, Items : [ this.Objects[Pos] ] } );
this.Objects.splice( Pos, 1 );
},
IsPointIn : function (X,Y, PageIndex)
{
for ( var Index = 0; Index < this.Objects.length; Index++ )
{
if ( true === this.Objects[Index].IsPointIn( X, Y, PageIndex ) )
return Index;
}
return -1;
},
Get_ById : function (Id)
{
for ( var Index = 0; Index < this.Objects.length; Index++ )
{
if ( Id === this.Objects[Index].Get_Id() )
{
return this.Objects[Index];
}
}
return null
},
Get_ByIndex :function (Index)
{
if ( Index < 0 || Index >= this.Objects.length )
return null;
return this.Objects[Index];
},
Remove_ById :function (Id)
{
for ( var Index = 0; Index < this.Objects.length; Index++ )
{
if ( Id === this.Objects[Index].Get_Id() )
{
this.Remove_ByPos( Index );
}
}
},
Remove_All : function()
{
if ( this.Objects.length > 0 )
{
History.Add( this, { Type : historyitem_DrawingObjects_RemoveItem, Pos : 0, Items : this.Objects } );
this.Objects = new Array();
}
},
Get_Count : function()
{
return this.Objects.length;
},
//-----------------------------------------------------------------------------------
// Undo/Redo
//-----------------------------------------------------------------------------------
Undo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case historyitem_DrawingObjects_AddItem:
{
this.Objects.splice( Data.Pos, 1 );
break;
}
case historyitem_DrawingObjects_RemoveItem:
{
var Array_start = this.Objects.slice( 0, Data.Pos );
var Array_end = this.Objects.slice( Data.Pos );
this.Objects = Array_start.concat( Data.Items, Array_end );
break;
}
}
},
Redo : function(Data)
{
var Type = Data.Type;
switch ( Type )
{
case historyitem_DrawingObjects_AddItem:
{
this.Objects.splice( Data.Pos, 0, Data.Item );
break;
}
case historyitem_DrawingObjects_RemoveItem:
{
this.Objects.splice( Data.Pos, Data.Items.length );
break;
}
}
},
//-----------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------
Save_Changes : function(Data, Writer)
{
// , Undo/Redo .
// Long :
// Long :
Writer.WriteLong( historyitem_type_DrawingObjects );
var Type = Data.Type;
//
Writer.WriteLong( Type );
switch ( Type )
{
case historyitem_DrawingObjects_AddItem:
{
// String : Id ( , )
// String : Id
if ( 0 === Data.Pos )
Writer.WriteString2("");
else
Writer.WriteString2( this.Objects[Data.Pos - 1].Get_Id() );
Writer.WriteString2( Data.Item.Get_Id() );
break;
}
case historyitem_DrawingObjects_RemoveItem:
{
// Long :
// Array string : Id
var Count = Data.Items.length;
Writer.WriteLong( Count );
for ( var Index = 0; Index < Count; Index++ )
Writer.WriteString2( Data.Items[Index].Get_Id() );
break;
}
}
return Writer;
},
Load_Changes : function(Reader)
{
// , Undo/Redo .
// Long :
// Long :
var ClassType = Reader.GetLong();
if ( historyitem_type_DrawingObjects != ClassType )
return;
var Type = Reader.GetLong();
switch ( Type )
{
case historyitem_DrawingObjects_AddItem:
{
// String : Id ( , )
// String : Id
var PrevId = Reader.GetString2();
var PrevPos = 0;
if ( "" != PrevId )
{
var ObjectCount = this.Objects.length;
for ( var Index = 0; Index < ObjectCount; Index++ )
{
if ( this.Objects[Index].Get_Id() === PrevId )
{
PrevPos = Index;
break;
}
}
}
var LinkData = new Object();
LinkData.Type = historyitem_DrawingObjects_AddItem;
LinkData.Pos = PrevPos;
LinkData.Id = Reader.GetString2();
CollaborativeEditing.Add_LinkData( this, LinkData );
break;
}
case historyitem_DrawingObjects_RemoveItem:
{
// Long :
// Array string : Id
var Count = Reader.GetLong();
for ( var Index = 0; Index < Count; Index++ )
{
var Id = Reader.GetString2();
var ObjectCount = this.Objects.length;
for ( var Index = 0; Index < ObjectCount; Index++ )
{
if ( this.Objects[Index].Get_Id() === Id )
{
this.Objects.splice( Index, 1 );
break;
}
}
}
break;
}
}
},
Write_ToBinary2 : function(Writer)
{
Writer.WriteLong( historyitem_type_DrawingObjects );
// String : Id
Writer.WriteString2( this.Id );
},
Read_FromBinary2 : function(Reader)
{
// String : Id
this.Id = Reader.GetString2();
},
Load_LinkData : function(LinkData)
{
if ( LinkData.Type === historyitem_DrawingObjects_AddItem )
{
var Object = g_oTableId.Get_ById( LinkData.Id );
this.Objects.splice( LinkData.Pos, 0, Object );
}
}
};
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