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

поправлены некоторые стили таблиц.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47411 954022d7-b5bf-4e40-9824-e11837661b57
parent 020482a2
......@@ -6170,63 +6170,230 @@ CTableStyle.prototype =
{
getStyle: function(bbox, rowAbs, colAbs, rowIndex, colIndex, options, headerRowCount, totalsRowCount)
{
//todo есть проблемы при малых размерах таблиц
var res = null;
if(null == this.compiled)
this._compile();
var res = null;
var styles = this._getOption(options, headerRowCount, totalsRowCount);
if(headerRowCount > 0 && rowAbs == bbox.r1)
res = this.compiled.header;
{
if(colAbs == bbox.c1)
res = styles.headerLeftTop;
else if(colAbs == bbox.c2)
res = styles.headerRightTop;
else
res = styles.header;
}
else if(totalsRowCount > 0 && rowAbs == bbox.r2)
res = this.compiled.total;
else
{
var option = this._getOption(options);
if(options.ShowFirstColumn && colAbs == bbox.c1)
if(colAbs == bbox.c1)
res = styles.totalLeftBottom;
else if(colAbs == bbox.c2)
res = styles.totalRightBottom;
else
res = styles.total;
}
else if(options.ShowFirstColumn && colAbs == bbox.c1)
{
if(rowAbs == bbox.r1 + headerRowCount)
res = styles.leftTopFC;
else if(rowAbs == bbox.r2 - totalsRowCount)
{
if(0 == (rowIndex - headerRowCount) % 2)
res = styles.leftBottomRowBand1FC;
else
res = styles.leftBottomRowBand2FC;
}
else
{
if(0 == (rowIndex - headerRowCount) % 2)
res = styles.leftRowBand1FC;
else
res = styles.leftRowBand2FC;
}
}
else if(options.ShowLastColumn && colAbs == bbox.c2)
{
if(rowAbs == bbox.r1 + headerRowCount)
{
if(0 == colIndex % 2)
res = styles.rightTopColBand1LC;
else
res = styles.rightTopColBand2LC;
}
else if(rowAbs == bbox.r2 - totalsRowCount)
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = styles.rightRowBand1ColBand1LC;
else
res = styles.rightRowBand1ColBand2LC;
}
else
{
if(0 == colIndex % 2)
res = styles.rightRowBand2ColBand1LC;
else
res = styles.rightRowBand2ColBand2LC;
}
}
else
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = styles.rightBottomRowBand1ColBand1LC;
else
res = styles.rightBottomRowBand1ColBand2LC;
}
else
{
if(0 == colIndex % 2)
res = styles.rightBottomRowBand2ColBand1LC;
else
res = styles.rightBottomRowBand2ColBand2LC;
}
}
}
else if(options.ShowRowStripes || options.ShowColumnStripes)
{
if(rowAbs == bbox.r1)
{
if(colAbs == bbox.c1)
res = styles.leftTop;
else if(colAbs == bbox.c2)
{
if(0 == colIndex % 2)
res = styles.rightTopColBand1;
else
res = styles.rightTopColBand2;
}
else
{
if(0 == colIndex % 2)
res = styles.topColBand1;
else
res = styles.topColBand2;
}
}
else if(rowAbs == bbox.r2)
{
if(colAbs == bbox.c1)
{
if(0 == (rowIndex - headerRowCount) % 2)
res = styles.leftBottomRowBand1;
else
res = styles.leftBottomRowBand2;
}
else if(colAbs == bbox.c2)
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = styles.rightBottomRowBand1ColBand1;
else
res = styles.rightBottomRowBand1ColBand2;
}
else
{
if(0 == colIndex % 2)
res = styles.rightBottomRowBand2ColBand1;
else
res = styles.rightBottomRowBand2ColBand2;
}
}
else
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = styles.bottomRowBand1ColBand1;
else
res = styles.bottomRowBand1ColBand2;
}
else
{
if(0 == colIndex % 2)
res = styles.bottomRowBand2ColBand1;
else
res = styles.bottomRowBand2ColBand2;
}
}
}
else if(colAbs == bbox.c1)
{
if(0 == (rowIndex - headerRowCount) % 2)
res = option.leftRowFirstColFirst;
res = styles.leftRowBand1;
else
res = option.leftRowSecondColFirst;
res = styles.leftRowBand2;
}
else if(options.ShowLastColumn && colAbs == bbox.c2)
else if(colAbs == bbox.c2)
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = option.rightRowFirstColFirst;
res = styles.rightRowBand1ColBand1;
else
res = option.rightRowFirstColSecond;
res = styles.rightRowBand1ColBand2;
}
else
{
if(0 == colIndex % 2)
res = option.rightRowSecondColFirst;
res = styles.rightRowBand2ColBand1;
else
res = option.rightRowSecondColSecond;
res = styles.rightRowBand2ColBand2;
}
}
else if(options.ShowRowStripes || options.ShowColumnStripes)
else
{
if(0 == (rowIndex - headerRowCount) % 2)
{
if(0 == colIndex % 2)
res = option.rowFirstColFirst;
res = styles.innerRowBand1ColBand1;
else
res = option.rowFirstColSecond;
res = styles.innerRowBand1ColBand2;
}
else
{
if(0 == colIndex % 2)
res = option.rowSecondColFirst;
res = styles.innerRowBand2ColBand1;
else
res = option.rowSecondColSecond;
res = styles.innerRowBand2ColBand2;
}
}
}
else
{
styles = this.compiled.empty;
if(rowAbs == bbox.r1)
{
if(colAbs == bbox.c1)
res = styles.emptyLeftTop;
else if(colAbs == bbox.c2)
res = styles.emptyRightTop;
else
res = styles.emptyTop;
}
else if(rowAbs == bbox.r2)
{
if(colAbs == bbox.c1)
res = styles.emptyLeftBottom;
else if(colAbs == bbox.c2)
res = styles.emptyRightBottom;
else
res = styles.emptyBottom;
}
else if(colAbs == bbox.c1)
res = styles.emptyLeft;
else if(colAbs == bbox.c2)
res = styles.emptyRight;
else
res = this.wholeTable.dxf;
res = styles.emptyInner;
}
return res;
},
_getOption: function(options)
_getOption: function(options, headerRowCount, totalsRowCount)
{
var nBitMask = 0;
if(options.ShowFirstColumn)
......@@ -6237,101 +6404,412 @@ CTableStyle.prototype =
nBitMask += 1 << 2;
if(options.ShowColumnStripes)
nBitMask += 1 << 3;
if(headerRowCount > 0)
nBitMask += 1 << 4;
if(totalsRowCount > 0)
nBitMask += 1 << 5;
var styles = this.compiled.options[nBitMask];
if(null == styles)
{
styles = {
leftRowFirstColFirst: new CellXfs(),
leftRowSecondColFirst: new CellXfs(),
rowFirstColFirst: new CellXfs(),
rowSecondColFirst: new CellXfs(),
rowFirstColSecond: new CellXfs(),
rowSecondColSecond: new CellXfs(),
rightRowFirstColFirst: new CellXfs(),
rightRowSecondColFirst: new CellXfs(),
rightRowFirstColSecond: new CellXfs(),
rightRowSecondColSecond: new CellXfs()
var configs = {
header: {header: true, top: true},
headerLeftTop: {header: true, left: true, top: true},
headerRightTop: {header: true, right: true, top: true},
total: {total: true, bottom: true},
totalLeftBottom: {total: true, left: true, bottom: true},
totalRightBottom: {total: true, right: true, bottom: true},
leftTop: {ShowRowStripes: true, ShowColumnStripes: true, left: true, top: true, RowBand1: true, ColBand1: true},
leftBottomRowBand1: {ShowRowStripes: true, ShowColumnStripes: true, left: true, bottom: true, RowBand1: true, ColBand1: true},
leftBottomRowBand2: {ShowRowStripes: true, ShowColumnStripes: true, left: true, bottom: true, RowBand2: true, ColBand1: true},
leftRowBand1: {ShowRowStripes: true, ShowColumnStripes: true, left: true, RowBand1: true, ColBand1: true},
leftRowBand2: {ShowRowStripes: true, ShowColumnStripes: true, left: true, RowBand2: true, ColBand1: true},
rightTopColBand1: {ShowRowStripes: true, ShowColumnStripes: true, right: true, top: true, RowBand1: true, ColBand1: true},
rightTopColBand2: {ShowRowStripes: true, ShowColumnStripes: true, right: true, top: true, RowBand1: true, ColBand2: true},
rightRowBand1ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand1: true, ColBand1: true},
rightRowBand1ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand1: true, ColBand2: true},
rightRowBand2ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand2: true, ColBand1: true},
rightRowBand2ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand2: true, ColBand2: true},
rightBottomRowBand1ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand1: true, ColBand1: true},
rightBottomRowBand1ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand1: true, ColBand2: true},
rightBottomRowBand2ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand2: true, ColBand1: true},
rightBottomRowBand2ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand2: true, ColBand2: true},
topColBand1: {ShowRowStripes: true, ShowColumnStripes: true, top: true, RowBand1: true, ColBand1: true},
topColBand2: {ShowRowStripes: true, ShowColumnStripes: true, top: true, RowBand1: true, ColBand2: true},
bottomRowBand1ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, bottom: true, RowBand1: true, ColBand1: true},
bottomRowBand1ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, bottom: true, RowBand1: true, ColBand2: true},
bottomRowBand2ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, bottom: true, RowBand2: true, ColBand1: true},
bottomRowBand2ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, bottom: true, RowBand2: true, ColBand2: true},
innerRowBand1ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, RowBand1: true, ColBand1: true},
innerRowBand1ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, RowBand1: true, ColBand2: true},
innerRowBand2ColBand1: {ShowRowStripes: true, ShowColumnStripes: true, RowBand2: true, ColBand1: true},
innerRowBand2ColBand2: {ShowRowStripes: true, ShowColumnStripes: true, RowBand2: true, ColBand2: true},
leftTopFC: {ShowFirstColumn: true, ShowRowStripes: true, ShowColumnStripes: true, left: true, top: true, RowBand1: true, ColBand1: true},
leftBottomRowBand1FC: {ShowFirstColumn: true, ShowRowStripes: true, ShowColumnStripes: true, left: true, bottom: true, RowBand1: true, ColBand1: true},
leftBottomRowBand2FC: {ShowFirstColumn: true, ShowRowStripes: true, ShowColumnStripes: true, left: true, bottom: true, RowBand2: true, ColBand1: true},
leftRowBand1FC: {ShowFirstColumn: true, ShowRowStripes: true, ShowColumnStripes: true, left: true, RowBand1: true, ColBand1: true},
leftRowBand2FC: {ShowFirstColumn: true, ShowRowStripes: true, ShowColumnStripes: true, left: true, RowBand2: true, ColBand1: true},
rightTopColBand1LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, top: true, RowBand1: true, ColBand1: true},
rightTopColBand2LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, top: true, RowBand1: true, ColBand2: true},
rightRowBand1ColBand1LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand1: true, ColBand1: true},
rightRowBand1ColBand2LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand1: true, ColBand2: true},
rightRowBand2ColBand1LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand2: true, ColBand1: true},
rightRowBand2ColBand2LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, RowBand2: true, ColBand2: true},
rightBottomRowBand1ColBand1LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand1: true, ColBand1: true},
rightBottomRowBand1ColBand2LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand1: true, ColBand2: true},
rightBottomRowBand2ColBand1LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand2: true, ColBand1: true},
rightBottomRowBand2ColBand2LC: {ShowLastColumn: true, ShowRowStripes: true, ShowColumnStripes: true, right: true, bottom: true, RowBand2: true, ColBand2: true}
}
var styles = new Object();
for(var i in configs)
{
styles[i] = new CellXfs();
}
this._compileOption(options, styles);
this._compileOption(options, headerRowCount, totalsRowCount, styles, configs);
this.compiled.options[nBitMask] = styles;
}
if(null == this.compiled.empty)
{
var empty = {
emptyLeftTop: new CellXfs(),
emptyTop: new CellXfs(),
emptyRightTop: new CellXfs(),
emptyRight: new CellXfs(),
emptyRightBottom: new CellXfs(),
emptyBottom: new CellXfs(),
emptyLeftBottom: new CellXfs(),
emptyLeft: new CellXfs(),
emptyInner: new CellXfs()
};
this._compileEmpty(empty);
this.compiled.empty = empty;
}
return styles;
},
_compileOption : function(options, styles)
_compileSetBorder : function(inputDxf, outputDxf, bLeft, bTop, bRight, bBottom, bInnerHor, bInnerVer)
{
if(null != inputDxf && null != inputDxf.border)
{
var oCurBorder = inputDxf.border;
var oNewBorder = new Border();
if(bLeft)
oNewBorder.l = oCurBorder.l;
else if(bInnerVer)
oNewBorder.l = oCurBorder.iv;
if(bTop)
oNewBorder.t = oCurBorder.t;
else if(bInnerHor)
oNewBorder.t = oCurBorder.ih;
if(bRight)
oNewBorder.r = oCurBorder.r;
else if(bInnerVer)
oNewBorder.r = oCurBorder.iv;
if(bBottom)
oNewBorder.b = oCurBorder.b;
else if(bInnerHor)
oNewBorder.b = oCurBorder.ih;
if(null == outputDxf.border)
outputDxf.border = oNewBorder;
else
outputDxf.border = outputDxf.border.merge(oNewBorder);
}
},
_compileEmpty : function(styles)
{
for(var i in styles)
{
var elem = styles[i];
var xfs = elem;
if(options.ShowFirstColumn && elem == styles.leftRowFirstColFirst || elem == styles.leftRowSecondColFirst)
if(null != this.wholeTable)
{
if(null != this.firstColumn)
xfs = xfs.merge(this.firstColumn.dxf);
var elem = styles[i];
var xfs = elem;
xfs = xfs.merge(this.compiled.wholeTable.dxf);
//применяем бордер
if(elem == styles.emptyLeftTop)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, true, false, false, true, true);
else if(elem == styles.emptyTop)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, true, false, false, true, true);
else if(elem == styles.emptyRightTop)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, true, true, false, true, true);
else if(elem == styles.emptyRight)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, false, true, true);
else if(elem == styles.emptyRightBottom)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, true, true, true);
else if(elem == styles.emptyBottom)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, true, true, true);
else if(elem == styles.emptyLeftBottom)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, true, true, true);
else if(elem == styles.emptyLeft)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, false, true, true);
else if(elem == styles.emptyInner)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, false, true, true);
styles[i] = xfs;
}
else if(options.ShowLastColumn && elem == styles.rightRowFirstColFirst || elem == styles.rightRowSecondColFirst ||
elem == styles.rightRowFirstColSecond || elem == styles.rightRowSecondColSecond)
}
},
_compileOption : function(options, headerRowCount, totalsRowCount, styles, configs)
{
for(var i in styles)
{
var xfs = styles[i];
var config = configs[i];
if(headerRowCount > 0 && config.header)
{
if(null != this.lastColumn)
xfs = xfs.merge(this.lastColumn.dxf);
if(options.ShowFirstColumn && null != this.firstHeaderCell && config.left)
xfs = xfs.merge(this.firstHeaderCell.dxf);
if(options.ShowLastColumn && null != this.lastHeaderCell && config.right)
xfs = xfs.merge(this.lastHeaderCell.dxf);
if(null != this.headerRow)
{
xfs = xfs.merge(this.compiled.headerRow.dxf);
//применяем бордер
if(config.left)
this._compileSetBorder(this.headerRow.dxf, xfs, true, true, false, true, false, true);
else if(config.right)
this._compileSetBorder(this.headerRow.dxf, xfs, false, true, true, true, false, true);
else
this._compileSetBorder(this.headerRow.dxf, xfs, false, true, false, true, false, true);
}
if(options.ShowFirstColumn && null != this.firstColumn && config.left)
{
xfs = xfs.merge(this.compiled.firstColumn.dxf);
//применяем бордер
this._compileSetBorder(this.firstColumn.dxf, xfs, true, true, true, false, true, false);
}
if(options.ShowLastColumn && null != this.lastColumn && config.right)
{
xfs = xfs.merge(this.compiled.lastColumn.dxf);
//применяем бордер
this._compileSetBorder(this.lastColumn.dxf, xfs, true, true, true, false, true, false);
}
}
if(options.ShowRowStripes)
else if(totalsRowCount > 0 && config.total)
{
if(elem == styles.leftRowFirstColFirst || elem == styles.rowFirstColFirst ||
elem == styles.rowFirstColSecond || elem == styles.rightRowFirstColFirst || elem == styles.rightRowFirstColSecond)
if(options.ShowFirstColumn && null != this.firstTotalCell && config.left)
xfs = xfs.merge(this.firstTotalCell.dxf);
if(options.ShowLastColumn && null != this.lastTotalCell && config.right)
xfs = xfs.merge(this.lastTotalCell.dxf);
if(null != this.totalRow)
{
if(null != this.firstRowStripe)
xfs = xfs.merge(this.firstRowStripe.dxf);
xfs = xfs.merge(this.compiled.totalRow.dxf);
//применяем бордер
if(config.left)
this._compileSetBorder(this.totalRow.dxf, xfs, true, true, false, true, false, true);
else if(config.right)
this._compileSetBorder(this.totalRow.dxf, xfs, false, true, true, true, false, true);
else
this._compileSetBorder(this.totalRow.dxf, xfs, false, true, false, true, false, true);
}
else
if(options.ShowFirstColumn && null != this.firstColumn && config.left)
{
xfs = xfs.merge(this.compiled.firstColumn.dxf);
//применяем бордер
this._compileSetBorder(this.firstColumn.dxf, xfs, true, false, true, true, true, false);
}
if(options.ShowLastColumn && null != this.lastColumn && config.right)
{
if(null != this.secondRowStripe)
xfs = xfs.merge(this.secondRowStripe.dxf);
xfs = xfs.merge(this.compiled.lastColumn.dxf);
//применяем бордер
this._compileSetBorder(this.lastColumn.dxf, xfs, true, false, true, true, true, false);
}
}
if(options.ShowColumnStripes)
else
{
if(elem == styles.leftRowFirstColFirst || elem == styles.leftRowSecondColFirst ||
elem == styles.rowFirstColFirst || elem == styles.rowSecondColFirst ||
elem == styles.rightRowFirstColFirst || elem == styles.rightRowSecondColFirst)
if(options.ShowFirstColumn && null != this.firstColumn && config.ShowFirstColumn)
{
if(null != this.firstColumnStripe)
xfs = xfs.merge(this.firstColumnStripe.dxf);
xfs = xfs.merge(this.compiled.firstColumn.dxf);
//применяем бордер
if(config.left && config.top)
{
if(headerRowCount > 0)
this._compileSetBorder(this.firstColumn.dxf, xfs, true, false, true, false, true, false);
else
this._compileSetBorder(this.firstColumn.dxf, xfs, true, true, true, false, true, false);
}
else if(config.left && config.bottom)
{
if(totalsRowCount > 0)
this._compileSetBorder(this.firstColumn.dxf, xfs, true, false, true, false, true, false);
else
this._compileSetBorder(this.firstColumn.dxf, xfs, true, false, true, true, true, false);
}
else
this._compileSetBorder(this.firstColumn.dxf, xfs, true, false, true, false, true, false);
}
else
else if(options.ShowLastColumn && null != this.lastColumn && config.ShowLastColumn)
{
if(null != this.secondColumnStripe)
xfs = xfs.merge(this.secondColumnStripe.dxf);
xfs = xfs.merge(this.compiled.lastColumn.dxf);
//применяем бордер
if(config.right && config.top)
{
if(headerRowCount > 0)
this._compileSetBorder(this.lastColumn.dxf, xfs, true, false, true, false, true, false);
else
this._compileSetBorder(this.lastColumn.dxf, xfs, true, true, true, false, true, false);
}
else if(config.right && config.bottom)
{
if(totalsRowCount > 0)
this._compileSetBorder(this.lastColumn.dxf, xfs, true, false, true, false, true, false);
else
this._compileSetBorder(this.lastColumn.dxf, xfs, true, false, true, true, true, false);
}
else
this._compileSetBorder(this.lastColumn.dxf, xfs, true, false, true, false, true, false);
}
if(options.ShowRowStripes && config.ShowRowStripes)
{
if(null != this.firstRowStripe && config.RowBand1)
{
xfs = xfs.merge(this.compiled.firstRowStripe.dxf);
//применяем бордер
if(config.left)
this._compileSetBorder(this.firstRowStripe.dxf, xfs, true, true, false, true, false, true);
else if(config.right)
this._compileSetBorder(this.firstRowStripe.dxf, xfs, false, true, true, true, false, true);
else
this._compileSetBorder(this.firstRowStripe.dxf, xfs, false, true, false, true, false, true);
}
else if(null != this.secondRowStripe && config.RowBand2)
{
xfs = xfs.merge(this.compiled.secondRowStripe.dxf);
//применяем бордер
if(config.left)
this._compileSetBorder(this.secondRowStripe.dxf, xfs, true, true, false, true, false, true);
else if(config.right)
this._compileSetBorder(this.secondRowStripe.dxf, xfs, false, true, true, true, false, true);
else
this._compileSetBorder(this.secondRowStripe.dxf, xfs, false, true, false, true, false, true);
}
}
if(options.ShowColumnStripes && config.ShowRowStripes)
{
if(null != this.firstColumnStripe && config.ColBand1)
{
xfs = xfs.merge(this.compiled.firstColumnStripe.dxf);
//применяем бордер
if(config.top)
this._compileSetBorder(this.firstColumnStripe.dxf, xfs, true, true, true, false, true, false);
else if(config.bottom)
this._compileSetBorder(this.firstColumnStripe.dxf, xfs, true, false, true, true, true, false);
else
this._compileSetBorder(this.firstColumnStripe.dxf, xfs, true, false, true, false, true, false);
}
else if(null != this.secondColumnStripe && config.ColBand2)
{
xfs = xfs.merge(this.compiled.secondColumnStripe.dxf);
//применяем бордер
if(config.top)
this._compileSetBorder(this.secondColumnStripe.dxf, xfs, true, true, true, false, true, false);
else if(config.bottom)
this._compileSetBorder(this.secondColumnStripe.dxf, xfs, true, false, true, true, true, false);
else
this._compileSetBorder(this.secondColumnStripe.dxf, xfs, true, false, true, false, true, false);
}
}
}
if(null != this.wholeTable)
xfs = xfs.merge(this.wholeTable.dxf);
{
xfs = xfs.merge(this.compiled.wholeTable.dxf);
//применяем бордер
if(config.top)
{
if(headerRowCount > 0 && false == config.header)
{
if(config.left)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, false, true, true);
else if(config.right)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, false, true, true);
else
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, false, true, true);
}
else
{
if(config.left)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, true, false, false, true, true);
else if(config.right)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, true, true, false, true, true);
else
this._compileSetBorder(this.wholeTable.dxf, xfs, false, true, false, false, true, true);
}
}
else if(config.bottom)
{
if(totalsRowCount > 0 && false == config.total)
{
if(config.left)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, false, true, true);
else if(config.right)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, false, true, true);
else
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, false, true, true);
}
else
{
if(config.left)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, true, true, true);
else if(config.right)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, true, true, true);
else
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, true, true, true);
}
}
else if(config.left)
this._compileSetBorder(this.wholeTable.dxf, xfs, true, false, false, false, true, true);
else if(config.right)
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, true, false, true, true);
else
this._compileSetBorder(this.wholeTable.dxf, xfs, false, false, false, false, true, true);
}
styles[i] = xfs;
}
},
_compile : function()
{
this.compiled = {
header: null,
total: null,
options: new Object()
};
//header
if(null != this.headerRow && null != this.wholeTable)
{
this.compiled.header = new CellXfs();
if(null != this.headerRow)
this.compiled.header = this.compiled.header.merge(this.headerRow.dxf);
if(null != this.wholeTable)
this.compiled.header = this.compiled.header.merge(this.wholeTable.dxf);
}
//total
if(null != this.totalRow && null != this.wholeTable)
{
this.compiled.total = new CellXfs();
if(null != this.totalRow)
this.compiled.total = this.compiled.total.merge(this.totalRow.dxf);
if(null != this.wholeTable)
this.compiled.total = this.compiled.total.merge(this.wholeTable.dxf);
options: new Object(),
empty: null,
blankRow: null,
firstColumn: null,
firstColumnStripe: null,
firstColumnSubheading: null,
firstHeaderCell: null,
firstRowStripe: null,
firstRowSubheading: null,
firstSubtotalColumn: null,
firstSubtotalRow: null,
firstTotalCell: null,
headerRow: null,
lastColumn: null,
lastHeaderCell: null,
lastTotalCell: null,
pageFieldLabels: null,
pageFieldValues: null,
secondColumnStripe: null,
secondColumnSubheading: null,
secondRowStripe: null,
secondRowSubheading: null,
secondSubtotalColumn: null,
secondSubtotalRow: null,
thirdColumnSubheading: null,
thirdRowSubheading: null,
thirdSubtotalColumn: null,
thirdSubtotalRow: null,
totalRow: null,
wholeTable: null
}
//копируем исходные стили только без border
for(var i in this)
{
var elem = this[i];
if(null != elem && elem instanceof CTableStyleElement)
{
var oNewElem = new CTableStyleElement();
oNewElem.size = elem.size;
oNewElem.dxf = elem.dxf.clone();
oNewElem.dxf.border = null;
this.compiled[i] = oNewElem;
}
}
}
}
......
......@@ -4495,9 +4495,9 @@
if(border)
{
if(border.t.s != 'none')
color = Asc.parseColor(borders.t.getRgbOrNull()).color;
color = Asc.parseColor(border.t.getRgbOrNull()).color;
else if(border.b.s != 'none')
color = Asc.parseColor(borders.b.getRgbOrNull()).color;
color = Asc.parseColor(border.b.getRgbOrNull()).color;
for(n = 1; n < 5; n++)
{
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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