Commit 43b8afa3 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

разлиные баги

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55961 954022d7-b5bf-4e40-9824-e11837661b57
parent 3e77c1d3
......@@ -3060,6 +3060,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(this);
aObjects.push(drawingObject);
//drawingObject.graphicObject.addToDrawingObjects();
drawingObject.setGraphicObjectCoords();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
aBoundsCheckers.push(boundsChecker);
}
......
......@@ -330,8 +330,8 @@ DrawingObjectsController.prototype =
group.selection.textSelection = object;
}
this.changeCurrentState(new TextAddState(this, object));
if(e.ClickCount < 2)
this.updateSelectionState();
//if(e.ClickCount < 2)
this.updateSelectionState();
return true;
}
else
......@@ -1195,7 +1195,7 @@ DrawingObjectsController.prototype =
getTheme: function()
{
return this.draw
return window["Asc"]["editor"].wbModel.theme;
},
getParagraphTextPr: function()
......@@ -2457,8 +2457,8 @@ DrawingObjectsController.prototype =
this.recalculate();
}
}
this.drawingObjects.showDrawingObjects(true);
this.updateOverlay();
},
......@@ -3117,12 +3117,7 @@ DrawingObjectsController.prototype =
{
if(this.bNoResetSeclectionState === true)
return;
var count = this.selectedObjects.length;
while(count > 0)
{
this.selectedObjects[0].deselect(this);
--count;
}
this.resetSelection();
this.changeCurrentState(new NullState(this, this.drawingObjects));
this.updateSelectionState();
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
......@@ -3144,16 +3139,19 @@ DrawingObjectsController.prototype =
resetSelection: function()
{
var count = this.selectedObjects.length;
while(count > 0)
this.resetInternalSelection();
for(var i = 0; i < this.selectedObjects.length; ++i)
{
var selected_object = this.selectedObjects[0];
var old_group = selected_object.group;
selected_object.group = null;
this.selectedObjects[0].deselect(this);
selected_object.group = old_group;
--count;
this.selectedObjects[i].selected = false;
}
this.selectedObjects.length = 0;
this.selection =
{
selectedObjects: [],
groupSelection: null,
chartSelection: null,
textSelection: null
};
},
clearPreTrackObjects: function()
......@@ -3697,6 +3695,25 @@ DrawingObjectsController.prototype =
var ParaPr = this.getParagraphParaPr();
var TextPr = this.getParagraphTextPr();
if ( ParaPr && TextPr ) {
var theme = this.getTheme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(TextPr.FontFamily)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
if(TextPr.RFonts.Ascii)
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
if(TextPr.RFonts.EastAsia)
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
if(TextPr.RFonts.HAnsi)
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
if(TextPr.RFonts.CS)
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
}
}
this.prepareParagraphProperties(ParaPr, TextPr, ascSelectedObjects);
}
......
......@@ -63,6 +63,7 @@ StartAddNewShape.prototype =
asc["editor"].asc_endAddShape();
}
this.drawingObjects.clearTrackObjects();
this.drawingObjects.drawingObjects.showDrawingObjects(true);
this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
}
......@@ -83,7 +84,7 @@ NullState.prototype =
var b_no_handle_selected = false;
if(selection.groupSelection)
{
ret = handleSelectedObjects(this.drawingObjects, e, x, y, selection.groupSelection, pageIndex, true);
ret = handleSelectedObjects(this.drawingObjects, e, x, y, selection.groupSelection, pageIndex, false);
if(ret)
return ret;
ret = handleFloatObjects(this.drawingObjects, selection.groupSelection.arrGraphicObjects, e, x, y, selection.groupSelection, pageIndex, false);
......@@ -95,7 +96,6 @@ NullState.prototype =
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
this.drawingObjects.resetInternalSelection();
this.drawingObjects.updateOverlay();
}
if(!b_no_handle_selected)
{
......@@ -106,7 +106,9 @@ NullState.prototype =
ret = handleFloatObjects(this.drawingObjects, this.drawingObjects.getDrawingArray(), e, x, y, null, pageIndex, false);
if(ret)
{
return ret;
}
return null;
},
......@@ -348,7 +350,7 @@ PreMoveState.prototype =
this.onMouseUp(e, x, y, pageIndex);
return;
}
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.parent.pageIndex)
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.selectStartPage)
{
this.drawingObjects.swapTrackObjects();
this.drawingObjects.changeCurrentState(new MoveState(this.drawingObjects, this.majorObject, this.startX, this.startY));
......@@ -617,7 +619,7 @@ PreMoveInGroupState.prototype =
this.onMouseUp(e, x, y, pageIndex);
return;
}
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.parent.pageIndex)
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.selectStartPage)
{
this.drawingObjects.swapTrackObjects();
this.drawingObjects.changeCurrentState(new MoveInGroupState(this.drawingObjects, this.majorObject, this.group, this.startX, this.startY));
......
"use strict";
//----------------------------------------------------------------------------------- // Global counters //-----------------------------------------------------------------------------------
var locktype_None = 1; // никто не залочил данный объект var locktype_Mine = 2; // данный объект залочен текущим пользователем var locktype_Other = 3; // данный объект залочен другим(не текущим) пользователем var locktype_Other2 = 4; // данный объект залочен другим(не текущим) пользователем (обновления уже пришли) var locktype_Other3 = 5; // данный объект был залочен (обновления пришли) и снова стал залочен
function CLock(){ this.Type = locktype_None; this.UserId = null;
this.Get_Type = function() { return this.Type; };
this.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(); } };
this.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 ); };
this.Lock = function(bMine) { if ( locktype_None === this.Type ) { if ( true === bMine ) this.Type = locktype_Mine; else true.Type = locktype_Other; } };
this.Is_Locked = function() { if ( locktype_None != this.Type && locktype_Mine != this.Type ) return true;
return false; };
this.Set_UserId = function(UserId) { this.UserId = UserId; };
this.Get_UserId = function() { return this.UserId; };
this.Have_Changes = function() { if ( locktype_Other2 === this.Type || locktype_Other3 === this.Type ) return true;
return false; };}
function CIdCounter(){ this.m_sUserId = null; this.m_bLoad = true; this.m_nIdCounterLoad = 0; // Счетчик Id для загрузки this.m_nIdCounterEdit = 0; // Счетчик Id для работы
this.Get_NewId = function() { if ( true === this.m_bLoad || null === this.m_sUserId ) { this.m_nIdCounterLoad++; return ("" + this.m_nIdCounterLoad); } else { this.m_nIdCounterEdit++; var cur_id = ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); while(isRealObject(g_oTableId.Get_ById(cur_id))) { this.m_nIdCounterEdit++; cur_id = ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); } return cur_id; } };
this.Set_UserId = function(sUserId) { this.m_sUserId = sUserId; };
this.Set_Load = function(bValue) { this.m_bLoad = bValue; };}
function CTableId(){ this.m_aPairs = {}; this.m_bTurnOff = false;
this.Id = g_oIdCounter.Get_NewId(); this.Add(this, this.Id);}
CTableId.prototype ={ getObjectType: function() { return CLASS_TYPE_TABLE_ID; },
Add: function(Class, Id, sheetId) { if ( false === this.m_bTurnOff ) { Class.Id = Id; this.m_aPairs[Id] = Class; if(Class !== this && History instanceof CHistory) History.Add(g_oUndoRedoGraphicObjects, historyitem_TableId_Add, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoData_GTableIdAdd(Class, Id))); } },
Get_ById: function(Id) { if ( "undefined" != typeof(this.m_aPairs[Id]) ) return this.m_aPairs[Id];
return null; },
Get_ByClass: function(Class) { if ( "undefined" != typeof( Class.Get_Id ) ) return Class.Get_Id();
if ( "undefined" != typeof( Class.GetId() ) ) return Class.GetId();
return null; },
Reset_Id: function(Class, Id_new, Id_old) { if ( Class === this.m_aPairs[Id_old] ) { delete this.m_aPairs[Id_old]; this.m_aPairs[Id_new] = Class;
History.Add( this, { Type : historyitem_TableId_Reset, Id_new : Id_new, Id_old : Id_old } ); } else { this.Add( Class, Id_new ); } },
Get_Id: function() { return this.Id; },//----------------------------------------------------------------------------------- // Функции для работы с Undo/Redo //----------------------------------------------------------------------------------- Undo: function(Data) { // Ничего не делаем (можно удалять/добавлять ссылки на классы в данном классе // но это не обяательно, т.к. Id всегда уникальные) },
Redo: function(type, data) { switch(type) { case historyitem_TableId_Add: { if(isRealObject(this.m_aPairs[data.id]) && this.m_aPairs[data.id].Id === data.id) break; this.m_bTurnOff = true; var Id = data.id; var Class; switch (data.objectType) { case CLASS_TYPE_SHAPE: { Class = new CShape(); break; } case CLASS_TYPE_XFRM: { Class = new CXfrm(); break; } case CLASS_TYPE_GEOMETRY: { Class = new CGeometry(); break; }
case CLASS_TYPE_IMAGE: { Class = new CImageShape(); break; }
case CLASS_TYPE_GROUP: { Class = new CGroupShape(); break; } case CLASS_TYPE_PATH: { Class = new Path(); break; } case CLASS_TYPE_PARAGRAPH: { Class = new Paragraph(); break; } case CLASS_TYPE_TEXT_BODY: { Class = new CTextBody(); break; } case CLASS_TYPE_DOCUMENT_CONTENT: { Class = new CDocumentContent(); break; } case CLASS_TYPE_TEXT_PR: { Class = new ParaTextPr(); break; }
case CLASS_TYPE_UNI_FILL: { Class = new CUniFill(); break; }
case CLASS_TYPE_PATTERN_FILL: { Class = new CPattFill(); break; } case CLASS_TYPE_GRAD_FILL: {
Class = new CGradFill(); break; } case CLASS_TYPE_SOLID_FILL: {
Class = new CSolidFill(); break; } case CLASS_TYPE_UNI_COLOR: {
Class = new CUniColor(); break; } case CLASS_TYPE_SCHEME_COLOR : { Class = new CSchemeColor(); break; } case CLASS_TYPE_RGB_COLOR: { Class = new CRGBColor(); break; } case CLASS_TYPE_PRST_COLOR: { Class = new CPrstColor(); break; } case CLASS_TYPE_SYS_COLOR: { Class = new CSysColor(); break; } case CLASS_TYPE_LINE: { Class = new CLn(); break; } case CLASS_TYPE_CHART_AS_GROUP: { Class = new CChartAsGroup(); break; } case CLASS_TYPE_CHART_LEGEND: { Class = new CChartLegend(); break; } case CLASS_TYPE_CHART_TITLE: { Class = new CChartTitle(); break; } case CLASS_TYPE_COLOR_MOD: { Class = new CColorMod(); break; } case CLASS_TYPE_LEGEND_ENTRY: { Class = new CLegendEntry(); break; } case CLASS_TYPE_NO_FILL: { Class = new CNoFill(); break; } case CLASS_TYPE_GS: { Class = new CGs(); break; } case CLASS_TYPE_BLIP_FILL: { Class = new CBlipFill(); break; } case CLASS_TYPE_GRAD_LIN: { Class = new GradLin(); break; } case CLASS_TYPE_CHART_DATA: { Class = new asc_CChart(); break; } case CLASS_TYPE_CHART_LAYOUT: { Class = new CChartLayout(); break; } }
if(isRealObject(Class)) { Class.Id = Id; this.m_aPairs[Id] = Class; }
this.m_bTurnOff = false; break; } } // Ничего не делаем (можно удалять/добавлять ссылки на классы в данном классе // но это не обяательно, т.к. Id всегда уникальные) }, //----------------------------------------------------------------------------------- // Функции для работы с совместным редактирования //----------------------------------------------------------------------------------- Read_Class_FromBinary: function(Reader) { var ElementType = Reader.GetLong(); var Element = null;
// Временно отключаем регистрацию новых классов this.m_bTurnOff = true;
switch( ElementType ) { case historyitem_type_Paragraph : Element = new Paragraph(); break; case historyitem_type_TextPr : Element = new ParaTextPr(); break; case historyitem_type_Drawing : Element = new ParaDrawing(); break; //case historyitem_type_DrawingObjects : Element = new CDrawingObjects(); break; // case historyitem_type_FlowObjects : Element = new FlowObjects(); break; case historyitem_type_FlowImage : Element = new FlowImage(); 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; case historyitem_type_DocumentContent : Element = new CDocumentContent(); break; case historyitem_type_FlowTable : Element = new FlowTable(); break; case historyitem_type_HdrFtr : Element = new CHeaderFooter(); break; case historyitem_type_AbstractNum : Element = new CAbstractNum(); break; }
Element.Read_FromBinary2(Reader);
// Включаем назад регистрацию новых классов this.m_bTurnOff = false;
return Element; },
Save_Changes: function(Data, Writer) { // Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл. // Long : тип класса // Long : тип изменений
Writer.WriteLong( historyitem_type_TableId );
var Type = Data.Type;
// Пишем тип Writer.WriteLong( Type ); switch ( Type ) { case historyitem_TableId_Add : { // String : Id элемента // Varibale : сам элемент
Writer.WriteString2( Data.Id ); Data.Class.Write_ToBinary2( Writer );
break; }
case historyitem_TableId_Reset: { // String : Id_new // String : Id_old
Writer.WriteString2( Data.Id_new ); Writer.WriteString2( Data.Id_old );
break; } } },
Save_Changes2: function(Data, Writer) { return false; },
Load_Changes: function(Reader, Reader2) { // Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл. // Long : тип класса // Long : тип изменений
var ClassType = Reader.GetLong(); if ( historyitem_type_TableId != ClassType ) return;
var Type = Reader.GetLong();
switch ( Type ) { case historyitem_TableId_Add: { // String : Id элемента // Varibale : сам элемент
var Id = Reader.GetString2(); var Class = this.Read_Class_FromBinary( Reader );
this.m_aPairs[Id] = Class;
break; }
case historyitem_TableId_Reset: { // String : Id_new // String : Id_old
var Id_new = Reader.GetString2(); var Id_old = Reader.GetString2();
if ( "undefined" != this.m_aPairs[Id_old] ) { var Class = this.m_aPairs[Id_old]; delete this.m_aPairs[Id_old]; this.m_aPairs[Id_new] = Class; }
break; }
}
return true; },
Unlock: function(Data) { // Ничего не делаем } };
var g_oIdCounter = null;
var CLASS_TYPE_TABLE_ID = 0;var CLASS_TYPE_DOCUMENT_CONTENT = 1;var CLASS_TYPE_SHAPE = 2;var CLASS_TYPE_IMAGE = 3;var CLASS_TYPE_GROUP = 4;var CLASS_TYPE_XFRM = 5;var CLASS_TYPE_GEOMETRY = 6;var CLASS_TYPE_PATH = 7;var CLASS_TYPE_PARAGRAPH = 8;var CLASS_TYPE_TEXT_BODY = 9;var CLASS_TYPE_TEXT_PR = 10;var CLASS_TYPE_UNI_FILL = 11;var CLASS_TYPE_PATTERN_FILL = 12;var CLASS_TYPE_GRAD_FILL = 13;var CLASS_TYPE_SOLID_FILL = 14;var CLASS_TYPE_UNI_COLOR = 15;var CLASS_TYPE_SCHEME_COLOR = 16;var CLASS_TYPE_RGB_COLOR = 17;var CLASS_TYPE_PRST_COLOR = 18;var CLASS_TYPE_SYS_COLOR = 19;var CLASS_TYPE_LINE = 20;var CLASS_TYPE_CHART_AS_GROUP = 21;var CLASS_TYPE_CHART_LEGEND = 22;var CLASS_TYPE_CHART_TITLE = 23;var CLASS_TYPE_COLOR_MOD = 24;var CLASS_TYPE_LEGEND_ENTRY = 25;var CLASS_TYPE_CHART_DATA = 26;var CLASS_TYPE_NO_FILL = 27;var CLASS_TYPE_GS = 28;var CLASS_TYPE_GRAD_LIN = 29;var CLASS_TYPE_GRAD_PAT = 30;var CLASS_TYPE_BLIP_FILL = 31;var CLASS_TYPE_CHART_LAYOUT = 32;
var g_oTableId = null;
\ No newline at end of file
"use strict";//----------------------------------------------------------------------------------- // Global counters //----------------------------------------------------------------------------------- var locktype_None = 1; // никто не залочил данный объект var locktype_Mine = 2; // данный объект залочен текущим пользователем var locktype_Other = 3; // данный объект залочен другим(не текущим) пользователем var locktype_Other2 = 4; // данный объект залочен другим(не текущим) пользователем (обновления уже пришли) var locktype_Other3 = 5; // данный объект был залочен (обновления пришли) и снова стал залочен function CLock() { this.Type = locktype_None; this.UserId = null; this.Get_Type = function() { return this.Type; }; this.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(); } }; this.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 ); }; this.Lock = function(bMine) { if ( locktype_None === this.Type ) { if ( true === bMine ) this.Type = locktype_Mine; else true.Type = locktype_Other; } }; this.Is_Locked = function() { if ( locktype_None != this.Type && locktype_Mine != this.Type ) return true; return false; }; this.Set_UserId = function(UserId) { this.UserId = UserId; }; this.Get_UserId = function() { return this.UserId; }; this.Have_Changes = function() { if ( locktype_Other2 === this.Type || locktype_Other3 === this.Type ) return true; return false; }; } function CIdCounter() { this.m_sUserId = null; this.m_bLoad = true; this.m_nIdCounterLoad = 0; // Счетчик Id для загрузки this.m_nIdCounterEdit = 0; // Счетчик Id для работы this.Get_NewId = function() { if ( true === this.m_bLoad || null === this.m_sUserId ) { this.m_nIdCounterLoad++; return ("" + this.m_nIdCounterLoad); } else { this.m_nIdCounterEdit++; var cur_id = ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); while(isRealObject(g_oTableId.Get_ById(cur_id))) { this.m_nIdCounterEdit++; cur_id = ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); } return cur_id; } }; this.Set_UserId = function(sUserId) { this.m_sUserId = sUserId; }; this.Set_Load = function(bValue) { this.m_bLoad = bValue; }; } function CTableId() { this.m_aPairs = {}; this.m_bTurnOff = false; this.Id = g_oIdCounter.Get_NewId(); this.Add(this, this.Id); } CTableId.prototype = { getObjectType: function() { return CLASS_TYPE_TABLE_ID; }, Add: function(Class, Id, sheetId) { if ( false === this.m_bTurnOff ) { Class.Id = Id; this.m_aPairs[Id] = Class; if(Class !== this && History instanceof CHistory) History.Add(g_oUndoRedoGraphicObjects, historyitem_TableId_Add, null, null, new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoData_GTableIdAdd(Class, Id))); } }, Get_ById: function(Id) { if ( "undefined" != typeof(this.m_aPairs[Id]) ) return this.m_aPairs[Id]; return null; }, Get_ByClass: function(Class) { if ( "undefined" != typeof( Class.Get_Id ) ) return Class.Get_Id(); if ( "undefined" != typeof( Class.GetId() ) ) return Class.GetId(); return null; }, Reset_Id: function(Class, Id_new, Id_old) { if ( Class === this.m_aPairs[Id_old] ) { delete this.m_aPairs[Id_old]; this.m_aPairs[Id_new] = Class; History.Add( this, { Type : historyitem_TableId_Reset, Id_new : Id_new, Id_old : Id_old } ); } else { this.Add( Class, Id_new ); } }, Get_Id: function() { return this.Id; }, //----------------------------------------------------------------------------------- // Функции для работы с Undo/Redo //----------------------------------------------------------------------------------- Undo: function(Data) { // Ничего не делаем (можно удалять/добавлять ссылки на классы в данном классе // но это не обяательно, т.к. Id всегда уникальные) }, Redo: function(type, data) { switch(type) { case historyitem_TableId_Add: { if(isRealObject(this.m_aPairs[data.id]) && this.m_aPairs[data.id].Id === data.id) break; this.m_bTurnOff = true; var Id = data.id; var Class; if(isRealObject(Class)) { Class.Id = Id; this.m_aPairs[Id] = Class; } this.m_bTurnOff = false; break; } } // Ничего не делаем (можно удалять/добавлять ссылки на классы в данном классе // но это не обяательно, т.к. Id всегда уникальные) }, //----------------------------------------------------------------------------------- // Функции для работы с совместным редактирования //----------------------------------------------------------------------------------- Read_Class_FromBinary: function(Reader) { var ElementType = Reader.GetLong(); var Element = null; // Временно отключаем регистрацию новых классов this.m_bTurnOff = true; switch( ElementType ) { case historyitem_type_Paragraph : Element = new Paragraph(); break; case historyitem_type_TextPr : Element = new ParaTextPr(); break; case historyitem_type_Drawing : Element = new ParaDrawing(); break; //case historyitem_type_DrawingObjects : Element = new CDrawingObjects(); break; // case historyitem_type_FlowObjects : Element = new FlowObjects(); break; case historyitem_type_FlowImage : Element = new FlowImage(); 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; case historyitem_type_DocumentContent : Element = new CDocumentContent(); break; case historyitem_type_FlowTable : Element = new FlowTable(); break; case historyitem_type_HdrFtr : Element = new CHeaderFooter(); break; case historyitem_type_AbstractNum : Element = new CAbstractNum(); break; } Element.Read_FromBinary2(Reader); // Включаем назад регистрацию новых классов this.m_bTurnOff = false; return Element; }, Save_Changes: function(Data, Writer) { // Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл. // Long : тип класса // Long : тип изменений Writer.WriteLong( historyitem_type_TableId ); var Type = Data.Type; // Пишем тип Writer.WriteLong( Type ); switch ( Type ) { case historyitem_TableId_Add : { // String : Id элемента // Varibale : сам элемент Writer.WriteString2( Data.Id ); Data.Class.Write_ToBinary2( Writer ); break; } case historyitem_TableId_Reset: { // String : Id_new // String : Id_old Writer.WriteString2( Data.Id_new ); Writer.WriteString2( Data.Id_old ); break; } } }, Save_Changes2: function(Data, Writer) { return false; }, Load_Changes: function(Reader, Reader2) { // Сохраняем изменения из тех, которые используются для Undo/Redo в бинарный файл. // Long : тип класса // Long : тип изменений var ClassType = Reader.GetLong(); if ( historyitem_type_TableId != ClassType ) return; var Type = Reader.GetLong(); switch ( Type ) { case historyitem_TableId_Add: { // String : Id элемента // Varibale : сам элемент var Id = Reader.GetString2(); var Class = this.Read_Class_FromBinary( Reader ); this.m_aPairs[Id] = Class; break; } case historyitem_TableId_Reset: { // String : Id_new // String : Id_old var Id_new = Reader.GetString2(); var Id_old = Reader.GetString2(); if ( "undefined" != this.m_aPairs[Id_old] ) { var Class = this.m_aPairs[Id_old]; delete this.m_aPairs[Id_old]; this.m_aPairs[Id_new] = Class; } break; } } return true; }, Unlock: function(Data) { // Ничего не делаем } }; var g_oIdCounter = null; var CLASS_TYPE_TABLE_ID = 0; var CLASS_TYPE_DOCUMENT_CONTENT = 1; var CLASS_TYPE_SHAPE = 2; var CLASS_TYPE_IMAGE = 3; var CLASS_TYPE_GROUP = 4; var CLASS_TYPE_XFRM = 5; var CLASS_TYPE_GEOMETRY = 6; var CLASS_TYPE_PATH = 7; var CLASS_TYPE_PARAGRAPH = 8; var CLASS_TYPE_TEXT_BODY = 9; var CLASS_TYPE_TEXT_PR = 10; var CLASS_TYPE_UNI_FILL = 11; var CLASS_TYPE_PATTERN_FILL = 12; var CLASS_TYPE_GRAD_FILL = 13; var CLASS_TYPE_SOLID_FILL = 14; var CLASS_TYPE_UNI_COLOR = 15; var CLASS_TYPE_SCHEME_COLOR = 16; var CLASS_TYPE_RGB_COLOR = 17; var CLASS_TYPE_PRST_COLOR = 18; var CLASS_TYPE_SYS_COLOR = 19; var CLASS_TYPE_LINE = 20; var CLASS_TYPE_CHART_AS_GROUP = 21; var CLASS_TYPE_CHART_LEGEND = 22; var CLASS_TYPE_CHART_TITLE = 23; var CLASS_TYPE_COLOR_MOD = 24; var CLASS_TYPE_LEGEND_ENTRY = 25; var CLASS_TYPE_CHART_DATA = 26; var CLASS_TYPE_NO_FILL = 27; var CLASS_TYPE_GS = 28; var CLASS_TYPE_GRAD_LIN = 29; var CLASS_TYPE_GRAD_PAT = 30; var CLASS_TYPE_BLIP_FILL = 31; var CLASS_TYPE_CHART_LAYOUT = 32; var g_oTableId = null;
\ No newline at end of file
......
......@@ -251,8 +251,10 @@ DrawingObjectsController.prototype.onMouseDown = function(e, x, y)
{
e.ShiftKey = e.shiftKey;
e.CtrlKey = e.metaKey || e.ctrlKey;
return this.curState.onMouseDown(e, x, y, 0);
var ret = this.curState.onMouseDown(e, x, y, 0);
this.updateOverlay();
this.updateSelectionState();
return ret;
};
DrawingObjectsController.prototype.OnMouseDown = DrawingObjectsController.prototype.onMouseDown;
......@@ -332,7 +334,7 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(asc_chart, o
DrawingObjectsController.prototype.isPointInDrawingObjects = function(x, y, e)
{
this.handleEventMode = HANDLE_EVENT_MODE_CURSOR;
var ret = this.onMouseDown(e || {}, x, y);
var ret = this.curState.onMouseDown(e || {}, x, y);
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
return ret;
}
......
......@@ -6279,7 +6279,28 @@
selectionType = objectInfo.flags.selectionType = this.objectRender.getGraphicSelectionType(graphicObjects[0].Id);
var textPr = this.objectRender.controller.getParagraphTextPr();
var theme = this.objectRender.controller.getTheme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(textPr.FontFamily)
{
textPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(textPr.FontFamily.Name);
}
if(textPr.RFonts)
{
if(textPr.RFonts.Ascii)
textPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.Ascii.Name);
if(textPr.RFonts.EastAsia)
textPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.EastAsia.Name);
if(textPr.RFonts.HAnsi)
textPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.HAnsi.Name);
if(textPr.RFonts.CS)
textPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.CS.Name);
}
}
var paraPr = this.objectRender.controller.getParagraphParaPr();
var shape_props = this.objectRender.controller.getDrawingProps().shapeProps;
if (textPr && paraPr) {
objectInfo.text = this.objectRender.controller.Get_SelectedText();
......@@ -6291,14 +6312,17 @@
case align_Justify : horAlign = "justify"; break;
}
var vertAlign = "center";
switch (paraPr.anchor) {
case VERTICAL_ANCHOR_TYPE_BOTTOM: vertAlign = "bottom"; break;
case VERTICAL_ANCHOR_TYPE_CENTER: vertAlign = "center"; break;
case VERTICAL_ANCHOR_TYPE_TOP:
case VERTICAL_ANCHOR_TYPE_DISTRIBUTED:
case VERTICAL_ANCHOR_TYPE_JUSTIFIED: vertAlign = "top"; break;
}
if(shape_props)
{
switch (shape_props.verticalTextAlign) {
case VERTICAL_ANCHOR_TYPE_BOTTOM: vertAlign = "bottom"; break;
case VERTICAL_ANCHOR_TYPE_CENTER: vertAlign = "center"; break;
case VERTICAL_ANCHOR_TYPE_TOP:
case VERTICAL_ANCHOR_TYPE_DISTRIBUTED:
case VERTICAL_ANCHOR_TYPE_JUSTIFIED: vertAlign = "top"; break;
}
}
objectInfo.halign = horAlign;
objectInfo.valign = vertAlign;
......
......@@ -196,10 +196,9 @@ CChartSpace.prototype.createMoveTrack = CShape.prototype.createMoveTrack;
CChartSpace.prototype.getAspect = CShape.prototype.getAspect;
CChartSpace.prototype.getRectBounds = CShape.prototype.getRectBounds;
CChartSpace.prototype.draw = function(graphics)
/*CChartSpace.prototype.draw = function(graphics)
{
/*this.setRecalculateInfo();
this.recalculate();*/
var intGrid = graphics.GetIntegerGrid();
graphics.SetIntegerGrid(false);
graphics.transform3(this.transform, false);
......@@ -252,7 +251,7 @@ CChartSpace.prototype.draw = function(graphics)
}
}
};
}; */
CChartSpace.prototype.recalculate = function()
{
if(this.bDeleted)
......
......@@ -1844,22 +1844,7 @@ CGraphicObjects.prototype =
//TODO
},
resetSelection: function()
{
this.resetInternalSelection();
for(var i = 0; i < this.selectedObjects.length; ++i)
{
this.selectedObjects[i].selected = false;
}
this.selectedObjects.length = 0;
this.selection =
{
selectedObjects: [],
groupSelection: null,
chartSelection: null,
textSelection: null
};
},
resetSelection: DrawingObjectsController.prototype.resetSelection,
resetSelection2: function()
{
......
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