Commit 9458e3e7 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

сравнение градиентных заливок

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52143 954022d7-b5bf-4e40-9824-e11837661b57
parent b34ce289
......@@ -1975,6 +1975,7 @@ function CGs()
CGs.prototype =
{
Get_Id: function()
{
return this.Id;
......@@ -2063,6 +2064,19 @@ CGs.prototype =
duplicate.pos = this.pos;
duplicate.color = this.color.createDuplicate();
return duplicate;
},
compare: function(gs)
{
var compare_unicolor = this.color.compare(gs.color);
if(!isRealObject(compare_unicolor))
{
return null;
}
var ret = new CGs();
ret.color = compare_unicolor;
ret.pos = gs.pos === this.pos ? this.pos : 0;
return ret;
}
}
......@@ -2499,6 +2513,35 @@ CGradFill.prototype =
return null;
}
var _ret = new CGradFill();
if(this.lin == null || fill.lin == null)
_ret.lin = null;
else
{
_ret.lin = new GradLin();
_ret.lin.angle = this.lin && this.lin.angle === fill.lin.angle ? fill.lin.angle : 5400000;
_ret.lin.scale = this.lin && this.lin.scale === fill.lin.scale ? fill.lin.scale : true;
}
if(this.path == null || fill.path == null)
{
_ret.path = null;
}
else
{
_ret.path = new GradPath();
}
if(this.colors.length === fill.colors.length )
{
for(var i = 0; i < this.colors.length; ++i )
{
var compare_unicolor = this.colors[i].compare(fill.colors[i]);
if(!isRealObject(compare_unicolor))
{
break;
}
_ret.colors[i] = compare_unicolor;
}
}
return _ret;
}
};
......
......@@ -1533,8 +1533,8 @@ CGradFill.prototype =
else
{
_ret.lin = new GradLin();
_ret.lin.angle = this.angle === fill.lin.angle ? fill.lin.angle : 5400000;
_ret.lin.scale = this.scale === fill.lin.scale ? fill.lin.scale : true;
_ret.lin.angle = this.lin && this.lin.angle === fill.lin.angle ? fill.lin.angle : 5400000;
_ret.lin.scale = this.lin && this.lin.scale === fill.lin.scale ? fill.lin.scale : true;
}
if(this.path == null || fill.path == null)
{
......
......@@ -1382,6 +1382,19 @@ CGs.prototype =
duplicate.pos = this.pos;
duplicate.color = this.color.createDuplicate();
return duplicate;
},
compare: function(gs)
{
var compare_unicolor = this.color.compare(gs.color);
if(!isRealObject(compare_unicolor))
{
return null;
}
var ret = new CGs();
ret.color = compare_unicolor;
ret.pos = gs.pos === this.pos ? this.pos : 0;
return ret;
}
};
......@@ -1584,19 +1597,37 @@ CGradFill.prototype =
{
return null;
}
/* if(this.lin != fill.lin)
return _ret;
_ret.lin = this.lin;
if(this.path != fill.path)
return _ret;
_ret.path = this.path;
if(this.colors.length != fill.colors.length)
return _ret; */
if(!this.IsIdentical(fill))
return _ret = new CGradFill()
var _ret = new CGradFill();
if(this.lin == null || fill.lin == null)
_ret.lin = null;
else
{
_ret.lin = new GradLin();
_ret.lin.angle = this.lin && this.lin.angle === fill.lin.angle ? fill.lin.angle : 5400000;
_ret.lin.scale = this.lin && this.lin.scale === fill.lin.scale ? fill.lin.scale : true;
}
if(this.path == null || fill.path == null)
{
_ret.path = null;
}
else
{
_ret.path = new GradPath();
}
return this.createDuplicate();
if(this.colors.length === fill.colors.length )
{
for(var i = 0; i < this.colors.length; ++i )
{
var compare_unicolor = this.colors[i].compare(fill.colors[i]);
if(!isRealObject(compare_unicolor))
{
break;
}
_ret.colors[i] = compare_unicolor;
}
}
return _ret;
}
};
......
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