Commit ff9f5801 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

(1.0.0.104): XlsxSerializerCom

Default свойства row на открытие и сохранение.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54293 954022d7-b5bf-4e40-9824-e11837661b57
parent 7ebc4b28
...@@ -211,7 +211,9 @@ var c_oSerSheetFormatPrTypes = ...@@ -211,7 +211,9 @@ var c_oSerSheetFormatPrTypes =
{ {
DefaultColWidth : 0, DefaultColWidth : 0,
DefaultRowHeight : 1, DefaultRowHeight : 1,
BaseColWidth : 2 BaseColWidth : 2,
CustomHeight : 3,
ZeroHeight : 4
}; };
/** @enum */ /** @enum */
var c_oSerRowTypes = var c_oSerRowTypes =
...@@ -2341,8 +2343,8 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF ...@@ -2341,8 +2343,8 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF
var oRes = {BestFit: col.BestFit, hd: col.hd, Max: nMax, Min: nMin, xfsid: null, width: col.width, CustomWidth: col.CustomWidth}; var oRes = {BestFit: col.BestFit, hd: col.hd, Max: nMax, Min: nMin, xfsid: null, width: col.width, CustomWidth: col.CustomWidth};
if(null == oRes.width) if(null == oRes.width)
{ {
if(null != ws.dDefaultColWidth) if(null != ws.oSheetFormatPr.dDefaultColWidth)
oRes.width = ws.dDefaultColWidth; oRes.width = ws.oSheetFormatPr.dDefaultColWidth;
else else
oRes.width = gc_dDefaultColWidthCharsAttribute; oRes.width = gc_dDefaultColWidthCharsAttribute;
} }
...@@ -2493,21 +2495,37 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF ...@@ -2493,21 +2495,37 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF
}; };
this.WriteSheetFormatPr = function(ws) this.WriteSheetFormatPr = function(ws)
{ {
if(null !== ws.dDefaultColWidth) { if (null !== ws.oSheetFormatPr.nBaseColWidth) {
this.memory.WriteByte(c_oSerSheetFormatPrTypes.BaseColWidth);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(ws.oSheetFormatPr.nBaseColWidth);
}
if(null !== ws.oSheetFormatPr.dDefaultColWidth) {
this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultColWidth); this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultColWidth);
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(ws.dDefaultColWidth); this.memory.WriteDouble2(ws.oSheetFormatPr.dDefaultColWidth);
} }
if(null !== ws.dDefaultheight) { if(null !== ws.oSheetFormatPr.oAllRow) {
this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultRowHeight); var oAllRow = ws.oSheetFormatPr.oAllRow;
this.memory.WriteByte(c_oSerPropLenType.Double); if(oAllRow.h)
this.memory.WriteDouble2(ws.dDefaultheight); {
this.memory.WriteByte(c_oSerSheetFormatPrTypes.DefaultRowHeight);
this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(oAllRow.h);
}
if(oAllRow.CustomHeight)
{
this.memory.WriteByte(c_oSerSheetFormatPrTypes.CustomHeight);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oAllRow.CustomHeight);
}
if(oAllRow.hd)
{
this.memory.WriteByte(c_oSerSheetFormatPrTypes.ZeroHeight);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oAllRow.hd);
}
} }
if (null !== ws.nBaseColWidth) {
this.memory.WriteByte(c_oSerSheetFormatPrTypes.BaseColWidth);
this.memory.WriteByte(c_oSerPropLenType.Long);
this.memory.WriteLong(ws.nBaseColWidth);
}
}; };
this.WritePageMargins = function(oMargins) this.WritePageMargins = function(oMargins)
{ {
...@@ -5293,11 +5311,24 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5293,11 +5311,24 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
if ( c_oSerSheetFormatPrTypes.DefaultColWidth == type ) if ( c_oSerSheetFormatPrTypes.DefaultColWidth == type )
oWorksheet.dDefaultColWidth = this.stream.GetDoubleLE(); oWorksheet.oSheetFormatPr.dDefaultColWidth = this.stream.GetDoubleLE();
else if ( c_oSerSheetFormatPrTypes.DefaultRowHeight == type )
oWorksheet.dDefaultheight = this.stream.GetDoubleLE();
else if (c_oSerSheetFormatPrTypes.BaseColWidth === type) else if (c_oSerSheetFormatPrTypes.BaseColWidth === type)
oWorksheet.nBaseColWidth = this.stream.GetULongLE(); oWorksheet.oSheetFormatPr.nBaseColWidth = this.stream.GetULongLE();
else if ( c_oSerSheetFormatPrTypes.DefaultRowHeight == type )
{
var oAllRow = oWorksheet.getAllRow();
oAllRow.h = this.stream.GetDoubleLE();
}
else if ( c_oSerSheetFormatPrTypes.CustomHeight == type )
{
var oAllRow = oWorksheet.getAllRow();
oAllRow.CustomHeight = this.stream.GetBool();
}
else if ( c_oSerSheetFormatPrTypes.ZeroHeight == type )
{
var oAllRow = oWorksheet.getAllRow();
oAllRow.hd = this.stream.GetBool();
}
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
......
...@@ -1685,9 +1685,7 @@ function Woorksheet(wb, _index, bAddUserId, sId){ ...@@ -1685,9 +1685,7 @@ function Woorksheet(wb, _index, bAddUserId, sId){
this.DefinedNames = {}; this.DefinedNames = {};
this.sName = this.workbook.getUniqueSheetNameFrom(g_sNewSheetNamePattern, false); this.sName = this.workbook.getUniqueSheetNameFrom(g_sNewSheetNamePattern, false);
this.bHidden = false; this.bHidden = false;
this.dDefaultColWidth = null; this.oSheetFormatPr = new SheetFormatPr();
this.dDefaultheight = null;
this.nBaseColWidth = null;
this.index = _index; this.index = _index;
this.Id = null; this.Id = null;
if(null != sId) if(null != sId)
...@@ -1810,9 +1808,7 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){ ...@@ -1810,9 +1808,7 @@ Woorksheet.prototype.clone=function(sNewId, bFromRedo){
oNewWs = new Woorksheet(this.workbook, this.workbook.aWorksheets.length, true); oNewWs = new Woorksheet(this.workbook, this.workbook.aWorksheets.length, true);
oNewWs.sName = this.workbook.getUniqueSheetNameFrom(this.sName, true); oNewWs.sName = this.workbook.getUniqueSheetNameFrom(this.sName, true);
oNewWs.bHidden = this.bHidden; oNewWs.bHidden = this.bHidden;
oNewWs.nBaseColWidth = this.nBaseColWidth; oNewWs.oSheetFormatPr = this.oSheetFormatPr.clone();
oNewWs.dDefaultColWidth = this.dDefaultColWidth;
oNewWs.dDefaultheight = this.dDefaultheight;
oNewWs.index = this.index; oNewWs.index = this.index;
oNewWs.nRowsCount = this.nRowsCount; oNewWs.nRowsCount = this.nRowsCount;
oNewWs.nColsCount = this.nColsCount; oNewWs.nColsCount = this.nColsCount;
...@@ -2447,7 +2443,7 @@ Woorksheet.prototype._insertColsBefore=function(index, count){ ...@@ -2447,7 +2443,7 @@ Woorksheet.prototype._insertColsBefore=function(index, count){
var oPrevCol = null; var oPrevCol = null;
if(index > 0) if(index > 0)
oPrevCol = this.aCols[index - 1]; oPrevCol = this.aCols[index - 1];
if(null != this.oAllCol) if(null == oPrevCol && null != this.oAllCol)
oPrevCol = this.oAllCol; oPrevCol = this.oAllCol;
for(var i = 0; i < count; ++i) for(var i = 0; i < count; ++i)
{ {
...@@ -2480,7 +2476,7 @@ Woorksheet.prototype.insertColsAfter=function(index, count){ ...@@ -2480,7 +2476,7 @@ Woorksheet.prototype.insertColsAfter=function(index, count){
return this.insertColsBefore(index + 1, count); return this.insertColsBefore(index + 1, count);
}; };
Woorksheet.prototype.getDefaultWidth=function(){ Woorksheet.prototype.getDefaultWidth=function(){
return this.dDefaultColWidth; return this.oSheetFormatPr.dDefaultColWidth;
}; };
Woorksheet.prototype.getColWidth=function(index){ Woorksheet.prototype.getColWidth=function(index){
//index 0 based //index 0 based
...@@ -2488,7 +2484,7 @@ Woorksheet.prototype.getColWidth=function(index){ ...@@ -2488,7 +2484,7 @@ Woorksheet.prototype.getColWidth=function(index){
var col = this._getColNoEmptyWithAll(index); var col = this._getColNoEmptyWithAll(index);
if(null != col && null != col.width) if(null != col && null != col.width)
return col.width; return col.width;
var dResult = this.dDefaultColWidth; var dResult = this.oSheetFormatPr.dDefaultColWidth;
if(dResult === undefined || dResult === null || dResult == 0) if(dResult === undefined || dResult === null || dResult == 0)
//dResult = (8) + 5;//(EMCA-376.page 1857.)defaultColWidth = baseColumnWidth + {margin padding (2 pixels on each side, totalling 4 pixels)} + {gridline (1pixel)} //dResult = (8) + 5;//(EMCA-376.page 1857.)defaultColWidth = baseColumnWidth + {margin padding (2 pixels on each side, totalling 4 pixels)} + {gridline (1pixel)}
dResult = -1; // calc default width at presentation level dResult = -1; // calc default width at presentation level
...@@ -2530,6 +2526,10 @@ Woorksheet.prototype.setColWidth=function(width, start, stop){ ...@@ -2530,6 +2526,10 @@ Woorksheet.prototype.setColWidth=function(width, start, stop){
{ {
var col = this.getAllCol(); var col = this.getAllCol();
fProcessCol(col); fProcessCol(col);
for(var i in this.aCols){
var col = this.aCols[i];
fProcessCol(col);
}
} }
else else
{ {
...@@ -2579,6 +2579,10 @@ Woorksheet.prototype.setColHidden=function(bHidden, start, stop){ ...@@ -2579,6 +2579,10 @@ Woorksheet.prototype.setColHidden=function(bHidden, start, stop){
col = this.getAllCol(); col = this.getAllCol();
if(null != col) if(null != col)
fProcessCol(col); fProcessCol(col);
for(var i in this.aCols){
var col = this.aCols[i];
fProcessCol(col);
}
} }
else else
{ {
...@@ -2624,6 +2628,10 @@ Woorksheet.prototype.setColBestFit=function(bBestFit, width, start, stop){ ...@@ -2624,6 +2628,10 @@ Woorksheet.prototype.setColBestFit=function(bBestFit, width, start, stop){
col = this.getAllCol(); col = this.getAllCol();
if(null != col) if(null != col)
fProcessCol(col); fProcessCol(col);
for(var i in this.aCols){
var col = this.aCols[i];
fProcessCol(col);
}
} }
else else
{ {
...@@ -2639,7 +2647,10 @@ Woorksheet.prototype.setColBestFit=function(bBestFit, width, start, stop){ ...@@ -2639,7 +2647,10 @@ Woorksheet.prototype.setColBestFit=function(bBestFit, width, start, stop){
} }
}; };
Woorksheet.prototype.getDefaultHeight=function(){ Woorksheet.prototype.getDefaultHeight=function(){
return this.dDefaultheight; var dRes = null;
if(null != this.oSheetFormatPr.oAllRow)
dRes = this.oSheetFormatPr.oAllRow.h;
return dRes;
}; };
Woorksheet.prototype.getRowHeight=function(index){ Woorksheet.prototype.getRowHeight=function(index){
//index 0 based //index 0 based
...@@ -2658,6 +2669,7 @@ Woorksheet.prototype.setRowHeight=function(height, start, stop){ ...@@ -2658,6 +2669,7 @@ Woorksheet.prototype.setRowHeight=function(height, start, stop){
if(null == stop) if(null == stop)
stop = start; stop = start;
History.Create_NewPoint(); History.Create_NewPoint();
var oThis = this;
var oSelection = History.GetSelection(); var oSelection = History.GetSelection();
if(null != oSelection) if(null != oSelection)
{ {
...@@ -2667,17 +2679,32 @@ Woorksheet.prototype.setRowHeight=function(height, start, stop){ ...@@ -2667,17 +2679,32 @@ Woorksheet.prototype.setRowHeight=function(height, start, stop){
History.SetSelection(oSelection); History.SetSelection(oSelection);
History.SetSelectionRedo(oSelection); History.SetSelectionRedo(oSelection);
} }
for(var i = start;i <= stop; i++){ var fProcessRow = function(row){
var oCurRow = this._getRow(i); if(row && row.h != height)
if(oCurRow.h != height)
{ {
var oOldProps = oCurRow.getHeightProp(); var oOldProps = row.getHeightProp();
oCurRow.h = height; row.h = height;
oCurRow.CustomHeight = true; row.CustomHeight = true;
oCurRow.hd = null; row.hd = null;
var oNewProps = oCurRow.getHeightProp(); var oNewProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oNewProps)) if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
}
};
if(0 == start && gc_nMaxRow0 == stop)
{
var row = this.getAllRow();
fProcessRow(row);
for(var i in this.aGCells){
var row = this.aGCells[i];
fProcessRow(row);
}
}
else
{
for(var i = start; i <= stop; i++){
var row = this._getRow(i);
fProcessRow(row);
} }
} }
}; };
...@@ -2688,22 +2715,43 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){ ...@@ -2688,22 +2715,43 @@ Woorksheet.prototype.setRowHidden=function(bHidden, start, stop){
if(null == stop) if(null == stop)
stop = start; stop = start;
History.Create_NewPoint(); History.Create_NewPoint();
for(var i = start;i <= stop; i++){ var oThis = this;
var oCurRow = null; var fProcessRow = function(row){
if(false == bHidden) if(row && row.hd != bHidden)
oCurRow = this._getRowNoEmpty(i);
else
oCurRow = this._getRow(i);
if(null != oCurRow && oCurRow.hd != bHidden)
{ {
var oOldProps = oCurRow.getHeightProp(); var oOldProps = row.getHeightProp();
if(bHidden) if(bHidden)
oCurRow.hd = bHidden; row.hd = bHidden;
else else
oCurRow.hd = null; row.hd = null;
var oNewProps = oCurRow.getHeightProp(); var oNewProps = row.getHeightProp();
if(false == Asc.isEqual(oOldProps, oNewProps)) if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
}
};
if(0 == start && gc_nMaxRow0 == stop)
{
var row = null;
if(false == bHidden)
row = this.oSheetFormatPr.oAllRow;
else
row = this.getAllRow();
if(null != row)
fProcessRow(row);
for(var i in this.aGCells){
var row = this.aGCells[i];
fProcessRow(row);
}
}
else
{
for(var i = start; i <= stop; i++){
var row = null;
if(false == bHidden)
row = this._getRowNoEmpty(i);
else
row = this._getRow(i);
fProcessRow(row);
} }
} }
}; };
...@@ -2714,24 +2762,42 @@ Woorksheet.prototype.setRowBestFit=function(bBestFit, height, start, stop){ ...@@ -2714,24 +2762,42 @@ Woorksheet.prototype.setRowBestFit=function(bBestFit, height, start, stop){
if(null == stop) if(null == stop)
stop = start; stop = start;
History.Create_NewPoint(); History.Create_NewPoint();
for(var i = start;i <= stop; i++){ var oThis = this;
var oCurRow = null; var fProcessRow = function(row){
if(true == bBestFit && gc_dDefaultRowHeightAttribute == height) if(row)
oCurRow = this._getRowNoEmpty(i);
else
oCurRow = this._getRow(i);
if(null != oCurRow)
{ {
var oOldProps = oCurRow.getHeightProp(); var oOldProps = row.getHeightProp();
if(true == bBestFit) if(true == bBestFit)
oCurRow.CustomHeight = null; row.CustomHeight = null;
else else
oCurRow.CustomHeight = true; row.CustomHeight = true;
oCurRow.height = height; row.height = height;
var oNewProps = oCurRow.getHeightProp(); var oNewProps = row.getHeightProp();
if(false == oOldProps.isEqual(oNewProps)) if(false == Asc.isEqual(oOldProps, oNewProps))
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, this.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps)); History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RowProp, oThis.getId(), new Asc.Range(0, i, gc_nMaxCol0, i), new UndoRedoData_IndexSimpleProp(i, true, oOldProps, oNewProps));
} }
};
if(0 == start && gc_nMaxRow0 == stop)
{
var row = null;
if(true == bBestFit && gc_dDefaultRowHeightAttribute == height)
row = this.oSheetFormatPr.oAllRow;
else
row = this.getAllRow();
if(null != row)
fProcessRow(row);
for(var i in this.aGCells){
var row = this.aGCells[i];
fProcessRow(row);
}
}
for(var i = start; i <= stop; i++){
var row = null;
if(true == bBestFit && gc_dDefaultRowHeightAttribute == height)
row = this._getRowNoEmpty(i);
else
row = this._getRow(i);
fProcessRow(row);
} }
}; };
Woorksheet.prototype.getCell=function(oCellAdd){ Woorksheet.prototype.getCell=function(oCellAdd){
...@@ -2859,6 +2925,12 @@ Woorksheet.prototype._getRowNoEmpty=function(row){ ...@@ -2859,6 +2925,12 @@ Woorksheet.prototype._getRowNoEmpty=function(row){
if(oCurRow) if(oCurRow)
return oCurRow; return oCurRow;
return null; return null;
};
Woorksheet.prototype._getRowNoEmptyWithAll=function(col){
var oRes = this._getRowNoEmpty(col);
if(null == oRes)
oRes = this.oSheetFormatPr.oAllRow;
return oRes;
}; };
Woorksheet.prototype._getColNoEmpty=function(col){ Woorksheet.prototype._getColNoEmpty=function(col){
//0-based //0-based
...@@ -2877,7 +2949,10 @@ Woorksheet.prototype._getRow=function(row){ ...@@ -2877,7 +2949,10 @@ Woorksheet.prototype._getRow=function(row){
//0-based //0-based
var oCurRow = this.aGCells[row]; var oCurRow = this.aGCells[row];
if(!oCurRow){ if(!oCurRow){
oCurRow = new Row(this); if(null != this.oSheetFormatPr.oAllRow)
oCurRow = this.oSheetFormatPr.oAllRow.clone(this);
else
oCurRow = new Row(this);
oCurRow.create(row + 1); oCurRow.create(row + 1);
this.aGCells[row] = oCurRow; this.aGCells[row] = oCurRow;
this.nRowsCount = row > this.nRowsCount ? row : this.nRowsCount ; this.nRowsCount = row > this.nRowsCount ? row : this.nRowsCount ;
...@@ -3455,6 +3530,11 @@ Woorksheet.prototype.getAllCol = function(){ ...@@ -3455,6 +3530,11 @@ Woorksheet.prototype.getAllCol = function(){
this.oAllCol = new Col(this, g_nAllColIndex); this.oAllCol = new Col(this, g_nAllColIndex);
return this.oAllCol; return this.oAllCol;
} }
Woorksheet.prototype.getAllRow = function(){
if(null == this.oSheetFormatPr.oAllRow)
this.oSheetFormatPr.oAllRow = new Row(this);
return this.oSheetFormatPr.oAllRow;
}
Woorksheet.prototype.getHyperlinkByCell = function(row, col){ Woorksheet.prototype.getHyperlinkByCell = function(row, col){
var oHyperlink = this.hyperlinkManager.getByCell(row, col); var oHyperlink = this.hyperlinkManager.getByCell(row, col);
return oHyperlink ? oHyperlink.data : null; return oHyperlink ? oHyperlink.data : null;
......
...@@ -2119,6 +2119,21 @@ Hyperlink.prototype = { ...@@ -2119,6 +2119,21 @@ Hyperlink.prototype = {
} }
}; };
/** @constructor */ /** @constructor */
function SheetFormatPr(){
this.nBaseColWidth = null;
this.dDefaultColWidth = null;
this.oAllRow = null;
};
SheetFormatPr.prototype = {
clone : function(){
var oRes = new SheetFormatPr();
oRes.nBaseColWidth = this.nBaseColWidth;
oRes.dDefaultColWidth = this.dDefaultColWidth;
if(null != this.oAllRow)
oRes.oAllRow = this.oAllRow.clone();
}
}
/** @constructor */
function Col(worksheet, index) function Col(worksheet, index)
{ {
this.ws = worksheet; this.ws = worksheet;
......
...@@ -1103,7 +1103,7 @@ ...@@ -1103,7 +1103,7 @@
}; };
WorksheetView.prototype._initWorksheetDefaultWidth = function () { WorksheetView.prototype._initWorksheetDefaultWidth = function () {
this.nBaseColWidth = this.model.nBaseColWidth || this.nBaseColWidth; this.nBaseColWidth = this.model.oSheetFormatPr.nBaseColWidth || this.nBaseColWidth;
// Теперь рассчитываем число px // Теперь рассчитываем число px
var defaultColWidthChars = this._charCountToModelColWidth(this.nBaseColWidth); var defaultColWidthChars = this._charCountToModelColWidth(this.nBaseColWidth);
this.defaultColWidthPx = this._modelColWidthToColWidth(defaultColWidthChars) * asc_getcvt(1/*pt*/, 0/*px*/, 96); this.defaultColWidthPx = this._modelColWidthToColWidth(defaultColWidthChars) * asc_getcvt(1/*pt*/, 0/*px*/, 96);
...@@ -1323,7 +1323,7 @@ ...@@ -1323,7 +1323,7 @@
y = this.rows[i - 1].top + this.rows[i - 1].height; y = this.rows[i - 1].top + this.rows[i - 1].height;
} }
for (; ((0 !== fullRecalc) ? i < l || y + hiddenH < visibleH : i < this.rows.length) && i < gc_nMaxRow; ++i) { for (; ((0 !== fullRecalc) ? i < l || y + hiddenH < visibleH : i < this.rows.length) && i < gc_nMaxRow; ++i) {
row = this.model._getRowNoEmpty(i); row = this.model._getRowNoEmptyWithAll(i);
if (!row) { if (!row) {
h = -1; // Будет использоваться дефолтная высота строки h = -1; // Будет использоваться дефолтная высота строки
isCustomHeight = false; isCustomHeight = false;
...@@ -8837,7 +8837,7 @@ ...@@ -8837,7 +8837,7 @@
functionModelAction = function () { functionModelAction = function () {
// Приводим к px (чтобы было ровно) // Приводим к px (чтобы было ровно)
val = val / 0.75; val = (val | val) * 0.75; // 0.75 - это размер 1px в pt (можно было 96/72) val = val / 0.75; val = (val | val) * 0.75; // 0.75 - это размер 1px в pt (можно было 96/72)
t.model.setRowHeight(Math.min(val, t.maxRowHeight), arn.r1, arn.r2); t.model.setRowHeight(Math.min(val, t.maxRowHeight), checkRange.r1, checkRange.r2);
isUpdateRows = true; isUpdateRows = true;
fullRecalc = true; fullRecalc = 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