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

memory: некоторые bool поля переделаны в битовые флаги.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60366 954022d7-b5bf-4e40-9824-e11837661b57
parent 36a4e369
......@@ -2591,17 +2591,17 @@
this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(oAllRow.h);
}
if(oAllRow.CustomHeight)
if(0 != (g_nRowFlag_CustomHeight & oAllRow.flags))
{
this.memory.WriteByte(c_oSerSheetFormatPrTypes.CustomHeight);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oAllRow.CustomHeight);
this.memory.WriteBool(true);
}
if(oAllRow.hd)
if(0 != (g_nRowFlag_hd & oAllRow.flags))
{
this.memory.WriteByte(c_oSerSheetFormatPrTypes.ZeroHeight);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oAllRow.hd);
this.memory.WriteBool(true);
}
}
};
......@@ -2931,17 +2931,17 @@
this.memory.WriteByte(c_oSerPropLenType.Double);
this.memory.WriteDouble2(oRow.h);
}
if(null != oRow.CustomHeight)
if(0 != (g_nRowFlag_CustomHeight & oRow.flags))
{
this.memory.WriteByte(c_oSerRowTypes.CustomHeight);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oRow.CustomHeight);
this.memory.WriteBool(true);
}
if(null != oRow.hd)
if(0 != (g_nRowFlag_hd & oRow.flags))
{
this.memory.WriteByte(c_oSerRowTypes.Hidden);
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(oRow.hd);
this.memory.WriteBool(true);
}
this.memory.WriteByte(c_oSerRowTypes.Cells);
......@@ -5486,12 +5486,16 @@
else if ( c_oSerSheetFormatPrTypes.CustomHeight == type )
{
var oAllRow = oWorksheet.getAllRow();
oAllRow.CustomHeight = this.stream.GetBool();
var CustomHeight = this.stream.GetBool();
if(CustomHeight)
oAllRow.flags |= g_nRowFlag_CustomHeight;
}
else if ( c_oSerSheetFormatPrTypes.ZeroHeight == type )
{
var oAllRow = oWorksheet.getAllRow();
oAllRow.hd = this.stream.GetBool();
var hd = this.stream.GetBool();
if(hd)
oAllRow.flags |= g_nRowFlag_hd;
}
else
res = c_oSerConstants.ReadUnknown;
......@@ -5628,12 +5632,20 @@
{
oRow.h = this.stream.GetDoubleLE();
if(g_nCurFileVersion < 2)
oRow.CustomHeight = true;
oRow.flags |= g_nRowFlag_CustomHeight;
}
else if ( c_oSerRowTypes.CustomHeight == type )
oRow.CustomHeight = this.stream.GetBool();
{
var CustomHeight = this.stream.GetBool();
if(CustomHeight)
oRow.flags |= g_nRowFlag_CustomHeight;
}
else if ( c_oSerRowTypes.Hidden == type )
oRow.hd = this.stream.GetBool();
{
var hd = this.stream.GetBool();
if(hd)
oRow.flags |= g_nRowFlag_hd;
}
else if ( c_oSerRowTypes.Cells == type )
{
res = this.bcr.Read1(length, function(t,l){
......
......@@ -844,8 +844,8 @@ function UndoRedoData_RowProp(row){
if(null != row)
{
this.h = row.h;
this.hd = row.hd;
this.CustomHeight = row.CustomHeight;
this.hd = 0 != (g_nRowFlag_hd & row.flags);
this.CustomHeight = 0 != (g_nRowFlag_CustomHeight & row.flags);
}
else
{
......
This diff is collapsed.
......@@ -2394,6 +2394,9 @@ Col.prototype =
History.Add(g_oUndoRedoCol, historyitem_RowCol_Angle, this.ws.getId(), this._getUpdateRange(), new UndoRedoData_IndexSimpleProp(this.index, false, oRes.oldVal, oRes.newVal));
}
};
var g_nRowFlag_empty = 0;
var g_nRowFlag_hd = 1;
var g_nRowFlag_CustomHeight = 2;
/**
* @constructor
*/
......@@ -2404,8 +2407,7 @@ function Row(worksheet)
this.index = null;
this.xfs = null;
this.h = null;
this.hd = null;
this.CustomHeight = null;
this.flags = g_nRowFlag_empty;
}
Row.prototype =
{
......@@ -2437,7 +2439,7 @@ Row.prototype =
},
isEmptyProp : function()
{
return null == this.xfs && null == this.h && null == this.hd && null == this.CustomHeight;
return null == this.xfs && null == this.h && g_nRowFlag_empty == this.flags;
},
Remove : function()
{
......@@ -2449,14 +2451,11 @@ Row.prototype =
oNewWs = this.ws;
var oNewRow = new Row(oNewWs);
oNewRow.index = this.index;
oNewRow.flags = this.flags;
if(null != this.xfs)
oNewRow.xfs = this.xfs.clone();
if(null != this.h)
oNewRow.h = this.h;
if(null != this.CustomHeight)
oNewRow.CustomHeight = this.CustomHeight;
if(null != this.hd)
oNewRow.hd = this.hd;
for(var i in this.c)
oNewRow.c[i] = this.c[i].clone(oNewWs);
return oNewRow;
......@@ -2480,14 +2479,14 @@ Row.prototype =
this.h = prop.h;
else
this.h = null;
if(null != prop.hd)
this.hd = prop.hd;
if(true == prop.hd)
this.flags |= g_nRowFlag_hd;
else
this.hd = null;
if(null != prop.CustomHeight)
this.CustomHeight = prop.CustomHeight;
this.flags &= ~g_nRowFlag_hd;
if(true == prop.CustomHeight)
this.flags |= g_nRowFlag_CustomHeight;
else
this.CustomHeight = null;
this.flags &= ~g_nRowFlag_CustomHeight;
}
},
copyProperty : function(otherRow)
......@@ -2497,8 +2496,7 @@ Row.prototype =
else
this.xfs = null;
this.h = otherRow.h;
this.CustomHeight = otherRow.CustomHeight;
this.hd = otherRow.hd;
this.flags = otherRow.flags;
},
getStyle : function()
{
......
......@@ -1324,12 +1324,12 @@
if (!row) {
h = -1; // Будет использоваться дефолтная высота строки
isCustomHeight = false;
} else if (row.hd) {
} else if (0 != (g_nRowFlag_hd & row.flags)) {
hR = h = 0; // Скрытая строка, высоту выставляем 0
isCustomHeight = true;
hiddenH += row.h > 0 ? row.h - this.height_1px : defaultH;
} else {
isCustomHeight = !!row.CustomHeight;
isCustomHeight = 0 != (g_nRowFlag_CustomHeight & row.flags);
// Берем высоту из модели, если она custom(баг 15618), либо дефолтную
if (row.h > 0 && isCustomHeight) {
hR = row.h;
......
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