Commit 455a942a authored by GoshaZotov's avatar GoshaZotov Committed by Alexander.Trofimov

change functions for draw format tables

parent a0b3b0b4
...@@ -7284,16 +7284,16 @@ ...@@ -7284,16 +7284,16 @@
if(0 == (rowIndex - headerRowCount) % 2) if(0 == (rowIndex - headerRowCount) % 2)
{ {
if(0 == colIndex % 2) if(0 == colIndex % 2)
res = styles.rightRowBand1ColBand1LC; res = styles.rightBottomRowBand1ColBand1LC;
else else
res = styles.rightRowBand1ColBand2LC; res = styles.rightBottomRowBand1ColBand2LC;
} }
else else
{ {
if(0 == colIndex % 2) if(0 == colIndex % 2)
res = styles.rightRowBand2ColBand1LC; res = styles.rightBottomRowBand2ColBand1LC;
else else
res = styles.rightRowBand2ColBand2LC; res = styles.rightBottomRowBand2ColBand2LC;
} }
} }
else else
...@@ -7301,16 +7301,16 @@ ...@@ -7301,16 +7301,16 @@
if(0 == (rowIndex - headerRowCount) % 2) if(0 == (rowIndex - headerRowCount) % 2)
{ {
if(0 == colIndex % 2) if(0 == colIndex % 2)
res = styles.rightBottomRowBand1ColBand1LC; res = styles.rightRowBand1ColBand1LC;
else else
res = styles.rightBottomRowBand1ColBand2LC; res = styles.rightRowBand1ColBand2LC;
} }
else else
{ {
if(0 == colIndex % 2) if(0 == colIndex % 2)
res = styles.rightBottomRowBand2ColBand1LC; res = styles.rightRowBand2ColBand1LC;
else else
res = styles.rightBottomRowBand2ColBand2LC; res = styles.rightRowBand2ColBand2LC;
} }
} }
} }
......
...@@ -3798,13 +3798,6 @@ ...@@ -3798,13 +3798,6 @@
} }
} }
} }
else if(totalsRowCount)
{
//var range = worksheet.getCell3(bbox.r2, bbox.c1);
//range.setValue(tableColumn.Name);
//range.setType(CellValueType.String);
}
} }
//заполняем стили //заполняем стили
......
...@@ -2687,19 +2687,19 @@ ...@@ -2687,19 +2687,19 @@
if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg) if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg)
{ {
ctx.setFillStyle(styleOptions.wholeTable.dxf.fill.bg); ctx.setFillStyle(styleOptions.wholeTable.dxf.fill.bg);
ctx.fillRect(0,0,xSize,ySize); ctx.fillRect(0, 0, xSize, ySize);
} }
else else
{ {
ctx.setFillStyle(whiteColor); ctx.setFillStyle(whiteColor);
ctx.fillRect(0,0,xSize,ySize); ctx.fillRect(0, 0, xSize, ySize);
} }
if(styleInfo.ShowColumnStripes)//column stripes if(styleInfo.ShowColumnStripes)//column stripes
{ {
for(k = 0; k < 6; k++) for(k = 0; k < 6; k++)
{ {
color = defaultColorBackground; color = defaultColorBackground;
if((k)%2 == 0) if(k % 2 == 0)
{ {
if(styleOptions.firstColumnStripe && styleOptions.firstColumnStripe.dxf.fill && null != styleOptions.firstColumnStripe.dxf.fill.bg) if(styleOptions.firstColumnStripe && styleOptions.firstColumnStripe.dxf.fill && null != styleOptions.firstColumnStripe.dxf.fill.bg)
color = styleOptions.firstColumnStripe.dxf.fill.bg; color = styleOptions.firstColumnStripe.dxf.fill.bg;
...@@ -2714,79 +2714,73 @@ ...@@ -2714,79 +2714,73 @@
color = styleOptions.wholeTable.dxf.fill.bg; color = styleOptions.wholeTable.dxf.fill.bg;
} }
ctx.setFillStyle(color); ctx.setFillStyle(color);
ctx.fillRect(k*stepX,0,stepX,ySize); ctx.fillRect(k * stepX, 0, stepX, ySize);
} }
} }
if(styleInfo.ShowRowStripes)//row stripes if(styleInfo.ShowRowStripes)//row stripes
{ {
for(k = 0; k < 6; k++) for(var k = 0; k < 6; k++)
{ {
color = null; color = null;
if(styleOptions)//styleOptions.headerRow
{ if(k == 0 && styleInfo.HeaderRowCount)
if(k ==0) continue;
k++;
if((k)%2 != 0) if(styleInfo.HeaderRowCount)
{ {
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg) if(k % 2 != 0)
color = styleOptions.firstRowStripe.dxf.fill.bg; {
} if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg)
else {
{ color = styleOptions.firstRowStripe.dxf.fill.bg;
if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg) }
color = styleOptions.secondRowStripe.dxf.fill.bg; }
else if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg) else
color = styleOptions.wholeTable.dxf.fill.bg; {
if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg)
} {
if(color != null) color = styleOptions.secondRowStripe.dxf.fill.bg;
{ }
ctx.setFillStyle(color); }
if(k == 1) }
ctx.fillRect(0, k*stepY, xSize, stepY); else
else if(k == 3) {
ctx.fillRect(0, k*stepY, xSize,stepY); if(k % 2 != 0)
else {
ctx.fillRect(0, k*stepY, xSize, stepY); if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg)
//else {
//ctx.fillRect(0,k*stepY,xSize,stepY); color = styleOptions.secondRowStripe.dxf.fill.bg;
} }
}
} else
else {
{ if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg)
color = null; {
if((k+1)%2 != 0) color = styleOptions.firstRowStripe.dxf.fill.bg;
{ }
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg) }
color = styleOptions.firstRowStripe.dxf.fill.bg; }
}
else if(color != null)
{ {
if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg) ctx.setFillStyle(color);
color = styleOptions.secondRowStripe.dxf.fill.bg; ctx.fillRect(0, k * stepY, xSize, stepY);
else if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg) }
color = styleOptions.wholeTable.dxf.fill.bg;
}
if(color != null)
{
ctx.setFillStyle(color);
ctx.fillRect(0, k*stepY, xSize, stepY);
}
}
} }
} }
if(styleInfo.ShowFirstColumn && styleOptions.firstColumn)//first column if(styleInfo.ShowFirstColumn && styleOptions.firstColumn)//first column
{ {
if(styleOptions.firstColumn && styleOptions.firstColumn.dxf.fill && null != styleOptions.firstColumn.dxf.fill.bg) color = null;
ctx.setFillStyle(styleOptions.firstColumn.dxf.fill.bg); if(styleOptions.firstColumn && styleOptions.firstColumn.dxf.fill && null != styleOptions.firstColumn.dxf.fill.bg)
else color = styleOptions.firstColumn.dxf.fill.bg;
ctx.setFillStyle(defaultColorBackground);
ctx.fillRect(0,0,stepX,ySize); if(color != null)
{
ctx.setFillStyle(color);
ctx.fillRect(0, 0, stepX, ySize);
}
} }
if(styleInfo.ShowLastColumn)//last column if(styleInfo.ShowLastColumn)//last column
{ {
...@@ -2797,7 +2791,7 @@ ...@@ -2797,7 +2791,7 @@
if(color != null) if(color != null)
{ {
ctx.setFillStyle(color); ctx.setFillStyle(color);
ctx.fillRect(4*stepX,0,stepX,ySize); ctx.fillRect(4*stepX + 1, 0, stepX, ySize);
} }
} }
...@@ -2947,7 +2941,7 @@ ...@@ -2947,7 +2941,7 @@
ctx.lineVer(0, xSize, ySize); ctx.lineVer(0, xSize, ySize);
} }
} }
if(styleOptions.headerRow && styleOptions.headerRow.dxf.border)//header row if(styleOptions.headerRow && styleOptions.headerRow.dxf.border && styleInfo.HeaderRowCount)//header row
{ {
border = styleOptions.headerRow.dxf.border; border = styleOptions.headerRow.dxf.border;
if(border.t.s !== c_oAscBorderStyles.None) if(border.t.s !== c_oAscBorderStyles.None)
......
...@@ -13183,7 +13183,7 @@ ...@@ -13183,7 +13183,7 @@
History.StartTransaction(); History.StartTransaction();
this.model.autoFilters.changeTableRange(tableName, range); this.model.autoFilters.changeTableRange(tableName, range);
this._onUpdateFormatTable(isChangeRange, false, true); //this._onUpdateFormatTable(isChangeRange, false, true);
//TODO добавить перерисовку таблицы и перерисовку шаблонов //TODO добавить перерисовку таблицы и перерисовку шаблонов
History.EndTransaction(); History.EndTransaction();
}; };
...@@ -13198,9 +13198,14 @@ ...@@ -13198,9 +13198,14 @@
{ {
res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError; res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError;
} }
else if(range.r1 !== tablePart.Ref.r1) else
{ {
res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError; var tablePart = intersectionTables[0];
if(range.r1 !== tablePart.Ref.r1)
{
res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError;
}
} }
return res; return res;
......
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