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

Bug 26139 - Сохранение стиля ячейки при копировании с помощью маркера заполнения

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58026 954022d7-b5bf-4e40-9824-e11837661b57
parent e1bfac3b
...@@ -3971,12 +3971,14 @@ function Cell(worksheet){ ...@@ -3971,12 +3971,14 @@ function Cell(worksheet){
this.formulaParsed = null; this.formulaParsed = null;
} }
Cell.prototype.getStyle=function(){ Cell.prototype.getStyle=function(){
if(this.bNeedCompileXfs) return this.xfs;
{ };
this.bNeedCompileXfs = false; Cell.prototype.getCompiledStyle = function () {
this.compileXfs(); if (this.bNeedCompileXfs) {
} this.bNeedCompileXfs = false;
return this.compiledXfs; this.compileXfs();
}
return this.compiledXfs;
}; };
Cell.prototype.compileXfs=function(){ Cell.prototype.compileXfs=function(){
this.compiledXfs = null; this.compiledXfs = null;
...@@ -5664,7 +5666,7 @@ Range.prototype.getXfId=function(){ ...@@ -5664,7 +5666,7 @@ Range.prototype.getXfId=function(){
var nCol = this.bbox.c1; var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) { if(null != cell) {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.XfId) if(null != xfs && null != xfs.XfId)
return xfs.XfId; return xfs.XfId;
} else { } else {
...@@ -5693,7 +5695,7 @@ Range.prototype.getNumFormatStr=function(){ ...@@ -5693,7 +5695,7 @@ Range.prototype.getNumFormatStr=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.num) if(null != xfs && null != xfs.num)
return xfs.num.f; return xfs.num.f;
} }
...@@ -5718,7 +5720,7 @@ Range.prototype.getFont = function(){ ...@@ -5718,7 +5720,7 @@ Range.prototype.getFont = function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font; return xfs.font;
} }
...@@ -5740,7 +5742,7 @@ Range.prototype.getFontname=function(){ ...@@ -5740,7 +5742,7 @@ Range.prototype.getFontname=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.fn; return xfs.font.fn;
} }
...@@ -5762,7 +5764,7 @@ Range.prototype.getFontsize=function(){ ...@@ -5762,7 +5764,7 @@ Range.prototype.getFontsize=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.fs; return xfs.font.fs;
} }
...@@ -5784,7 +5786,7 @@ Range.prototype.getFontcolor=function(){ ...@@ -5784,7 +5786,7 @@ Range.prototype.getFontcolor=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.c; return xfs.font.c;
} }
...@@ -5806,7 +5808,7 @@ Range.prototype.getBold=function(){ ...@@ -5806,7 +5808,7 @@ Range.prototype.getBold=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.b; return xfs.font.b;
} }
...@@ -5828,7 +5830,7 @@ Range.prototype.getItalic=function(){ ...@@ -5828,7 +5830,7 @@ Range.prototype.getItalic=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.i; return xfs.font.i;
} }
...@@ -5850,7 +5852,7 @@ Range.prototype.getUnderline=function(){ ...@@ -5850,7 +5852,7 @@ Range.prototype.getUnderline=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.u; return xfs.font.u;
} }
...@@ -5872,7 +5874,7 @@ Range.prototype.getStrikeout=function(){ ...@@ -5872,7 +5874,7 @@ Range.prototype.getStrikeout=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.s; return xfs.font.s;
} }
...@@ -5894,7 +5896,7 @@ Range.prototype.getFontAlign=function(){ ...@@ -5894,7 +5896,7 @@ Range.prototype.getFontAlign=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
return xfs.font.va; return xfs.font.va;
} }
...@@ -5916,7 +5918,7 @@ Range.prototype.getQuotePrefix=function(){ ...@@ -5916,7 +5918,7 @@ Range.prototype.getQuotePrefix=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.QuotePrefix) if(null != xfs && null != xfs.QuotePrefix)
return xfs.QuotePrefix; return xfs.QuotePrefix;
} }
...@@ -5928,7 +5930,7 @@ Range.prototype.getAlignVertical=function(){ ...@@ -5928,7 +5930,7 @@ Range.prototype.getAlignVertical=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) if(null != xfs)
{ {
if(null != xfs.align) if(null != xfs.align)
...@@ -5955,7 +5957,7 @@ Range.prototype.getAlignHorizontal=function(){ ...@@ -5955,7 +5957,7 @@ Range.prototype.getAlignHorizontal=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) if(null != xfs)
{ {
if(null != xfs.align) if(null != xfs.align)
...@@ -6017,7 +6019,7 @@ Range.prototype.getFill=function(){ ...@@ -6017,7 +6019,7 @@ Range.prototype.getFill=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.fill) if(null != xfs && null != xfs.fill)
return xfs.fill.bg; return xfs.fill.bg;
} }
...@@ -6047,7 +6049,7 @@ Range.prototype.getBorderSrc=function(_cell){ ...@@ -6047,7 +6049,7 @@ Range.prototype.getBorderSrc=function(_cell){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.border) if(null != xfs && null != xfs.border)
return xfs.border; return xfs.border;
} }
...@@ -6120,7 +6122,7 @@ Range.prototype.getShrinkToFit=function(){ ...@@ -6120,7 +6122,7 @@ Range.prototype.getShrinkToFit=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) if(null != xfs)
{ {
if(null != xfs.align) if(null != xfs.align)
...@@ -6150,7 +6152,7 @@ Range.prototype.getWrap=function(){ ...@@ -6150,7 +6152,7 @@ Range.prototype.getWrap=function(){
var nCol = this.bbox.c1; var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) { if(null != cell) {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) { if(null != xfs) {
if(null != xfs.align) if(null != xfs.align)
return this.getWrapByAlign(xfs.align); return this.getWrapByAlign(xfs.align);
...@@ -6175,7 +6177,7 @@ Range.prototype.getAngle=function(){ ...@@ -6175,7 +6177,7 @@ Range.prototype.getAngle=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) if(null != xfs)
{ {
if(null != xfs.align) if(null != xfs.align)
...@@ -6202,7 +6204,7 @@ Range.prototype.getVerticalText=function(){ ...@@ -6202,7 +6204,7 @@ Range.prototype.getVerticalText=function(){
var cell = this.worksheet._getCellNoEmpty(nRow, nCol); var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getCompiledStyle();
if(null != xfs) if(null != xfs)
{ {
if(null != xfs.align) if(null != xfs.align)
......
...@@ -2902,7 +2902,7 @@ CCellValue.prototype = ...@@ -2902,7 +2902,7 @@ CCellValue.prototype =
if(CellValueType.String == this.type) if(CellValueType.String == this.type)
bNeedMeasure = false; bNeedMeasure = false;
var oNumFormat; var oNumFormat;
var xfs = this.cell.getStyle(); var xfs = this.cell.getCompiledStyle();
if(null != xfs && null != xfs.num) if(null != xfs && null != xfs.num)
oNumFormat = oNumFormatCache.get(xfs.num.f); oNumFormat = oNumFormatCache.get(xfs.num.f);
else else
...@@ -3023,7 +3023,7 @@ CCellValue.prototype = ...@@ -3023,7 +3023,7 @@ CCellValue.prototype =
//применяем форматирование //применяем форматирование
var oValueText = null; var oValueText = null;
var oValueArray = null; var oValueArray = null;
var xfs = this.cell.getStyle(); var xfs = this.cell.getCompiledStyle();
if(this.cell.sFormula) if(this.cell.sFormula)
oValueText = "="+this.cell.sFormula; oValueText = "="+this.cell.sFormula;
else else
...@@ -3122,7 +3122,7 @@ CCellValue.prototype = ...@@ -3122,7 +3122,7 @@ CCellValue.prototype =
sText = ""; sText = "";
var color; var color;
var cellfont; var cellfont;
var xfs = this.cell.getStyle(); var xfs = this.cell.getCompiledStyle();
if(null != xfs && null != xfs.font) if(null != xfs && null != xfs.font)
cellfont = xfs.font; cellfont = xfs.font;
else else
...@@ -3188,7 +3188,7 @@ CCellValue.prototype = ...@@ -3188,7 +3188,7 @@ CCellValue.prototype =
if("" == val) if("" == val)
return; return;
var oNumFormat; var oNumFormat;
var xfs = this.cell.getStyle(); var xfs = this.cell.getCompiledStyle();
if(null != xfs && null != xfs.num) if(null != xfs && null != xfs.num)
oNumFormat = oNumFormatCache.get(xfs.num.f); oNumFormat = oNumFormatCache.get(xfs.num.f);
else else
......
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