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

(1.0.0.72): XlsxSerializerCom

Чтение/запись scheme для шрифтов.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49561 954022d7-b5bf-4e40-9824-e11837661b57
parent bbd0a6fd
This diff is collapsed.
...@@ -6305,8 +6305,13 @@ Range.prototype.getAlignVertical=function(){ ...@@ -6305,8 +6305,13 @@ Range.prototype.getAlignVertical=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return xfs.align.ver; {
if(null != xfs.align)
return xfs.align.ver;
else
return g_oDefaultAlignAbs.ver;
}
} }
else else
{ {
...@@ -6327,8 +6332,13 @@ Range.prototype.getAlignHorizontal=function(){ ...@@ -6327,8 +6332,13 @@ Range.prototype.getAlignHorizontal=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return xfs.align.hor; {
if(null != xfs.align)
return xfs.align.hor;
else
return g_oDefaultAlignAbs.hor;
}
} }
else else
{ {
...@@ -6487,8 +6497,13 @@ Range.prototype.getShrinkToFit=function(){ ...@@ -6487,8 +6497,13 @@ Range.prototype.getShrinkToFit=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return xfs.align.shrink; {
if(null != xfs.align)
return xfs.align.shrink;
else
return g_oDefaultAlignAbs.shrink;
}
} }
else else
{ {
...@@ -6509,8 +6524,13 @@ Range.prototype.getWrap=function(){ ...@@ -6509,8 +6524,13 @@ Range.prototype.getWrap=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return xfs.align.wrap; {
if(null != xfs.align)
return xfs.align.wrap;
else
return g_oDefaultAlignAbs.wrap;
}
} }
else else
{ {
...@@ -6532,8 +6552,13 @@ Range.prototype.getAngle=function(){ ...@@ -6532,8 +6552,13 @@ Range.prototype.getAngle=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return angleFormatToInterface(xfs.align.angle); {
if(null != xfs.align)
return angleFormatToInterface(xfs.align.angle);
else
return angleFormatToInterface(g_oDefaultAlignAbs.angle);
}
} }
else else
{ {
...@@ -6554,8 +6579,13 @@ Range.prototype.getVerticalText=function(){ ...@@ -6554,8 +6579,13 @@ Range.prototype.getVerticalText=function(){
if(null != cell) if(null != cell)
{ {
var xfs = cell.getStyle(); var xfs = cell.getStyle();
if(null != xfs && null != xfs.align) if(null != xfs)
return g_nVerticalTextAngle == xfs.align.angle; {
if(null != xfs.align)
return g_nVerticalTextAngle == xfs.align.angle;
else
return g_nVerticalTextAngle == g_oDefaultAlignAbs.angle;
}
} }
else else
{ {
......
...@@ -313,21 +313,7 @@ g_oColorManager = new ColorManager(); ...@@ -313,21 +313,7 @@ g_oColorManager = new ColorManager();
function Font(val) function Font(val)
{ {
if(null == val) if(null == val)
{ val = g_oDefaultFontAbs;
val = {
fn : "Calibri",
scheme : null,
fs : 11,
b : false,
i : false,
u : "none",
s : false,
c : g_oColorManager.getThemeColor(g_nColorTextDefault),
va : "baseline",
skip : false,
repeat : false
};
}
this.Properties = { this.Properties = {
fn: 0, fn: 0,
scheme: 1, scheme: 1,
...@@ -364,22 +350,21 @@ Font.prototype = ...@@ -364,22 +350,21 @@ Font.prototype =
merge : function(font) merge : function(font)
{ {
var oRes = new Font(); var oRes = new Font();
oRes.fn = this._mergeProperty(this.fn, font.fn, g_oDefaultFont.fn); oRes.fn = this._mergeProperty(this.fn, font.fn, g_oDefaultFontAbs.fn);
oRes.fs = this._mergeProperty(this.fs, font.fs, g_oDefaultFont.fs); oRes.scheme = this._mergeProperty(this.scheme, font.scheme, g_oDefaultFontAbs.scheme);
oRes.b = this._mergeProperty(this.b, font.b, g_oDefaultFont.b); oRes.fs = this._mergeProperty(this.fs, font.fs, g_oDefaultFontAbs.fs);
oRes.i = this._mergeProperty(this.i, font.i, g_oDefaultFont.i); oRes.b = this._mergeProperty(this.b, font.b, g_oDefaultFontAbs.b);
oRes.u = this._mergeProperty(this.u, font.u, g_oDefaultFont.u); oRes.i = this._mergeProperty(this.i, font.i, g_oDefaultFontAbs.i);
oRes.s = this._mergeProperty(this.s, font.s, g_oDefaultFont.s); oRes.u = this._mergeProperty(this.u, font.u, g_oDefaultFontAbs.u);
oRes.s = this._mergeProperty(this.s, font.s, g_oDefaultFontAbs.s);
//заглушка excel при merge стилей игнорирует default цвет //заглушка excel при merge стилей игнорирует default цвет
if(this.c instanceof ThemeColor && g_nColorTextDefault == this.c.theme && null == this.c.tint) if(this.c instanceof ThemeColor && g_nColorTextDefault == this.c.theme && null == this.c.tint)
oRes.c = this._mergeProperty(font.c, this.c, g_oDefaultFont.c); oRes.c = this._mergeProperty(font.c, this.c, g_oDefaultFontAbs.c);
else else
oRes.c = this._mergeProperty(this.c, font.c, g_oDefaultFont.c); oRes.c = this._mergeProperty(this.c, font.c, g_oDefaultFontAbs.c);
oRes.themeColor = this._mergeProperty(this.themeColor, font.themeColor, g_oDefaultFont.themeColor); oRes.va = this._mergeProperty(this.va, font.va, g_oDefaultFontAbs.va);
oRes.themeTint = this._mergeProperty(this.themeTint, font.themeTint, g_oDefaultFont.themeTint); oRes.skip = this._mergeProperty(this.skip, font.skip, g_oDefaultFontAbs.skip);
oRes.va = this._mergeProperty(this.va, font.va, g_oDefaultFont.va); oRes.repeat = this._mergeProperty(this.repeat, font.repeat, g_oDefaultFontAbs.repeat);
oRes.skip = this._mergeProperty(this.skip, font.skip, g_oDefaultFont.skip);
oRes.repeat = this._mergeProperty(this.repeat, font.repeat, g_oDefaultFont.repeat);
return oRes; return oRes;
}, },
getRgbOrNull : function() getRgbOrNull : function()
...@@ -488,27 +473,27 @@ Font.prototype = ...@@ -488,27 +473,27 @@ Font.prototype =
intersect : function(oFont, oDefVal) intersect : function(oFont, oDefVal)
{ {
if(this.fn != oFont.fn) if(this.fn != oFont.fn)
this.fn = g_oDefaultFont.fn; this.fn = oDefVal.fn;
if(this.scheme != oFont.scheme) if(this.scheme != oFont.scheme)
this.scheme = g_oDefaultFont.scheme; this.scheme = oDefVal.scheme;
if(this.fs != oFont.fs) if(this.fs != oFont.fs)
this.fs = g_oDefaultFont.fs; this.fs = oDefVal.fs;
if(this.b != oFont.b) if(this.b != oFont.b)
this.b = g_oDefaultFont.b; this.b = oDefVal.b;
if(this.i != oFont.i) if(this.i != oFont.i)
this.i = g_oDefaultFont.i; this.i = oDefVal.i;
if(this.u != oFont.u) if(this.u != oFont.u)
this.u = g_oDefaultFont.u; this.u = oDefVal.u;
if(this.s != oFont.s) if(this.s != oFont.s)
this.s = g_oDefaultFont.s; this.s = oDefVal.s;
if(false == g_oColorManager.isEqual(this.c, oFont.c)) if(false == g_oColorManager.isEqual(this.c, oFont.c))
this.c = g_oDefaultFont.c; this.c = oDefVal.c;
if(this.va != oFont.va) if(this.va != oFont.va)
this.va = g_oDefaultFont.va; this.va = oDefVal.va;
if(this.skip != oFont.skip) if(this.skip != oFont.skip)
this.skip = g_oDefaultFont.skip; this.skip = oDefVal.skip;
if(this.repeat != oFont.repeat) if(this.repeat != oFont.repeat)
this.repeat = g_oDefaultFont.repeat; this.repeat = oDefVal.repeat;
}, },
getType : function() getType : function()
{ {
...@@ -553,11 +538,7 @@ Font.prototype = ...@@ -553,11 +538,7 @@ Font.prototype =
function Fill(val) function Fill(val)
{ {
if(null == val) if(null == val)
{ val = g_oDefaultFillAbs;
val = {
bg : null
};
}
this.Properties = { this.Properties = {
bg: 0 bg: 0
}; };
...@@ -576,8 +557,6 @@ Fill.prototype = ...@@ -576,8 +557,6 @@ Fill.prototype =
{ {
var oRes = new Fill(); var oRes = new Fill();
oRes.bg = this._mergeProperty(this.bg, fill.bg, g_oDefaultFill.bg); oRes.bg = this._mergeProperty(this.bg, fill.bg, g_oDefaultFill.bg);
oRes.themeColor = this._mergeProperty(this.themeColor, fill.themeColor, g_oDefaultFill.themeColor);
oRes.themeTint = this._mergeProperty(this.themeTint, fill.themeTint, g_oDefaultFill.themeTint);
return oRes; return oRes;
}, },
getRgbOrNull : function() getRgbOrNull : function()
...@@ -699,19 +678,7 @@ BorderProp.prototype = { ...@@ -699,19 +678,7 @@ BorderProp.prototype = {
function Border(val) function Border(val)
{ {
if(null == val) if(null == val)
{ val = g_oDefaultBorderAbs;
val = {
l : new BorderProp(),
t : new BorderProp(),
r : new BorderProp(),
b : new BorderProp(),
d : new BorderProp(),
ih : new BorderProp(),
iv : new BorderProp(),
dd : false,
du : false
};
}
this.Properties = { this.Properties = {
l: 0, l: 0,
t: 1, t: 1,
...@@ -891,11 +858,7 @@ Border.prototype = ...@@ -891,11 +858,7 @@ Border.prototype =
function Num(val) function Num(val)
{ {
if(null == val) if(null == val)
{ val = g_oDefaultNumAbs;
val = {
f : "General"
};
}
this.Properties = { this.Properties = {
f: 0 f: 0
}; };
...@@ -1082,17 +1045,7 @@ CellXfs.prototype = ...@@ -1082,17 +1045,7 @@ CellXfs.prototype =
function Align(val) function Align(val)
{ {
if(null == val) if(null == val)
{ val = g_oDefaultAlignAbs;
val = {
hor : "none",
indent : 0,
RelativeIndent : 0,
shrink : false,
angle : 0,
ver : "bottom",
wrap : false
};
}
this.Properties = { this.Properties = {
hor: 0, hor: 0,
indent: 1, indent: 1,
...@@ -3181,7 +3134,7 @@ CCellValue.prototype = ...@@ -3181,7 +3134,7 @@ CCellValue.prototype =
var aVal = this.multiText; var aVal = this.multiText;
var oIntersectFont = aVal[0].format.clone(); var oIntersectFont = aVal[0].format.clone();
for(var i = 1, length = aVal.length; i < length; i++) for(var i = 1, length = aVal.length; i < length; i++)
oIntersectFont.intersect(aVal[i].format); oIntersectFont.intersect(aVal[i].format, g_oDefaultFont);
if(bSetCellFont) if(bSetCellFont)
{ {
if(oIntersectFont.isEqual(g_oDefaultFont)) if(oIntersectFont.isEqual(g_oDefaultFont))
......
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