Commit 53c6ba53 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Убрал _cloneFormat (в Font есть свой clone)

Убрал _isEqualFormats (в Font есть своя функция isEqual)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52004 954022d7-b5bf-4e40-9824-e11837661b57
parent 4e2b9b92
...@@ -230,7 +230,6 @@ ...@@ -230,7 +230,6 @@
this.input.off("." + namespace); this.input.off("." + namespace);
}, },
/** /**
* @param {Object} options * @param {Object} options
* cellX - cell x coord (pt) * cellX - cell x coord (pt)
...@@ -341,7 +340,7 @@ ...@@ -341,7 +340,7 @@
first = t._findFragmentToInsertInto(t.cursorPos); first = t._findFragmentToInsertInto(t.cursorPos);
if (first) { if (first) {
if (!t.newTextFormat) { if (!t.newTextFormat) {
t.newTextFormat = t._cloneFormat(opt.fragments[first.index].format); t.newTextFormat = opt.fragments[first.index].format.clone();
} }
t._setFormatProperty(t.newTextFormat, prop, val); t._setFormatProperty(t.newTextFormat, prop, val);
} }
...@@ -606,7 +605,6 @@ ...@@ -606,7 +605,6 @@
this._draw(); this._draw();
}, },
// Private // Private
_setOptions: function (options) { _setOptions: function (options) {
...@@ -803,7 +801,6 @@ ...@@ -803,7 +801,6 @@
} }
}, },
// Rendering // Rendering
_draw: function () { _draw: function () {
...@@ -1034,7 +1031,6 @@ ...@@ -1034,7 +1031,6 @@
} }
}, },
// Cursor // Cursor
showCursor: function () { showCursor: function () {
...@@ -1192,7 +1188,6 @@ ...@@ -1192,7 +1188,6 @@
t._addChars(s2.slice(i1, i2), i1); t._addChars(s2.slice(i1, i2), i1);
}, },
// Content // Content
_getContentLeft: function () { _getContentLeft: function () {
...@@ -1338,7 +1333,6 @@ ...@@ -1338,7 +1333,6 @@
} }
}, },
_selectChars: function (kind, pos) { _selectChars: function (kind, pos) {
var t = this; var t = this;
var begPos, endPos; var begPos, endPos;
...@@ -1370,7 +1364,6 @@ ...@@ -1370,7 +1364,6 @@
t.selectionTimer = window.setTimeout(function () {doChangeSelection(coord);}, 0); t.selectionTimer = window.setTimeout(function () {doChangeSelection(coord);}, 0);
}, },
_findFragment: function (pos) { _findFragment: function (pos) {
var opt = this.options, i, begin, end; var opt = this.options, i, begin, end;
...@@ -1414,8 +1407,8 @@ ...@@ -1414,8 +1407,8 @@
Array.prototype.splice.apply( Array.prototype.splice.apply(
opt.fragments, opt.fragments,
[f.index, 1].concat([ [f.index, 1].concat([
{format: t._cloneFormat(fr.format), text: fr.text.slice(0, pos - f.begin)}, {format: fr.format.clone(), text: fr.text.slice(0, pos - f.begin)},
{format: t._cloneFormat(fr.format), text: fr.text.slice(pos - f.begin)}])); {format: fr.format.clone(), text: fr.text.slice(pos - f.begin)}]));
} }
}, },
...@@ -1491,7 +1484,7 @@ ...@@ -1491,7 +1484,7 @@
{ {
var fr = opt.fragments[i]; var fr = opt.fragments[i];
var nextFr = opt.fragments[i + 1]; var nextFr = opt.fragments[i + 1];
if(t._isEqualFormats(fr.format, nextFr.format)) { if(fr.format.isEqual(nextFr.format)) {
opt.fragments.splice(i, 2, {format: fr.format, text: fr.text + nextFr.text}); opt.fragments.splice(i, 2, {format: fr.format, text: fr.text + nextFr.text});
continue; continue;
} }
...@@ -1522,13 +1515,6 @@ ...@@ -1522,13 +1515,6 @@
return f.length > 0 ? f.reduce(function(pv, cv){return pv + cv.text;}, "") : ""; return f.length > 0 ? f.reduce(function(pv, cv){return pv + cv.text;}, "") : "";
}, },
_isEqualFormats: function (f1, f2) {
return f1.fn === f2.fn && f1.fs === f2.fs &&
f1.b === f2.b && f1.i === f2.i && f1.u === f2.u && f1.s === f2.s &&
f1.c === f2.c && f1.va === f2.va;
},
_setFormatProperty: function (format, prop, val) { _setFormatProperty: function (format, prop, val) {
switch (prop) { switch (prop) {
case "fn": format.fn = val; break; case "fn": format.fn = val; break;
...@@ -1562,11 +1548,6 @@ ...@@ -1562,11 +1548,6 @@
return val; return val;
}, },
_cloneFormat: function (format) {
return asc_clone(format);
},
_performAction: function (list1, list2) { _performAction: function (list1, list2) {
var t = this, action, str, pos, len; var t = this, action, str, pos, len;
......
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