Commit 7c68ff8d authored by Alexander.Trofimov's avatar Alexander.Trofimov

Перенес инициализацию панели в класс asc_pane (сделано для возможности записи...

Перенес инициализацию панели в класс asc_pane (сделано для возможности записи в бинарник для сохранения).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55170 954022d7-b5bf-4e40-9824-e11837661b57
parent 5f39f5c1
...@@ -418,15 +418,15 @@ var c_oAscTypeSelectElement = { ...@@ -418,15 +418,15 @@ var c_oAscTypeSelectElement = {
}; };
var c_oAscLineBeginSize = { var c_oAscLineBeginSize = {
small_small : 0, small_small : 0,
small_mid : 1, small_mid : 1,
small_large : 2, small_large : 2,
mid_small : 3, mid_small : 3,
mid_mid : 4, mid_mid : 4,
mid_large : 5, mid_large : 5,
large_small : 6, large_small : 6,
large_mid : 7, large_mid : 7,
large_large : 8 large_large : 8
}; };
...@@ -436,40 +436,45 @@ var c_oAscFillGradType = { ...@@ -436,40 +436,45 @@ var c_oAscFillGradType = {
}; };
var c_oAscVerticalTextAlign = { var c_oAscVerticalTextAlign = {
TEXT_ALIGN_BOTTOM : 0,// (Text Anchor Enum ( Bottom )) TEXT_ALIGN_BOTTOM : 0, // (Text Anchor Enum ( Bottom ))
TEXT_ALIGN_CTR : 1,// (Text Anchor Enum ( Center )) TEXT_ALIGN_CTR : 1, // (Text Anchor Enum ( Center ))
TEXT_ALIGN_DIST : 2,// (Text Anchor Enum ( Distributed )) TEXT_ALIGN_DIST : 2, // (Text Anchor Enum ( Distributed ))
TEXT_ALIGN_JUST : 3,// (Text Anchor Enum ( Justified )) TEXT_ALIGN_JUST : 3, // (Text Anchor Enum ( Justified ))
TEXT_ALIGN_TOP : 4// Top TEXT_ALIGN_TOP : 4 // Top
}; };
// Chart defines // Chart defines
var c_oAscChartType = { var c_oAscChartType = {
line: "Line", line : "Line",
bar: "Bar", bar : "Bar",
hbar: "HBar", hbar : "HBar",
area: "Area", area : "Area",
pie: "Pie", pie : "Pie",
scatter: "Scatter", scatter : "Scatter",
stock: "Stock" stock : "Stock"
}; };
var c_oAscChartSubType = { var c_oAscChartSubType = {
normal: "normal", normal : "normal",
stacked: "stacked", stacked : "stacked",
stackedPer: "stackedPer" stackedPer : "stackedPer"
}; };
var c_oAscChartStyle = { var c_oAscChartStyle = {
Dark: 1, Dark : 1,
Standart: 2, Standart : 2,
Accent1: 3, Accent1 : 3,
Accent2: 4, Accent2 : 4,
Accent3: 5, Accent3 : 5,
Accent4: 6, Accent4 : 6,
Accent5: 7, Accent5 : 7,
Accent6: 8 Accent6 : 8
};
var c_oAscPaneState = {
Frozen : "frozen",
FrozenSplit : "frozenSplit"
}; };
var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0); var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0);
......
...@@ -6073,6 +6073,7 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -6073,6 +6073,7 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
res = this.bcr.Read1(length, function (t, l) { res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadPane(t, l, oSheetView.pane); return oThis.ReadPane(t, l, oSheetView.pane);
}); });
oSheetView.pane.init();
} else } else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
......
...@@ -126,7 +126,6 @@ UndoRedoItemSerializable.prototype = { ...@@ -126,7 +126,6 @@ UndoRedoItemSerializable.prototype = {
sTypeOf = "array"; sTypeOf = "array";
else else
sTypeOf = typeof(oItem); sTypeOf = typeof(oItem);
var bUnknown = false;
switch(sTypeOf) switch(sTypeOf)
{ {
case "object": case "object":
...@@ -492,6 +491,7 @@ UndoRedoData_CompositeFrozenCell.prototype = { ...@@ -492,6 +491,7 @@ UndoRedoData_CompositeFrozenCell.prototype = {
case this.Properties.frozenBefore: return this.frozenBefore; break; case this.Properties.frozenBefore: return this.frozenBefore; break;
case this.Properties.frozenAfter: return this.frozenAfter; break; case this.Properties.frozenAfter: return this.frozenAfter; break;
} }
return null;
}, },
setProperty: function(nType, value) { setProperty: function(nType, value) {
switch (nType) { switch (nType) {
...@@ -499,7 +499,7 @@ UndoRedoData_CompositeFrozenCell.prototype = { ...@@ -499,7 +499,7 @@ UndoRedoData_CompositeFrozenCell.prototype = {
case this.Properties.frozenAfter: this.frozenAfter = value; break; case this.Properties.frozenAfter: this.frozenAfter = value; break;
} }
} }
} };
// //
function UndoRedoData_CellSimpleData(nRow, nCol, oOldVal, oNewVal, sFormula){ function UndoRedoData_CellSimpleData(nRow, nCol, oOldVal, oNewVal, sFormula){
...@@ -573,6 +573,7 @@ UndoRedoData_CellData.prototype = { ...@@ -573,6 +573,7 @@ UndoRedoData_CellData.prototype = {
case this.Properties.value: return this.value;break; case this.Properties.value: return this.value;break;
case this.Properties.style: return this.style;break; case this.Properties.style: return this.style;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -618,6 +619,7 @@ UndoRedoData_CellValueData.prototype = { ...@@ -618,6 +619,7 @@ UndoRedoData_CellValueData.prototype = {
case this.Properties.formula: return this.formula;break; case this.Properties.formula: return this.formula;break;
case this.Properties.value: return this.value;break; case this.Properties.value: return this.value;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -654,6 +656,7 @@ UndoRedoData_FromToRowCol.prototype = { ...@@ -654,6 +656,7 @@ UndoRedoData_FromToRowCol.prototype = {
case this.Properties.from: return this.from;break; case this.Properties.from: return this.from;break;
case this.Properties.to: return this.to;break; case this.Properties.to: return this.to;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -705,6 +708,7 @@ UndoRedoData_FromTo.prototype = { ...@@ -705,6 +708,7 @@ UndoRedoData_FromTo.prototype = {
case this.Properties.to: return this.to;break; case this.Properties.to: return this.to;break;
case this.Properties.copyRange: return this.copyRange;break; case this.Properties.copyRange: return this.copyRange;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -744,6 +748,7 @@ UndoRedoData_FromToHyperlink.prototype = { ...@@ -744,6 +748,7 @@ UndoRedoData_FromToHyperlink.prototype = {
case this.Properties.to: return this.to;break; case this.Properties.to: return this.to;break;
case this.Properties.hyperlink: return this.hyperlink;break; case this.Properties.hyperlink: return this.hyperlink;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -794,6 +799,7 @@ UndoRedoData_IndexSimpleProp.prototype = { ...@@ -794,6 +799,7 @@ UndoRedoData_IndexSimpleProp.prototype = {
case this.Properties.index: return this.index;break; case this.Properties.index: return this.index;break;
case this.Properties.oNewVal: return this.oNewVal;break; case this.Properties.oNewVal: return this.oNewVal;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -858,6 +864,7 @@ UndoRedoData_ColProp.prototype = { ...@@ -858,6 +864,7 @@ UndoRedoData_ColProp.prototype = {
case this.Properties.CustomWidth: return this.CustomWidth;break; case this.Properties.CustomWidth: return this.CustomWidth;break;
case this.Properties.BestFit: return this.BestFit;break; case this.Properties.BestFit: return this.BestFit;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -913,6 +920,7 @@ UndoRedoData_RowProp.prototype = { ...@@ -913,6 +920,7 @@ UndoRedoData_RowProp.prototype = {
case this.Properties.hd: return this.hd;break; case this.Properties.hd: return this.hd;break;
case this.Properties.CustomHeight: return this.CustomHeight;break; case this.Properties.CustomHeight: return this.CustomHeight;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -965,6 +973,7 @@ UndoRedoData_BBox.prototype = { ...@@ -965,6 +973,7 @@ UndoRedoData_BBox.prototype = {
case this.Properties.c2: return this.c2;break; case this.Properties.c2: return this.c2;break;
case this.Properties.r2: return this.r2;break; case this.Properties.r2: return this.r2;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1009,6 +1018,7 @@ UndoRedoData_SortData.prototype = { ...@@ -1009,6 +1018,7 @@ UndoRedoData_SortData.prototype = {
case this.Properties.bbox: return this.bbox;break; case this.Properties.bbox: return this.bbox;break;
case this.Properties.places: return this.places;break; case this.Properties.places: return this.places;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1062,15 +1072,10 @@ UndoRedoData_GTableIdAdd.prototype = ...@@ -1062,15 +1072,10 @@ UndoRedoData_GTableIdAdd.prototype =
{ {
switch(nType) switch(nType)
{ {
case this.Properties.objectType: case this.Properties.objectType: return this.objectType;
{ case this.Properties.id: return this.id;
return this.objectType;
}
case this.Properties.id:
{
return this.id;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1121,19 +1126,11 @@ UndoRedoData_historyitem_Paragraph_AddItem.prototype = ...@@ -1121,19 +1126,11 @@ UndoRedoData_historyitem_Paragraph_AddItem.prototype =
{ {
switch (nType) switch (nType)
{ {
case this.Properties.startPos: case this.Properties.startPos: return this.startPos;
{ case this.Properties.endPos: return this.endPos;
return this.startPos; case this.Properties.itemsIds: return this.itemsIds;
}
case this.Properties.endPos:
{
return this.endPos;
}
case this.Properties.itemsIds:
{
return this.itemsIds;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1185,15 +1182,10 @@ UndoRedoDataDocContentAddItem.prototype = ...@@ -1185,15 +1182,10 @@ UndoRedoDataDocContentAddItem.prototype =
{ {
switch(nType) switch(nType)
{ {
case this.Properties.pos: case this.Properties.pos: return this.pos;
{ case this.Properties.objectId: return this.objectId;
return this.pos;
}
case this.Properties.objectId:
{
return this.objectId;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1240,12 +1232,9 @@ UndoRedoDataTypeParaItemId.prototype = ...@@ -1240,12 +1232,9 @@ UndoRedoDataTypeParaItemId.prototype =
{ {
switch(nType) switch(nType)
{ {
case this.Properties.itemId: case this.Properties.itemId: return this.itemId;
{
return this.itemId;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1289,15 +1278,10 @@ UndoRedoDataAddParaItem.prototype = ...@@ -1289,15 +1278,10 @@ UndoRedoDataAddParaItem.prototype =
{ {
switch(nType) switch(nType)
{ {
case this.Properties.type: case this.Properties.type: return this.type;
{ case this.Properties.value: return this.value;
return this.type;
}
case this.Properties.value:
{
return this.value;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1345,15 +1329,10 @@ UndoRedoDataDocContentRemoveItems.prototype = ...@@ -1345,15 +1329,10 @@ UndoRedoDataDocContentRemoveItems.prototype =
{ {
switch(nType) switch(nType)
{ {
case this.Properties.pos: case this.Properties.pos: return this.pos;
{ case this.Properties.aItems: return this.aItems;
return this.pos;
}
case this.Properties.aItems:
{
return this.aItems;
}
} }
return null;
}, },
setProperty: function(nType, value) setProperty: function(nType, value)
...@@ -1475,6 +1454,7 @@ UndoRedoDataParaPr.prototype = { ...@@ -1475,6 +1454,7 @@ UndoRedoDataParaPr.prototype = {
case this.Properties.NumPr : return this.NumPr ; case this.Properties.NumPr : return this.NumPr ;
case this.Properties.PStyle : return this.PStyle ; case this.Properties.PStyle : return this.PStyle ;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1542,6 +1522,7 @@ UndoRedoData_SheetAdd.prototype = { ...@@ -1542,6 +1522,7 @@ UndoRedoData_SheetAdd.prototype = {
case this.Properties.sheetidfrom: return this.sheetidfrom;break; case this.Properties.sheetidfrom: return this.sheetidfrom;break;
case this.Properties.sheetid: return this.sheetid;break; case this.Properties.sheetid: return this.sheetid;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1580,6 +1561,7 @@ UndoRedoData_SheetRemove.prototype = { ...@@ -1580,6 +1561,7 @@ UndoRedoData_SheetRemove.prototype = {
case this.Properties.sheetId: return this.sheetId;break; case this.Properties.sheetId: return this.sheetId;break;
case this.Properties.sheet: return this.sheet;break; case this.Properties.sheet: return this.sheet;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1612,6 +1594,7 @@ UndoRedoData_SheetPositions.prototype = { ...@@ -1612,6 +1594,7 @@ UndoRedoData_SheetPositions.prototype = {
{ {
case this.Properties.positions: return this.positions;break; case this.Properties.positions: return this.positions;break;
} }
return null;
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
{ {
...@@ -1703,6 +1686,7 @@ UndoRedoData_AutoFilter.prototype = { ...@@ -1703,6 +1686,7 @@ UndoRedoData_AutoFilter.prototype = {
case this.Properties.moveFrom: this.moveFrom = value;break; case this.Properties.moveFrom: this.moveFrom = value;break;
case this.Properties.moveTo: this.moveTo = value;break; case this.Properties.moveTo: this.moveTo = value;break;
} }
return null;
}, },
applyCollaborative : function (nSheetId, collaborativeEditing) { applyCollaborative : function (nSheetId, collaborativeEditing) {
this.activeCells.c1 = collaborativeEditing.getLockMeColumn2(nSheetId, this.activeCells.c1); this.activeCells.c1 = collaborativeEditing.getLockMeColumn2(nSheetId, this.activeCells.c1);
...@@ -1762,7 +1746,6 @@ var UndoRedoClassTypes = new function(){ ...@@ -1762,7 +1746,6 @@ var UndoRedoClassTypes = new function(){
}; };
function UndoRedoDataGraphicObjects(objectId, drawingData) function UndoRedoDataGraphicObjects(objectId, drawingData)
{ {
this.Properties = this.Properties =
...@@ -2583,7 +2566,6 @@ UndoRedoDataClosePath.prototype = ...@@ -2583,7 +2566,6 @@ UndoRedoDataClosePath.prototype =
}, },
getProperty : function (nType) getProperty : function (nType)
{ {
return null; return null;
}, },
setProperty : function (nType, value) setProperty : function (nType, value)
...@@ -3048,7 +3030,6 @@ UndoRedoWoorksheet.prototype = { ...@@ -3048,7 +3030,6 @@ UndoRedoWoorksheet.prototype = {
var nCol = Data.nCol; var nCol = Data.nCol;
if(bUndo) if(bUndo)
{ {
var sFormula = Data.sFormula
var cell = ws._getCellNoEmpty(nRow, nCol); var cell = ws._getCellNoEmpty(nRow, nCol);
if(cell) if(cell)
{ {
...@@ -3177,7 +3158,6 @@ UndoRedoWoorksheet.prototype = { ...@@ -3177,7 +3158,6 @@ UndoRedoWoorksheet.prototype = {
} }
else if(historyitem_Worksheet_ShiftCellsTop == Type || historyitem_Worksheet_ShiftCellsBottom == Type) else if(historyitem_Worksheet_ShiftCellsTop == Type || historyitem_Worksheet_ShiftCellsBottom == Type)
{ {
var bbox = Data;
var r1 = Data.r1; var r1 = Data.r1;
var c1 = Data.c1; var c1 = Data.c1;
var r2 = Data.r2; var r2 = Data.r2;
...@@ -3242,9 +3222,7 @@ UndoRedoWoorksheet.prototype = { ...@@ -3242,9 +3222,7 @@ UndoRedoWoorksheet.prototype = {
} }
if(false != this.wb.bCollaborativeChanges) if(false != this.wb.bCollaborativeChanges)
{ {
var collaborativeEditing = this.wb.oApi.collaborativeEditing, var coBBoxTo = Asc.Range(0, 0, 0, 0),
nSheetId = ws.getId(),
coBBoxTo = Asc.Range(0, 0, 0, 0),
coBBoxFrom = Asc.Range(0, 0, 0, 0); coBBoxFrom = Asc.Range(0, 0, 0, 0);
coBBoxTo.r1 = collaborativeEditing.getLockOtherRow2( nSheetId, to.r1); coBBoxTo.r1 = collaborativeEditing.getLockOtherRow2( nSheetId, to.r1);
...@@ -3493,7 +3471,7 @@ var g_oUndoRedoRow = null; ...@@ -3493,7 +3471,7 @@ var g_oUndoRedoRow = null;
var g_oUndoRedoCol = null; var g_oUndoRedoCol = null;
function UndoRedoRowCol(wb, bRow){ function UndoRedoRowCol(wb, bRow){
this.wb = wb; this.wb = wb;
this.bRow = bRow this.bRow = bRow;
this.nTypeRow = UndoRedoClassTypes.Add(function(){return g_oUndoRedoRow;}); this.nTypeRow = UndoRedoClassTypes.Add(function(){return g_oUndoRedoRow;});
this.nTypeCol = UndoRedoClassTypes.Add(function(){return g_oUndoRedoCol;}); this.nTypeCol = UndoRedoClassTypes.Add(function(){return g_oUndoRedoCol;});
} }
...@@ -3591,7 +3569,7 @@ UndoRedoRowCol.prototype = { ...@@ -3591,7 +3569,7 @@ UndoRedoRowCol.prototype = {
else if (historyitem_RowCol_SetCellStyle == Type) else if (historyitem_RowCol_SetCellStyle == Type)
row.setCellStyle(Val); row.setCellStyle(Val);
} }
} };
var g_oUndoRedoComment = null; var g_oUndoRedoComment = null;
function UndoRedoComment(wb){ function UndoRedoComment(wb){
......
...@@ -1011,6 +1011,8 @@ ...@@ -1011,6 +1011,8 @@
this.state = null; this.state = null;
this.topLeftCell = null; this.topLeftCell = null;
// CellAddress для удобства
this.topLeftFrozenCell = null;
return this; return this;
} }
...@@ -1018,8 +1020,17 @@ ...@@ -1018,8 +1020,17 @@
var res = new asc_CPane(); var res = new asc_CPane();
res.state = this.state; res.state = this.state;
res.topLeftCell = this.topLeftCell; res.topLeftCell = this.topLeftCell;
res.topLeftFrozenCell = this.topLeftFrozenCell ? new CellAddress(this.topLeftFrozenCell.id) : null;
return res; return res;
}; };
asc_CPane.prototype.init = function() {
// ToDo Обрабатываем пока только frozen и frozenSplit
if (c_oAscPaneState.Frozen === this.state || c_oAscPaneState.FrozenSplit === this.state) {
this.topLeftFrozenCell = new CellAddress(this.topLeftCell);
if (!this.topLeftFrozenCell.isValid())
this.topLeftFrozenCell = null;
}
};
function RedoObjectParam () { function RedoObjectParam () {
if (!(this instanceof RedoObjectParam)) { if (!(this instanceof RedoObjectParam)) {
......
...@@ -1212,17 +1212,9 @@ ...@@ -1212,17 +1212,9 @@
WorksheetView.prototype._initPane = function () { WorksheetView.prototype._initPane = function () {
var pane = this.model.sheetViews[0].pane; var pane = this.model.sheetViews[0].pane;
if (null !== pane) { if (null !== pane && null !== (this.topLeftFrozenCell = pane.topLeftFrozenCell)) {
// ToDo Обрабатываем пока только frozen и frozenSplit this.visibleRange.r1 = this.topLeftFrozenCell.getRow0();
if (kPaneStateFrozen === pane.state || kPaneStateFrozenSplit === pane.state) { this.visibleRange.c1 = this.topLeftFrozenCell.getCol0();
this.topLeftFrozenCell = new CellAddress(pane.topLeftCell);
if (!this.topLeftFrozenCell.isValid())
this.topLeftFrozenCell = null;
else {
this.visibleRange.r1 = this.topLeftFrozenCell.getRow0();
this.visibleRange.c1 = this.topLeftFrozenCell.getCol0();
}
}
} }
}; };
...@@ -3173,11 +3165,11 @@ ...@@ -3173,11 +3165,11 @@
_this.objectRender.objectLocker.reset(); _this.objectRender.objectLocker.reset();
_this.objectRender.objectLocker.addObjectId(_this.getFrozenCellId()); _this.objectRender.objectLocker.addObjectId(_this.getFrozenCellId());
_this.objectRender.objectLocker.checkObjects(callback); _this.objectRender.objectLocker.checkObjects(callback);
} };
WorksheetView.prototype.getFrozenCellId = function() { WorksheetView.prototype.getFrozenCellId = function() {
return "frozenCell_" + this.model.Id; return "frozenCell_" + this.model.Id;
} };
/** Для api закрепленных областей */ /** Для api закрепленных областей */
...@@ -3187,19 +3179,19 @@ ...@@ -3187,19 +3179,19 @@
this.visibleRange.r1 = 0; this.visibleRange.r1 = 0;
this.objectRender.drawingArea.init(); this.objectRender.drawingArea.init();
this.draw(); this.draw();
} };
WorksheetView.prototype.setSelectedFrozenCell = function() { WorksheetView.prototype.setSelectedFrozenCell = function() {
this.setFrozenCell(this.getSelectedColumnIndex(), this.getSelectedRowIndex(), true, true); this.setFrozenCell(this.getSelectedColumnIndex(), this.getSelectedRowIndex(), true, true);
} };
WorksheetView.prototype.setFirstFrozenCol = function() { WorksheetView.prototype.setFirstFrozenCol = function() {
this.setFrozenCell(1, 0, true, true); this.setFrozenCell(1, 0, true, true);
} };
WorksheetView.prototype.setFirstFrozenRow = function() { WorksheetView.prototype.setFirstFrozenRow = function() {
this.setFrozenCell(0, 1, true, true); this.setFrozenCell(0, 1, true, true);
} };
/** */ /** */
......
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