Commit 493be4a0 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

color mods bug

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56486 954022d7-b5bf-4e40-9824-e11837661b57
parent 680eaab6
...@@ -4536,7 +4536,7 @@ function CorrectUniColorEx(asc_color, unicolor) { ...@@ -4536,7 +4536,7 @@ function CorrectUniColorEx(asc_color, unicolor) {
if (null != __mods) if (null != __mods)
{ {
for (var modInd = 0; modInd < __mods.length; modInd++) for (var modInd = 0; modInd < __mods.length; modInd++)
ret.addMod(__mods[modInd]); ret.addMod(_create_mod(__mods[modInd]));
} }
break; break;
......
...@@ -468,6 +468,22 @@ function CColorMod() ...@@ -468,6 +468,22 @@ function CColorMod()
//g_oTableId.Add(this, this.Id); //g_oTableId.Add(this, this.Id);
} }
function _create_mod(default_obj)
{
var ret = new CColorMod();
ret.name = default_obj["name"];
ret.val = default_obj["val"];
return ret;
}
function _create_mods(arr_defaults)
{
var ret = [];
for (var i = 0; i < arr_defaults.length; i++)
ret.push(_create_mod(arr_defaults[i]));
return ret;
}
CColorMod.prototype = CColorMod.prototype =
{ {
getObjectType: function() getObjectType: function()
......
...@@ -336,16 +336,16 @@ function GetDefaultMods(r, g, b, pos, editor_id) ...@@ -336,16 +336,16 @@ function GetDefaultMods(r, g, b, pos, editor_id)
if (_obj.lumMod != -1) if (_obj.lumMod != -1)
{ {
_mod = new CColorMod(); _mod = new Object();
_mod.name = "lumMod"; _mod["name"] = "lumMod";
_mod.val = _obj.lumMod; _mod["val"] = _obj.lumMod;
_mods.push(_mod); _mods.push(_mod);
} }
if (_obj.lumOff != -1) if (_obj.lumOff != -1)
{ {
_mod = new CColorMod(); _mod = new Object();
_mod.name = "lumOff"; _mod["name"] = "lumOff";
_mod.val = _obj.lumOff; _mod["val"] = _obj.lumOff;
_mods.push(_mod); _mods.push(_mod);
} }
...@@ -356,9 +356,9 @@ function GetDefaultMods(r, g, b, pos, editor_id) ...@@ -356,9 +356,9 @@ function GetDefaultMods(r, g, b, pos, editor_id)
var _obj = g_oThemeColorsDefaultModsWord[index][pos - 1]; var _obj = g_oThemeColorsDefaultModsWord[index][pos - 1];
var _mods = []; var _mods = [];
var _mod = new CColorMod(); var _mod = new Object();
_mod.name = _obj.name; _mod["name"] = _obj.name;
_mod.val = (_obj.val * 100000 / 255) >> 0; _mod["val"] = (_obj.val * 100000 / 255) >> 0;
_mods.push(_mod); _mods.push(_mod);
return _mods; return _mods;
......
...@@ -4215,7 +4215,7 @@ function CDrawingDocument(drawingObjects) ...@@ -4215,7 +4215,7 @@ function CDrawingDocument(drawingObjects)
for (var j = 0; j < _count_mods; ++j) for (var j = 0; j < _count_mods; ++j)
{ {
var dst_mods = new CColorModifiers(); var dst_mods = new CColorModifiers();
dst_mods.Mods = GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0); dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0));
var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255}; var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba); dst_mods.Apply(_rgba);
......
...@@ -2610,7 +2610,7 @@ function CDrawingDocument() ...@@ -2610,7 +2610,7 @@ function CDrawingDocument()
for (var j = 0; j < _count_mods; ++j) for (var j = 0; j < _count_mods; ++j)
{ {
var dst_mods = new CColorModifiers(); var dst_mods = new CColorModifiers();
dst_mods.Mods = GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0); dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0));
var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255}; var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba); dst_mods.Apply(_rgba);
......
...@@ -378,7 +378,7 @@ function CorrectUniColor(asc_color, unicolor) ...@@ -378,7 +378,7 @@ function CorrectUniColor(asc_color, unicolor)
if (null != __mods) if (null != __mods)
{ {
for (var modInd = 0; modInd < __mods.length; modInd++) for (var modInd = 0; modInd < __mods.length; modInd++)
ret.Mods.Mods[modInd] = __mods[modInd]; ret.Mods.Mods[modInd] = _create_mod(__mods[modInd]);
} }
break; break;
......
...@@ -4575,7 +4575,7 @@ function CDrawingDocument() ...@@ -4575,7 +4575,7 @@ function CDrawingDocument()
for (var j = 0; j < _count_mods; ++j) for (var j = 0; j < _count_mods; ++j)
{ {
var dst_mods = new CColorModifiers(); var dst_mods = new CColorModifiers();
dst_mods.Mods = GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0); dst_mods.Mods = _create_mods(GetDefaultMods(_color_src.r, _color_src.g, _color_src.b, j + 1, 0));
var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255}; var _rgba = {R:_color_src.r, G: _color_src.g, B:_color_src.b, A: 255};
dst_mods.Apply(_rgba); dst_mods.Apply(_rgba);
......
...@@ -206,7 +206,7 @@ function CorrectUniColor(asc_color, unicolor) ...@@ -206,7 +206,7 @@ function CorrectUniColor(asc_color, unicolor)
if (null != __mods) if (null != __mods)
{ {
for (var modInd = 0; modInd < __mods.length; modInd++) for (var modInd = 0; modInd < __mods.length; modInd++)
ret.Mods.Mods[modInd] = __mods[modInd]; ret.Mods.Mods[modInd] = _create_mod(__mods[modInd]);
} }
break; break;
......
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