Commit a6d14824 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил баг с бесконечным скроллом в всплывающем списке формул (Баг...

Поправил баг с бесконечным скроллом в всплывающем списке формул (Баг http://bugzserver/show_bug.cgi?id=24606)
refactoring

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56564 954022d7-b5bf-4e40-9824-e11837661b57
parent e3a02c0f
...@@ -660,7 +660,7 @@ ...@@ -660,7 +660,7 @@
var EHorizontalAlignment = var EHorizontalAlignment =
{ {
horizontalalignmentCenter: 0, horizontalalignmentCenter: 0,
horizontalalignmentcenterContinuous: 1, horizontalalignmentContinuous: 1,
horizontalalignmentDistributed: 2, horizontalalignmentDistributed: 2,
horizontalalignmentFill: 3, horizontalalignmentFill: 3,
horizontalalignmentGeneral: 4, horizontalalignmentGeneral: 4,
...@@ -959,14 +959,13 @@ ...@@ -959,14 +959,13 @@
{ {
var rangeTable = null; var rangeTable = null;
//get range for copy/paste //get range for copy/paste
if(this.isCopyPaste) if (this.isCopyPaste)
{ rangeTable = aTables[i].Ref;
var rangeTable = aTables[i].Ref;
}
if(!this.isCopyPaste || (this.isCopyPaste && rangeTable && this.isCopyPaste.containsRange(rangeTable))) if(!this.isCopyPaste || (this.isCopyPaste && rangeTable && this.isCopyPaste.containsRange(rangeTable)))
this.bs.WriteItem(c_oSer_TablePart.Table, function(){oThis.WriteTable(aTables[i]);}); this.bs.WriteItem(c_oSer_TablePart.Table, function(){oThis.WriteTable(aTables[i]);});
} }
} };
this.WriteTable = function(table) this.WriteTable = function(table)
{ {
var oThis = this; var oThis = this;
...@@ -1000,7 +999,7 @@ ...@@ -1000,7 +999,7 @@
//TableStyleInfo //TableStyleInfo
if(null != table.TableStyleInfo) if(null != table.TableStyleInfo)
this.bs.WriteItem(c_oSer_TablePart.TableStyleInfo, function(){oThis.WriteTableStyleInfo(table.TableStyleInfo);}); this.bs.WriteItem(c_oSer_TablePart.TableStyleInfo, function(){oThis.WriteTableStyleInfo(table.TableStyleInfo);});
} };
this.WriteAutoFilter = function(autofilter) this.WriteAutoFilter = function(autofilter)
{ {
var oThis = this; var oThis = this;
...@@ -1016,13 +1015,13 @@ ...@@ -1016,13 +1015,13 @@
//SortState //SortState
if(null != autofilter.SortState) if(null != autofilter.SortState)
this.bs.WriteItem(c_oSer_AutoFilter.SortState, function(){oThis.WriteSortState(autofilter.SortState);}); this.bs.WriteItem(c_oSer_AutoFilter.SortState, function(){oThis.WriteSortState(autofilter.SortState);});
} };
this.WriteFilterColumns = function(filterColumns) this.WriteFilterColumns = function(filterColumns)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = filterColumns.length; i < length; ++i) for(var i = 0, length = filterColumns.length; i < length; ++i)
this.bs.WriteItem(c_oSer_AutoFilter.FilterColumn, function(){oThis.WriteFilterColumn(filterColumns[i]);}); this.bs.WriteItem(c_oSer_AutoFilter.FilterColumn, function(){oThis.WriteFilterColumn(filterColumns[i]);});
} };
this.WriteFilterColumn = function(filterColumn) this.WriteFilterColumn = function(filterColumn)
{ {
var oThis = this; var oThis = this;
...@@ -1047,7 +1046,7 @@ ...@@ -1047,7 +1046,7 @@
//ShowButton //ShowButton
if(null != filterColumn.ShowButton) if(null != filterColumn.ShowButton)
this.bs.WriteItem(c_oSer_FilterColumn.ShowButton, function(){oThis.memory.WriteBool(filterColumn.ShowButton);}); this.bs.WriteItem(c_oSer_FilterColumn.ShowButton, function(){oThis.memory.WriteBool(filterColumn.ShowButton);});
} };
this.WriteFilters = function(filters) this.WriteFilters = function(filters)
{ {
var oThis = this; var oThis = this;
...@@ -1063,19 +1062,17 @@ ...@@ -1063,19 +1062,17 @@
} }
if(null != filters.Blank) if(null != filters.Blank)
this.bs.WriteItem(c_oSer_FilterColumn.FiltersBlank, function(){oThis.memory.WriteBool(filters.Blank);}); this.bs.WriteItem(c_oSer_FilterColumn.FiltersBlank, function(){oThis.memory.WriteBool(filters.Blank);});
} };
this.WriteFilter = function(val) this.WriteFilter = function(val)
{ {
var oThis = this;
if(null != val) if(null != val)
{ {
this.memory.WriteByte(c_oSer_Filter.Val); this.memory.WriteByte(c_oSer_Filter.Val);
this.memory.WriteString2(val); this.memory.WriteString2(val);
} }
} };
this.WriteDateGroupItem = function(dateGroupItem) this.WriteDateGroupItem = function(dateGroupItem)
{ {
var oThis = this;
if(null != dateGroupItem.DateTimeGrouping) if(null != dateGroupItem.DateTimeGrouping)
{ {
this.memory.WriteByte(c_oSer_DateGroupItem.DateTimeGrouping); this.memory.WriteByte(c_oSer_DateGroupItem.DateTimeGrouping);
...@@ -1118,7 +1115,7 @@ ...@@ -1118,7 +1115,7 @@
this.memory.WriteByte(c_oSerPropLenType.Long); this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(dateGroupItem.Year); this.memory.WriteLong(dateGroupItem.Year);
} }
} };
this.WriteCustomFilters = function(customFilters) this.WriteCustomFilters = function(customFilters)
{ {
var oThis = this; var oThis = this;
...@@ -1126,16 +1123,15 @@ ...@@ -1126,16 +1123,15 @@
this.bs.WriteItem(c_oSer_CustomFilters.And, function(){oThis.memory.WriteBool(customFilters.And);}); this.bs.WriteItem(c_oSer_CustomFilters.And, function(){oThis.memory.WriteBool(customFilters.And);});
if(null != customFilters.CustomFilters && customFilters.CustomFilters.length > 0) if(null != customFilters.CustomFilters && customFilters.CustomFilters.length > 0)
this.bs.WriteItem(c_oSer_CustomFilters.CustomFilters, function(){oThis.WriteCustomFiltersItems(customFilters.CustomFilters);}); this.bs.WriteItem(c_oSer_CustomFilters.CustomFilters, function(){oThis.WriteCustomFiltersItems(customFilters.CustomFilters);});
} };
this.WriteCustomFiltersItems = function(aCustomFilters) this.WriteCustomFiltersItems = function(aCustomFilters)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = aCustomFilters.length; i < length; ++i) for(var i = 0, length = aCustomFilters.length; i < length; ++i)
this.bs.WriteItem(c_oSer_CustomFilters.CustomFilter, function(){oThis.WriteCustomFiltersItem(aCustomFilters[i]);}); this.bs.WriteItem(c_oSer_CustomFilters.CustomFilter, function(){oThis.WriteCustomFiltersItem(aCustomFilters[i]);});
} };
this.WriteCustomFiltersItem = function(customFilter) this.WriteCustomFiltersItem = function(customFilter)
{ {
var oThis = this;
if(null != customFilter.Operator) if(null != customFilter.Operator)
{ {
this.memory.WriteByte(c_oSer_CustomFilters.Operator); this.memory.WriteByte(c_oSer_CustomFilters.Operator);
...@@ -1148,10 +1144,9 @@ ...@@ -1148,10 +1144,9 @@
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(customFilter.Val); this.memory.WriteString2(customFilter.Val);
} }
} };
this.WriteDynamicFilter = function(dynamicFilter) this.WriteDynamicFilter = function(dynamicFilter)
{ {
var oThis = this;
if(null != dynamicFilter.Type) if(null != dynamicFilter.Type)
{ {
this.memory.WriteByte(c_oSer_DynamicFilter.Type); this.memory.WriteByte(c_oSer_DynamicFilter.Type);
...@@ -1170,10 +1165,9 @@ ...@@ -1170,10 +1165,9 @@
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(dynamicFilter.MaxVal); this.memory.WriteDouble2(dynamicFilter.MaxVal);
} }
} };
this.WriteColorFilter = function(colorFilter) this.WriteColorFilter = function(colorFilter)
{ {
var oThis = this;
if(null != colorFilter.CellColor) if(null != colorFilter.CellColor)
{ {
this.memory.WriteByte(c_oSer_ColorFilter.CellColor); this.memory.WriteByte(c_oSer_ColorFilter.CellColor);
...@@ -1187,10 +1181,9 @@ ...@@ -1187,10 +1181,9 @@
this.memory.WriteLong(this.aDxfs.length); this.memory.WriteLong(this.aDxfs.length);
this.aDxfs.push(colorFilter.dxf); this.aDxfs.push(colorFilter.dxf);
} }
} };
this.WriteTop10 = function(top10) this.WriteTop10 = function(top10)
{ {
var oThis = this;
if(null != top10.FilterVal) if(null != top10.FilterVal)
{ {
this.memory.WriteByte(c_oSer_Top10.FilterVal); this.memory.WriteByte(c_oSer_Top10.FilterVal);
...@@ -1215,7 +1208,7 @@ ...@@ -1215,7 +1208,7 @@
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(top10.Val); this.memory.WriteDouble2(top10.Val);
} }
} };
this.WriteSortState = function(sortState) this.WriteSortState = function(sortState)
{ {
var oThis = this; var oThis = this;
...@@ -1228,16 +1221,15 @@ ...@@ -1228,16 +1221,15 @@
this.bs.WriteItem(c_oSer_SortState.CaseSensitive, function(){oThis.memory.WriteBool(sortState.CaseSensitive);}); this.bs.WriteItem(c_oSer_SortState.CaseSensitive, function(){oThis.memory.WriteBool(sortState.CaseSensitive);});
if(null != sortState.SortConditions) if(null != sortState.SortConditions)
this.bs.WriteItem(c_oSer_SortState.SortConditions, function(){oThis.WriteSortConditions(sortState.SortConditions);}); this.bs.WriteItem(c_oSer_SortState.SortConditions, function(){oThis.WriteSortConditions(sortState.SortConditions);});
} };
this.WriteSortConditions = function(sortConditions) this.WriteSortConditions = function(sortConditions)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = sortConditions.length; i < length; ++i) for(var i = 0, length = sortConditions.length; i < length; ++i)
this.bs.WriteItem(c_oSer_SortState.SortCondition, function(){oThis.WriteSortCondition(sortConditions[i]);}); this.bs.WriteItem(c_oSer_SortState.SortCondition, function(){oThis.WriteSortCondition(sortConditions[i]);});
} };
this.WriteSortCondition = function(sortCondition) this.WriteSortCondition = function(sortCondition)
{ {
var oThis = this;
if(null != sortCondition.Ref) if(null != sortCondition.Ref)
{ {
this.memory.WriteByte(c_oSer_SortState.ConditionRef); this.memory.WriteByte(c_oSer_SortState.ConditionRef);
...@@ -1263,13 +1255,13 @@ ...@@ -1263,13 +1255,13 @@
this.memory.WriteLong(this.aDxfs.length); this.memory.WriteLong(this.aDxfs.length);
this.aDxfs.push(sortCondition.dxf); this.aDxfs.push(sortCondition.dxf);
} }
} };
this.WriteTableColumns = function(tableColumns) this.WriteTableColumns = function(tableColumns)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = tableColumns.length; i < length; ++i) for(var i = 0, length = tableColumns.length; i < length; ++i)
this.bs.WriteItem(c_oSer_TableColumns.TableColumn, function(){oThis.WriteTableColumn(tableColumns[i]);}); this.bs.WriteItem(c_oSer_TableColumns.TableColumn, function(){oThis.WriteTableColumn(tableColumns[i]);});
} };
this.WriteTableColumn = function(tableColumn) this.WriteTableColumn = function(tableColumn)
{ {
var oThis = this; var oThis = this;
...@@ -1301,10 +1293,9 @@ ...@@ -1301,10 +1293,9 @@
this.memory.WriteByte(c_oSer_TableColumns.CalculatedColumnFormula); this.memory.WriteByte(c_oSer_TableColumns.CalculatedColumnFormula);
this.memory.WriteString2(tableColumn.CalculatedColumnFormula); this.memory.WriteString2(tableColumn.CalculatedColumnFormula);
} }
} };
this.WriteTableStyleInfo = function(tableStyleInfo) this.WriteTableStyleInfo = function(tableStyleInfo)
{ {
var oThis = this;
if(null != tableStyleInfo.Name) if(null != tableStyleInfo.Name)
{ {
this.memory.WriteByte(c_oSer_TableStyleInfo.Name); this.memory.WriteByte(c_oSer_TableStyleInfo.Name);
...@@ -1930,7 +1921,7 @@ ...@@ -1930,7 +1921,7 @@
{ {
this.bs.WriteItem(c_oSer_TableStyles.TableStyles, function(){oThis.WriteTableCustomStyles(tableStyles.CustomStyles);}); this.bs.WriteItem(c_oSer_TableStyles.TableStyles, function(){oThis.WriteTableCustomStyles(tableStyles.CustomStyles);});
} }
} };
this.WriteTableCustomStyles = function(customStyles) this.WriteTableCustomStyles = function(customStyles)
{ {
var oThis = this; var oThis = this;
...@@ -1939,7 +1930,7 @@ ...@@ -1939,7 +1930,7 @@
var style = customStyles[i]; var style = customStyles[i];
this.bs.WriteItem(c_oSer_TableStyles.TableStyle, function(){oThis.WriteTableCustomStyle(style);}); this.bs.WriteItem(c_oSer_TableStyles.TableStyle, function(){oThis.WriteTableCustomStyle(style);});
} }
} };
this.WriteTableCustomStyle = function(customStyle) this.WriteTableCustomStyle = function(customStyle)
{ {
var oThis = this; var oThis = this;
...@@ -1954,7 +1945,7 @@ ...@@ -1954,7 +1945,7 @@
this.bs.WriteItem(c_oSer_TableStyle.Table, function(){oThis.memory.WriteBool(customStyle.table);}); this.bs.WriteItem(c_oSer_TableStyle.Table, function(){oThis.memory.WriteBool(customStyle.table);});
this.bs.WriteItem(c_oSer_TableStyle.Elements, function(){oThis.WriteTableCustomStyleElements(customStyle);}); this.bs.WriteItem(c_oSer_TableStyle.Elements, function(){oThis.WriteTableCustomStyleElements(customStyle);});
} };
this.WriteTableCustomStyleElements = function(customStyle) this.WriteTableCustomStyleElements = function(customStyle)
{ {
var oThis = this; var oThis = this;
...@@ -2014,7 +2005,7 @@ ...@@ -2014,7 +2005,7 @@
this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeTotalRow, customStyle.totalRow);}); this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeTotalRow, customStyle.totalRow);});
if(null != customStyle.wholeTable) if(null != customStyle.wholeTable)
this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeWholeTable, customStyle.wholeTable);}); this.bs.WriteItem(c_oSer_TableStyle.Element, function(){oThis.WriteTableCustomStyleElement(ETableStyleType.tablestyletypeWholeTable, customStyle.wholeTable);});
} };
this.WriteTableCustomStyleElement = function(type, customElement) this.WriteTableCustomStyleElement = function(type, customElement)
{ {
if(null != type) if(null != type)
...@@ -2036,7 +2027,7 @@ ...@@ -2036,7 +2027,7 @@
this.memory.WriteLong(this.aDxfs.length); this.memory.WriteLong(this.aDxfs.length);
this.aDxfs.push(customElement.dxf); this.aDxfs.push(customElement.dxf);
} }
} };
} }
function BinaryWorkbookTableWriter(memory, wb) function BinaryWorkbookTableWriter(memory, wb)
{ {
...@@ -2185,7 +2176,7 @@ ...@@ -2185,7 +2176,7 @@
this._getCrc32FromObjWithProperty = function(val) this._getCrc32FromObjWithProperty = function(val)
{ {
return Asc.crc32(this._getStringFromObjWithProperty(val)); return Asc.crc32(this._getStringFromObjWithProperty(val));
} };
this._getStringFromObjWithProperty = function(val) this._getStringFromObjWithProperty = function(val)
{ {
var sRes = ""; var sRes = "";
...@@ -2316,7 +2307,7 @@ ...@@ -2316,7 +2307,7 @@
//activeRange(serialize activeRange) //activeRange(serialize activeRange)
if(oThis.isCopyPaste) if(oThis.isCopyPaste)
{ {
var activeRange = (new CellAddress(oThis.isCopyPaste.r1, oThis.isCopyPaste.c1, 0)).getID() + ":" + (new CellAddress(oThis.isCopyPaste.r2, oThis.isCopyPaste.c2, 0)).getID() var activeRange = (new CellAddress(oThis.isCopyPaste.r1, oThis.isCopyPaste.c1, 0)).getID() + ":" + (new CellAddress(oThis.isCopyPaste.r2, oThis.isCopyPaste.c2, 0)).getID();
this.memory.WriteByte(c_oSerWorksheetPropTypes.Ref); this.memory.WriteByte(c_oSerWorksheetPropTypes.Ref);
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(activeRange); this.memory.WriteString2(activeRange);
...@@ -2345,7 +2336,7 @@ ...@@ -2345,7 +2336,7 @@
if(null != col.xfs) if(null != col.xfs)
oRes.xfsid = oThis.prepareXfs(col.xfs); oRes.xfsid = oThis.prepareXfs(col.xfs);
return oRes; return oRes;
} };
var oAllCol = null; var oAllCol = null;
if(null != ws.oAllCol) if(null != ws.oAllCol)
{ {
...@@ -2661,7 +2652,6 @@ ...@@ -2661,7 +2652,6 @@
}; };
this.WriteMergeCells = function(ws) this.WriteMergeCells = function(ws)
{ {
var oThis = this;
var oMerged = ws.mergeManager.getAll(); var oMerged = ws.mergeManager.getAll();
for(var i in oMerged) for(var i in oMerged)
{ {
...@@ -2729,7 +2719,7 @@ ...@@ -2729,7 +2719,7 @@
this.WriteGraphicFrame = function (oDrawing) { this.WriteGraphicFrame = function (oDrawing) {
var oBinaryChartWriter = new BinaryChartWriter(this.memory); var oBinaryChartWriter = new BinaryChartWriter(this.memory);
this.bs.WriteItem(c_oSer_DrawingType.Chart2, function () { oBinaryChartWriter.WriteCT_ChartSpace(oDrawing.graphicObject); }); this.bs.WriteItem(c_oSer_DrawingType.Chart2, function () { oBinaryChartWriter.WriteCT_ChartSpace(oDrawing.graphicObject); });
} };
this.WriteFromTo = function(oFromTo) this.WriteFromTo = function(oFromTo)
{ {
if(null != oFromTo.col) if(null != oFromTo.col)
...@@ -2863,8 +2853,8 @@ ...@@ -2863,8 +2853,8 @@
//сохраняем как и Excel даже пустой стиль(нужно чтобы убрать стиль строки/колонки) //сохраняем как и Excel даже пустой стиль(нужно чтобы убрать стиль строки/колонки)
if(null != cell.xfs || false == cell.isEmptyText()) if(null != cell.xfs || false == cell.isEmptyText())
this.bs.WriteItem(c_oSerRowTypes.Cell, function(){oThis.WriteCell(cell, nXfsId);}); this.bs.WriteItem(c_oSerRowTypes.Cell, function(){oThis.WriteCell(cell, nXfsId);});
}; }
}; }
}; };
this.prepareXfsStyles = function () { this.prepareXfsStyles = function () {
var styles = this.wb.CellStyles.CustomStyles; var styles = this.wb.CellStyles.CustomStyles;
...@@ -2961,7 +2951,7 @@ ...@@ -2961,7 +2951,7 @@
else else
numid = nStandartId; numid = nStandartId;
return numid; return numid;
} };
this.prepareXfs = function(xfs) this.prepareXfs = function(xfs)
{ {
var nXfsId = 0; var nXfsId = 0;
...@@ -3321,7 +3311,7 @@ ...@@ -3321,7 +3311,7 @@
var oThis = this; var oThis = this;
for(var i = 0, length = aDatas.length; i < length; ++i) for(var i = 0, length = aDatas.length; i < length; ++i)
this.bs.WriteItem( c_oSer_Comments.CommentData, function(){oThis.WriteCommentData(aDatas[i]);}); this.bs.WriteItem( c_oSer_Comments.CommentData, function(){oThis.WriteCommentData(aDatas[i]);});
} };
this.WriteCommentData = function(oCommentData) this.WriteCommentData = function(oCommentData)
{ {
var oThis = this; var oThis = this;
...@@ -3366,7 +3356,7 @@ ...@@ -3366,7 +3356,7 @@
var aReplies = oCommentData.aReplies; var aReplies = oCommentData.aReplies;
if(null != aReplies && aReplies.length > 0) if(null != aReplies && aReplies.length > 0)
this.bs.WriteItem( c_oSer_CommentData.Replies, function(){oThis.WriteReplies(aReplies);}); this.bs.WriteItem( c_oSer_CommentData.Replies, function(){oThis.WriteReplies(aReplies);});
} };
this.DateToISO8601 = function(d) this.DateToISO8601 = function(d)
{ {
function pad(n){return n < 10 ? '0' + n : n;} function pad(n){return n < 10 ? '0' + n : n;}
...@@ -3414,11 +3404,11 @@ ...@@ -3414,11 +3404,11 @@
this.WriteMainTable(idWorksheet); this.WriteMainTable(idWorksheet);
window.global_pptx_content_writer._End(); window.global_pptx_content_writer._End();
return this.WriteFileHeader(this.Memory.GetCurPosition()) + this.Memory.GetBase64Memory(); return this.WriteFileHeader(this.Memory.GetCurPosition()) + this.Memory.GetBase64Memory();
} };
this.WriteFileHeader = function(nDataSize) this.WriteFileHeader = function(nDataSize)
{ {
return c_oSerFormat.Signature + ";v" + c_oSerFormat.Version + ";" + nDataSize + ";"; return c_oSerFormat.Signature + ";v" + c_oSerFormat.Version + ";" + nDataSize + ";";
} };
this.WriteMainTable = function(idWorksheet) this.WriteMainTable = function(idWorksheet)
{ {
var nTableCount = 128;//Специально ставим большое число, чтобы не увеличивать его при добавлении очередной таблицы. var nTableCount = 128;//Специально ставим большое число, чтобы не увеличивать его при добавлении очередной таблицы.
...@@ -3458,7 +3448,7 @@ ...@@ -3458,7 +3448,7 @@
//seek в конец, потому что GetBase64Memory заканчивает запись на текущей позиции. //seek в конец, потому что GetBase64Memory заканчивает запись на текущей позиции.
this.Memory.Seek(this.nLastFilePos); this.Memory.Seek(this.nLastFilePos);
} };
this.WriteTable = function(type, oTableSer) this.WriteTable = function(type, oTableSer)
{ {
//Write mtItem //Write mtItem
...@@ -3479,7 +3469,7 @@ ...@@ -3479,7 +3469,7 @@
this.Memory.Seek(nCurPos); this.Memory.Seek(nCurPos);
this.nRealTableCount++; this.nRealTableCount++;
} };
this.ReserveTable = function(type) this.ReserveTable = function(type)
{ {
var res = 0; var res = 0;
...@@ -3490,7 +3480,7 @@ ...@@ -3490,7 +3480,7 @@
//Write mtiOffBits //Write mtiOffBits
this.Memory.WriteLong(this.nLastFilePos); this.Memory.WriteLong(this.nLastFilePos);
return res; return res;
} };
this.WriteReserved = function(oTableSer, nPos) this.WriteReserved = function(oTableSer, nPos)
{ {
this.Memory.Seek(nPos); this.Memory.Seek(nPos);
...@@ -3508,7 +3498,7 @@ ...@@ -3508,7 +3498,7 @@
this.Memory.Seek(nCurPos); this.Memory.Seek(nCurPos);
this.nRealTableCount++; this.nRealTableCount++;
} };
} }
/** @constructor */ /** @constructor */
function Binary_TableReader(stream, ws, Dxfs) function Binary_TableReader(stream, ws, Dxfs)
...@@ -4580,7 +4570,6 @@ ...@@ -4580,7 +4570,6 @@
this.ReadAligment = function(type, length, oAligment) this.ReadAligment = function(type, length, oAligment)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSerAligmentTypes.Horizontal == type ) if ( c_oSerAligmentTypes.Horizontal == type )
{ {
switch(this.stream.GetUChar()) switch(this.stream.GetUChar())
...@@ -4706,14 +4695,13 @@ ...@@ -4706,14 +4695,13 @@
this.ReadNumFmt = function(type, length, oNumFmt) this.ReadNumFmt = function(type, length, oNumFmt)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSerNumFmtTypes.FormatCode == type ) if ( c_oSerNumFmtTypes.FormatCode == type )
{ {
oNumFmt.f = this.stream.GetString2LE(length); oNumFmt.f = this.stream.GetString2LE(length);
} }
else if ( c_oSerNumFmtTypes.NumFmtId == type ) else if ( c_oSerNumFmtTypes.NumFmtId == type )
{ {
oNumFmt.id = this.stream.GetULongLE();; oNumFmt.id = this.stream.GetULongLE();
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -4854,7 +4842,7 @@ ...@@ -4854,7 +4842,7 @@
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
} };
this.ReadTableCustomStyle = function(type, length, oNewStyle, aElements) this.ReadTableCustomStyle = function(type, length, oNewStyle, aElements)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
...@@ -4874,7 +4862,7 @@ ...@@ -4874,7 +4862,7 @@
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
} };
this.ReadTableCustomStyleElements = function(type, length, aElements) this.ReadTableCustomStyleElements = function(type, length, aElements)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
...@@ -4891,7 +4879,7 @@ ...@@ -4891,7 +4879,7 @@
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
} };
this.ReadTableCustomStyleElement = function(type, length, oNewStyleElement) this.ReadTableCustomStyleElement = function(type, length, oNewStyleElement)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
...@@ -4904,7 +4892,7 @@ ...@@ -4904,7 +4892,7 @@
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
} };
} }
/** @constructor */ /** @constructor */
function Binary_WorkbookTableReader(stream, oWorkbook) function Binary_WorkbookTableReader(stream, oWorkbook)
...@@ -5068,13 +5056,13 @@ ...@@ -5068,13 +5056,13 @@
oNewWorksheet.DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument; oNewWorksheet.DrawingDocument = editor.WordControl.m_oLogicDocument.DrawingDocument;
else if(this.copyPasteObj && this.copyPasteObj.isCopyPaste) else if(this.copyPasteObj && this.copyPasteObj.isCopyPaste)
{ {
var api = window["Asc"]["editor"] var api = window["Asc"]["editor"];
var nActiveSheet = api.wb.model.nActive; var nActiveSheet = api.wb.model.nActive;
var ws = api.wb.model.aWorksheets[nActiveSheet]; var ws = api.wb.model.aWorksheets[nActiveSheet];
var DrawingDocument = ws.DrawingDocument; var DrawingDocument = ws.DrawingDocument;
oNewWorksheet.DrawingDocument = DrawingDocument; oNewWorksheet.DrawingDocument = DrawingDocument;
}; }
this.curWorksheet = oNewWorksheet; this.curWorksheet = oNewWorksheet;
res = this.bcr.Read1(length, function(t,l){ res = this.bcr.Read1(length, function(t,l){
...@@ -5444,10 +5432,9 @@ ...@@ -5444,10 +5432,9 @@
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadMergeCells = function(type, length, ws) this.ReadMergeCells = function(type, length)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSerWorksheetsTypes.MergeCell == type ) if ( c_oSerWorksheetsTypes.MergeCell == type )
{ {
this.aMerged.push(this.stream.GetString2LE(length)); this.aMerged.push(this.stream.GetString2LE(length));
...@@ -5722,7 +5709,6 @@ ...@@ -5722,7 +5709,6 @@
}; };
this.ReadGraphicFrame = function (type, length, oDrawing) { this.ReadGraphicFrame = function (type, length, oDrawing) {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if (c_oSer_DrawingType.Chart2 == type) { if (c_oSer_DrawingType.Chart2 == type) {
var oNewChartSpace = new CChartSpace(); var oNewChartSpace = new CChartSpace();
var oBinaryChartReader = new BinaryChartReader(this.stream); var oBinaryChartReader = new BinaryChartReader(this.stream);
...@@ -5737,7 +5723,6 @@ ...@@ -5737,7 +5723,6 @@
this.ReadFromTo = function(type, length, oFromTo) this.ReadFromTo = function(type, length, oFromTo)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSer_DrawingFromToType.Col == type ) if ( c_oSer_DrawingFromToType.Col == type )
//oFromTo.Col = this.stream.GetULongLE(); //oFromTo.Col = this.stream.GetULongLE();
oFromTo.col = this.stream.GetULongLE(); oFromTo.col = this.stream.GetULongLE();
...@@ -5757,7 +5742,6 @@ ...@@ -5757,7 +5742,6 @@
this.ReadPos = function(type, length, oPos) this.ReadPos = function(type, length, oPos)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSer_DrawingPosType.X == type ) if ( c_oSer_DrawingPosType.X == type )
oPos.X = this.stream.GetDoubleLE(); oPos.X = this.stream.GetDoubleLE();
else if ( c_oSer_DrawingPosType.Y == type ) else if ( c_oSer_DrawingPosType.Y == type )
...@@ -5769,7 +5753,6 @@ ...@@ -5769,7 +5753,6 @@
this.ReadExt = function(type, length, oExt) this.ReadExt = function(type, length, oExt)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSer_DrawingExtType.Cx == type ) if ( c_oSer_DrawingExtType.Cx == type )
oExt.cx = this.stream.GetDoubleLE(); oExt.cx = this.stream.GetDoubleLE();
else if ( c_oSer_DrawingExtType.Cy == type ) else if ( c_oSer_DrawingExtType.Cy == type )
...@@ -5781,7 +5764,6 @@ ...@@ -5781,7 +5764,6 @@
this.ReadPic = function(type, length, oDrawing) this.ReadPic = function(type, length, oDrawing)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
var oThis = this;
if ( c_oSer_DrawingType.PicSrc == type ) if ( c_oSer_DrawingType.PicSrc == type )
{ {
var nIndex = this.stream.GetULongLE(); var nIndex = this.stream.GetULongLE();
...@@ -6581,7 +6563,7 @@ ...@@ -6581,7 +6563,7 @@
} }
} }
return nWritten; return nWritten;
} };
this.Read = function(data, wb) this.Read = function(data, wb)
{ {
var pasteBinaryFromExcel = false; var pasteBinaryFromExcel = false;
...@@ -6726,7 +6708,7 @@ ...@@ -6726,7 +6708,7 @@
for(var i in this.CustomStyles) for(var i in this.CustomStyles)
this.AllStyles[i] = this.CustomStyles[i]; this.AllStyles[i] = this.CustomStyles[i];
} }
} };
function CTableStyle() function CTableStyle()
{ {
this.name = null; this.name = null;
...@@ -7395,7 +7377,7 @@ ...@@ -7395,7 +7377,7 @@
} }
} }
} }
} };
function CTableStyleElement() function CTableStyleElement()
{ {
this.size = 1; this.size = 1;
......
...@@ -383,12 +383,12 @@ DrawingObjectsController.prototype.isPointInDrawingObjects = function(x, y, e) ...@@ -383,12 +383,12 @@ DrawingObjectsController.prototype.isPointInDrawingObjects = function(x, y, e)
var ret = this.curState.onMouseDown(e || {}, x, y); var ret = this.curState.onMouseDown(e || {}, x, y);
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE; this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
return ret; return ret;
} };
DrawingObjectsController.prototype.handleDoubleClickOnChart = function(chart) DrawingObjectsController.prototype.handleDoubleClickOnChart = function(chart)
{ {
this.changeCurrentState(new NullState()); this.changeCurrentState(new NullState());
} };
DrawingObjectsController.prototype.addImageFromParams = function(rasterImageId, x, y, extX, extY) DrawingObjectsController.prototype.addImageFromParams = function(rasterImageId, x, y, extX, extY)
{ {
...@@ -401,7 +401,7 @@ DrawingObjectsController.prototype.addImageFromParams = function(rasterImageId, ...@@ -401,7 +401,7 @@ DrawingObjectsController.prototype.addImageFromParams = function(rasterImageId,
this.selectObject(image, 0); this.selectObject(image, 0);
image.addToRecalculate(); image.addToRecalculate();
this.startRecalculate(); this.startRecalculate();
} };
DrawingObjectsController.prototype.isViewMode= function() DrawingObjectsController.prototype.isViewMode= function()
{ {
......
...@@ -18,16 +18,15 @@ ...@@ -18,16 +18,15 @@
this.handlers = new asc_HL(handlers); this.handlers = new asc_HL(handlers);
this.scrollOptions = { this.scrollOptions = {
wheelSpeed : 20,
wheelPropagation : false, wheelPropagation : false,
minScrollbarLength : 50, minScrollbarLength : null,
useBothWheelAxes : false, useBothWheelAxes : false,
useKeyboard : true, useKeyboard : true,
suppressScrollX : false, suppressScrollX : false,
suppressScrollY : false, suppressScrollY : false,
scrollXMarginOffset : 5, scrollXMarginOffset : 5,
scrollYMarginOffset : 5, scrollYMarginOffset : 40,
includePadding : true includePadding : false
}; };
this.element = element; this.element = element;
...@@ -61,19 +60,19 @@ ...@@ -61,19 +60,19 @@
this.selector.innerHTML = '<ul id="apiPopUpList" class="dropdown-menu"></ul>'; this.selector.innerHTML = '<ul id="apiPopUpList" class="dropdown-menu"></ul>';
this.element.appendChild(this.selector); this.element.appendChild(this.selector);
this.selectorList = document.getElementById("apiPopUpList"); this.selectorList = document.getElementById('apiPopUpList');
this.fMouseDown = function (event) {t._onMouseDown(event);}; this.fMouseDown = function (event) {t._onMouseDown(event);};
this.fMouseDblClick = function (event) {t._onMouseDblClick(event);}; this.fMouseDblClick = function (event) {t._onMouseDblClick(event);};
this.fMouseOver = function (event) {t._onMouseOver(event);}; this.fMouseOver = function (event) {t._onMouseOver(event);};
if (this.selector.addEventListener) { if (this.selector.addEventListener) {
this.selector.addEventListener("mousedown", function () { this.selector.addEventListener('mousedown', function () {
t.skipClose = true; t.skipClose = true;
}, false); }, false);
} }
if (window.addEventListener) { if (window.addEventListener) {
window.addEventListener("mousedown", function () { window.addEventListener('mousedown', function () {
if (t.skipClose) { if (t.skipClose) {
t.skipClose = false; t.skipClose = false;
return; return;
...@@ -98,7 +97,7 @@ ...@@ -98,7 +97,7 @@
var item, isFirst, value, selectElement = null; var item, isFirst, value, selectElement = null;
for (var i = 0; i < arrItems.length; ++i) { for (var i = 0; i < arrItems.length; ++i) {
item = document.createElement("li"); item = document.createElement('li');
isFirst = (0 === i); isFirst = (0 === i);
if (isFirst) if (isFirst)
this.firstElement = item; this.firstElement = item;
...@@ -108,18 +107,18 @@ ...@@ -108,18 +107,18 @@
selectElement = item; selectElement = item;
value = arrItems[i].name; value = arrItems[i].name;
item.setAttribute("title", arrItems[i].arg); item.setAttribute('title', arrItems[i].arg);
} else } else
value = arrItems[i]; value = arrItems[i];
item.innerHTML = "<a>" + value + "</a>"; item.innerHTML = '<a>' + value + '</a>';
item.setAttribute("val", value); item.setAttribute('val', value);
if (item.addEventListener) { if (item.addEventListener) {
item.addEventListener("mousedown" , this.fMouseDown , false); item.addEventListener('mousedown' , this.fMouseDown , false);
item.addEventListener("dblclick" , this.fMouseDblClick , false); item.addEventListener('dblclick' , this.fMouseDblClick , false);
if (!this.isFormula) { if (!this.isFormula) {
item.addEventListener("mouseover", this.fMouseOver, false); item.addEventListener('mouseover', this.fMouseOver, false);
} }
} }
...@@ -127,18 +126,6 @@ ...@@ -127,18 +126,6 @@
this.selectorListEl.push(item); this.selectorListEl.push(item);
} }
// Selection hack
/*var clearSelection = function() {
if (document.selection && document.selection.empty) {
document.selection.empty();
}
else if (window.getSelection) {
var sel = window.getSelection();
sel.removeAllRanges();
}
}*/
// TODO: В Mozilla избавиться от селекта текста при dblclick
// Для того, чтобы работал scroll // Для того, чтобы работал scroll
this.selectorListJQ.perfectScrollbar("update"); this.selectorListJQ.perfectScrollbar("update");
...@@ -156,8 +143,8 @@ ...@@ -156,8 +143,8 @@
} }
}; };
PopUpSelector.prototype.setPosition = function (cellRect) { PopUpSelector.prototype.setPosition = function (cellRect) {
this.selectorStyle["left"] = (cellRect.asc_getX() + 10) + "px"; this.selectorStyle['left'] = (cellRect.asc_getX() + 10) + 'px';
this.selectorStyle["top"] = (cellRect.asc_getY() + cellRect.asc_getHeight()) + "px"; this.selectorStyle['top'] = (cellRect.asc_getY() + cellRect.asc_getHeight()) + 'px';
}; };
PopUpSelector.prototype.getVisible = function () { PopUpSelector.prototype.getVisible = function () {
return this.isVisible; return this.isVisible;
...@@ -183,11 +170,11 @@ ...@@ -183,11 +170,11 @@
} else } else
retVal = true; retVal = true;
break; break;
case 13: // "enter" case 13: // Enter
if (!this.isFormula && null !== this.selectElement) { if (!this.isFormula && null !== this.selectElement) {
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
this._onInsert(this.selectElement.getAttribute("val")); this._onInsert(this.selectElement.getAttribute('val'));
} else } else
retVal = true; retVal = true;
break; break;
...@@ -214,7 +201,7 @@ ...@@ -214,7 +201,7 @@
PopUpSelector.prototype._onInsert = function (value) { PopUpSelector.prototype._onInsert = function (value) {
this.hide(); this.hide();
this.handlers.trigger("insert", value); this.handlers.trigger('insert', value);
}; };
PopUpSelector.prototype._onMouseDown = function (event) { PopUpSelector.prototype._onMouseDown = function (event) {
...@@ -223,7 +210,7 @@ ...@@ -223,7 +210,7 @@
if (this.isFormula) if (this.isFormula)
this._onChangeSelection(element); this._onChangeSelection(element);
else else
this._onInsert(element.getAttribute("val")); this._onInsert(element.getAttribute('val'));
}; };
PopUpSelector.prototype._onMouseDblClick = function (event) { PopUpSelector.prototype._onMouseDblClick = function (event) {
if (!this.isVisible) if (!this.isVisible)
...@@ -233,7 +220,7 @@ ...@@ -233,7 +220,7 @@
this._onMouseDown(event); this._onMouseDown(event);
return; return;
} }
var elementVal = (event ? event.currentTarget : this.selectElement).getAttribute("val") + "("; var elementVal = (event ? event.currentTarget : this.selectElement).getAttribute('val') + '(';
this._onInsert(elementVal); this._onInsert(elementVal);
}; };
PopUpSelector.prototype._onMouseOver = function (event) { PopUpSelector.prototype._onMouseOver = function (event) {
...@@ -243,14 +230,14 @@ ...@@ -243,14 +230,14 @@
this._onChangeSelection(event.currentTarget); this._onChangeSelection(event.currentTarget);
}; };
PopUpSelector.prototype._onChangeSelection = function (newElement) { PopUpSelector.prototype._onChangeSelection = function (newElement) {
if (null === newElement || null === newElement.getAttribute("val")) if (null === newElement || null === newElement.getAttribute('val'))
return; return;
if (null !== this.selectElement) if (null !== this.selectElement)
this.selectElement.className = ""; this.selectElement.className = '';
this.selectElement = newElement; this.selectElement = newElement;
this.selectElement.className = "selected"; this.selectElement.className = 'selected';
this.scrollToRecord(); this.scrollToRecord();
}; };
...@@ -261,7 +248,7 @@ ...@@ -261,7 +248,7 @@
var div = $(this.selectElement); var div = $(this.selectElement);
var div_top = div.offset().top; var div_top = div.offset().top;
if (div_top < inner_top || div_top+div.height() > inner_top + innerEl.height()) { if (div_top < inner_top || div_top + div.height() > inner_top + innerEl.height()) {
this.selectorListJQ.scrollTop(this.selectorListJQ.scrollTop() + div_top - inner_top); this.selectorListJQ.scrollTop(this.selectorListJQ.scrollTop() + div_top - inner_top);
} }
}; };
......
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