Commit f792173c authored by GoshaZotov's avatar GoshaZotov

change functions for draw format tables

parent 95330a9e
...@@ -7052,16 +7052,16 @@ ...@@ -7052,16 +7052,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
...@@ -7069,16 +7069,16 @@ ...@@ -7069,16 +7069,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;
} }
} }
} }
......
...@@ -3816,13 +3816,6 @@ var maxIndividualValues = 10000; ...@@ -3816,13 +3816,6 @@ var maxIndividualValues = 10000;
} }
} }
} }
else if(totalsRowCount)
{
//var range = worksheet.getCell3(bbox.r2, bbox.c1);
//range.setValue(tableColumn.Name);
//range.setType(CellValueType.String);
}
} }
//заполняем стили //заполняем стили
......
...@@ -2691,19 +2691,19 @@ ...@@ -2691,19 +2691,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;
...@@ -2718,79 +2718,73 @@ ...@@ -2718,79 +2718,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)
continue;
if(styleInfo.HeaderRowCount)
{ {
if(k ==0) if(k % 2 != 0)
k++;
if((k)%2 != 0)
{ {
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg) if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg)
{
color = styleOptions.firstRowStripe.dxf.fill.bg; color = styleOptions.firstRowStripe.dxf.fill.bg;
} }
}
else else
{ {
if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg) if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg)
{
color = 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)
color = styleOptions.wholeTable.dxf.fill.bg;
} }
if(color != null)
{
ctx.setFillStyle(color);
if(k == 1)
ctx.fillRect(0, k*stepY, xSize, stepY);
else if(k == 3)
ctx.fillRect(0, k*stepY, xSize,stepY);
else
ctx.fillRect(0, k*stepY, xSize, stepY);
//else
//ctx.fillRect(0,k*stepY,xSize,stepY);
} }
} }
else else
{ {
color = null; if(k % 2 != 0)
if((k+1)%2 != 0)
{ {
if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg) if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg)
color = styleOptions.firstRowStripe.dxf.fill.bg; {
color = styleOptions.secondRowStripe.dxf.fill.bg;
}
} }
else else
{ {
if(styleOptions.secondRowStripe && styleOptions.secondRowStripe.dxf.fill && null != styleOptions.secondRowStripe.dxf.fill.bg) if(styleOptions.firstRowStripe && styleOptions.firstRowStripe.dxf.fill && null != styleOptions.firstRowStripe.dxf.fill.bg)
color = styleOptions.secondRowStripe.dxf.fill.bg; {
else if(styleOptions.wholeTable && styleOptions.wholeTable.dxf.fill && null != styleOptions.wholeTable.dxf.fill.bg) color = styleOptions.firstRowStripe.dxf.fill.bg;
color = styleOptions.wholeTable.dxf.fill.bg; }
}
} }
if(color != null) if(color != null)
{ {
ctx.setFillStyle(color); ctx.setFillStyle(color);
ctx.fillRect(0, k*stepY, xSize, stepY); ctx.fillRect(0, k * stepY, xSize, stepY);
} }
} }
} }
}
if(styleInfo.ShowFirstColumn && styleOptions.firstColumn)//first column if(styleInfo.ShowFirstColumn && styleOptions.firstColumn)//first column
{ {
color = null;
if(styleOptions.firstColumn && styleOptions.firstColumn.dxf.fill && null != styleOptions.firstColumn.dxf.fill.bg) if(styleOptions.firstColumn && styleOptions.firstColumn.dxf.fill && null != styleOptions.firstColumn.dxf.fill.bg)
ctx.setFillStyle(styleOptions.firstColumn.dxf.fill.bg); color = styleOptions.firstColumn.dxf.fill.bg;
else
ctx.setFillStyle(defaultColorBackground); if(color != null)
ctx.fillRect(0,0,stepX,ySize); {
ctx.setFillStyle(color);
ctx.fillRect(0, 0, stepX, ySize);
}
} }
if(styleInfo.ShowLastColumn)//last column if(styleInfo.ShowLastColumn)//last column
{ {
...@@ -2801,7 +2795,7 @@ ...@@ -2801,7 +2795,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);
} }
} }
...@@ -2951,7 +2945,7 @@ ...@@ -2951,7 +2945,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)
......
...@@ -13164,7 +13164,7 @@ ...@@ -13164,7 +13164,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();
}; };
...@@ -13179,11 +13179,16 @@ ...@@ -13179,11 +13179,16 @@
{ {
res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError; res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError;
} }
else if(range.r1 !== tablePart.Ref.r1) else
{
var tablePart = intersectionTables[0];
if(range.r1 !== tablePart.Ref.r1)
{ {
res = c_oAscError.ID.AutoFilterMoveToHiddenRangeError; 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