Commit eac45c1e authored by GoshaZotov's avatar GoshaZotov

== -> === + refactoring

parent a4ec0210
...@@ -173,7 +173,7 @@ CopyElement.prototype.wrapChild = function(child){ ...@@ -173,7 +173,7 @@ CopyElement.prototype.wrapChild = function(child){
this.aChildren = [child]; this.aChildren = [child];
}; };
CopyElement.prototype.isEmptyChild = function(){ CopyElement.prototype.isEmptyChild = function(){
return 0 == this.aChildren.length; return 0 === this.aChildren.length;
}; };
CopyElement.prototype.getInnerText = function(){ CopyElement.prototype.getInnerText = function(){
if(this.bText) if(this.bText)
...@@ -244,13 +244,13 @@ CopyProcessor.prototype = ...@@ -244,13 +244,13 @@ CopyProcessor.prototype =
} }
var sResult = "#"; var sResult = "#";
var sR = rgb.r.toString(16); var sR = rgb.r.toString(16);
if(sR.length == 1) if(sR.length === 1)
sR = "0" + sR; sR = "0" + sR;
var sG = rgb.g.toString(16); var sG = rgb.g.toString(16);
if(sG.length == 1) if(sG.length === 1)
sG = "0" + sG; sG = "0" + sG;
var sB = rgb.b.toString(16); var sB = rgb.b.toString(16);
if(sB.length == 1) if(sB.length === 1)
sB = "0" + sB; sB = "0" + sB;
return "#" + sR + sG + sB; return "#" + sR + sG + sB;
}, },
...@@ -263,14 +263,14 @@ CopyProcessor.prototype = ...@@ -263,14 +263,14 @@ CopyProcessor.prototype =
if(Item_pPr && Def_pPr) if(Item_pPr && Def_pPr)
{ {
//Ind //Ind
if(Def_pPr.Ind.Left != Item_pPr.Ind.Left) if(Def_pPr.Ind.Left !== Item_pPr.Ind.Left)
apPr.push("margin-left:" + (Item_pPr.Ind.Left * g_dKoef_mm_to_pt) + "pt"); apPr.push("margin-left:" + (Item_pPr.Ind.Left * g_dKoef_mm_to_pt) + "pt");
if(Def_pPr.Ind.Right != Item_pPr.Ind.Right) if(Def_pPr.Ind.Right !== Item_pPr.Ind.Right)
apPr.push("margin-right:" + ( Item_pPr.Ind.Right * g_dKoef_mm_to_pt) + "pt"); apPr.push("margin-right:" + ( Item_pPr.Ind.Right * g_dKoef_mm_to_pt) + "pt");
if(Def_pPr.Ind.FirstLine != Item_pPr.Ind.FirstLine) if(Def_pPr.Ind.FirstLine !== Item_pPr.Ind.FirstLine)
apPr.push("text-indent:" + (Item_pPr.Ind.FirstLine * g_dKoef_mm_to_pt) + "pt"); apPr.push("text-indent:" + (Item_pPr.Ind.FirstLine * g_dKoef_mm_to_pt) + "pt");
//Jc //Jc
if(Def_pPr.Jc != Item_pPr.Jc){ if(Def_pPr.Jc !== Item_pPr.Jc){
switch(Item_pPr.Jc) switch(Item_pPr.Jc)
{ {
case align_Left: apPr.push("text-align:left");break; case align_Left: apPr.push("text-align:left");break;
...@@ -280,37 +280,37 @@ CopyProcessor.prototype = ...@@ -280,37 +280,37 @@ CopyProcessor.prototype =
} }
} }
//KeepLines , WidowControl //KeepLines , WidowControl
if(Def_pPr.KeepLines != Item_pPr.KeepLines || Def_pPr.WidowControl != Item_pPr.WidowControl) if(Def_pPr.KeepLines !== Item_pPr.KeepLines || Def_pPr.WidowControl !== Item_pPr.WidowControl)
{ {
if(Def_pPr.KeepLines != Item_pPr.KeepLines && Def_pPr.WidowControl != Item_pPr.WidowControl) if(Def_pPr.KeepLines !== Item_pPr.KeepLines && Def_pPr.WidowControl !== Item_pPr.WidowControl)
apPr.push("mso-pagination:none lines-together"); apPr.push("mso-pagination:none lines-together");
else if(Def_pPr.KeepLines != Item_pPr.KeepLines) else if(Def_pPr.KeepLines !== Item_pPr.KeepLines)
apPr.push("mso-pagination:widow-orphan lines-together"); apPr.push("mso-pagination:widow-orphan lines-together");
else if(Def_pPr.WidowControl != Item_pPr.WidowControl) else if(Def_pPr.WidowControl !== Item_pPr.WidowControl)
apPr.push("mso-pagination:none"); apPr.push("mso-pagination:none");
} }
//KeepNext //KeepNext
if(Def_pPr.KeepNext != Item_pPr.KeepNext) if(Def_pPr.KeepNext !== Item_pPr.KeepNext)
apPr.push("page-break-after:avoid"); apPr.push("page-break-after:avoid");
//PageBreakBefore //PageBreakBefore
if(Def_pPr.PageBreakBefore != Item_pPr.PageBreakBefore) if(Def_pPr.PageBreakBefore !== Item_pPr.PageBreakBefore)
apPr.push("page-break-before:always"); apPr.push("page-break-before:always");
//Spacing //Spacing
if(Def_pPr.Spacing.Line != Item_pPr.Spacing.Line) if(Def_pPr.Spacing.Line !== Item_pPr.Spacing.Line)
{ {
if(Asc.linerule_AtLeast == Item_pPr.Spacing.LineRule) if(Asc.linerule_AtLeast === Item_pPr.Spacing.LineRule)
apPr.push("line-height:"+(Item_pPr.Spacing.Line * g_dKoef_mm_to_pt)+"pt"); apPr.push("line-height:"+(Item_pPr.Spacing.Line * g_dKoef_mm_to_pt)+"pt");
else if( Asc.linerule_Auto == Item_pPr.Spacing.LineRule) else if( Asc.linerule_Auto === Item_pPr.Spacing.LineRule)
{ {
if(1 == Item_pPr.Spacing.Line) if(1 === Item_pPr.Spacing.Line)
apPr.push("line-height:normal"); apPr.push("line-height:normal");
else else
apPr.push("line-height:"+parseInt(Item_pPr.Spacing.Line * 100)+"%"); apPr.push("line-height:"+parseInt(Item_pPr.Spacing.Line * 100)+"%");
} }
} }
if(Def_pPr.Spacing.LineRule != Item_pPr.Spacing.LineRule) if(Def_pPr.Spacing.LineRule !== Item_pPr.Spacing.LineRule)
{ {
if(Asc.linerule_Exact == Item_pPr.Spacing.LineRule) if(Asc.linerule_Exact === Item_pPr.Spacing.LineRule)
apPr.push("mso-line-height-rule:exactly"); apPr.push("mso-line-height-rule:exactly");
} }
//TODO при вставке в EXCEL(внутрь ячейки) появляются лишние пустые строки из-за того, что в HTML пишутся отступы - BUG #14663 //TODO при вставке в EXCEL(внутрь ячейки) появляются лишние пустые строки из-за того, что в HTML пишутся отступы - BUG #14663
...@@ -320,7 +320,7 @@ CopyProcessor.prototype = ...@@ -320,7 +320,7 @@ CopyProcessor.prototype =
//if(Def_pPr.Spacing.After != Item_pPr.Spacing.After) //if(Def_pPr.Spacing.After != Item_pPr.Spacing.After)
apPr.push("margin-bottom:" + (Item_pPr.Spacing.After * g_dKoef_mm_to_pt) + "pt"); apPr.push("margin-bottom:" + (Item_pPr.Spacing.After * g_dKoef_mm_to_pt) + "pt");
//Shd //Shd
if (null != Item_pPr.Shd && c_oAscShdNil != Item_pPr.Shd.Value && (null != Item_pPr.Shd.Color || null != Item_pPr.Shd.Unifill)) if (null != Item_pPr.Shd && c_oAscShdNil !== Item_pPr.Shd.Value && (null != Item_pPr.Shd.Color || null != Item_pPr.Shd.Unifill))
apPr.push("background-color:" + this.RGBToCSS(Item_pPr.Shd.Color, Item_pPr.Shd.Unifill)); apPr.push("background-color:" + this.RGBToCSS(Item_pPr.Shd.Color, Item_pPr.Shd.Unifill));
//Tabs //Tabs
if(Item_pPr.Tabs.Get_Count() > 0) if(Item_pPr.Tabs.Get_Count() > 0)
...@@ -329,7 +329,7 @@ CopyProcessor.prototype = ...@@ -329,7 +329,7 @@ CopyProcessor.prototype =
//tab-stops:1.0cm 3.0cm 5.0cm //tab-stops:1.0cm 3.0cm 5.0cm
for(var i = 0, length = Item_pPr.Tabs.Get_Count(); i < length; i++) for(var i = 0, length = Item_pPr.Tabs.Get_Count(); i < length; i++)
{ {
if(0 != i) if(0 !== i)
sTabs += " "; sTabs += " ";
sTabs += Item_pPr.Tabs.Get(i).Pos / 10 + "cm"; sTabs += Item_pPr.Tabs.Get(i).Pos / 10 + "cm";
} }
...@@ -384,9 +384,9 @@ CopyProcessor.prototype = ...@@ -384,9 +384,9 @@ CopyProcessor.prototype =
oTarget.wrapChild(new CopyElement("s")); oTarget.wrapChild(new CopyElement("s"));
if (true == Value.DStrikeout) if (true == Value.DStrikeout)
oTarget.wrapChild(new CopyElement("s")); oTarget.wrapChild(new CopyElement("s"));
if (null != Value.Shd && c_oAscShdNil != Value.Shd.Value && (null != Value.Shd.Color || null != Value.Shd.Unifill)) if (null != Value.Shd && c_oAscShdNil !== Value.Shd.Value && (null != Value.Shd.Color || null != Value.Shd.Unifill))
aProp.push("background-color:" + this.RGBToCSS(Value.Shd.Color, Value.Shd.Unifill)); aProp.push("background-color:" + this.RGBToCSS(Value.Shd.Color, Value.Shd.Unifill));
else if (null != Value.HighLight && highlight_None != Value.HighLight) else if (null != Value.HighLight && highlight_None !== Value.HighLight)
aProp.push("background-color:" + this.RGBToCSS(Value.HighLight, null)); aProp.push("background-color:" + this.RGBToCSS(Value.HighLight, null));
if (null != Value.Color || null != Value.Unifill) { if (null != Value.Color || null != Value.Unifill) {
var color; var color;
...@@ -400,9 +400,9 @@ CopyProcessor.prototype = ...@@ -400,9 +400,9 @@ CopyProcessor.prototype =
aProp.push("mso-style-textfill-fill-color:" + color); aProp.push("mso-style-textfill-fill-color:" + color);
} }
if (null != Value.VertAlign) { if (null != Value.VertAlign) {
if(AscCommon.vertalign_SuperScript == Value.VertAlign) if(AscCommon.vertalign_SuperScript === Value.VertAlign)
aProp.push("vertical-align:super"); aProp.push("vertical-align:super");
else if(AscCommon.vertalign_SubScript == Value.VertAlign) else if(AscCommon.vertalign_SubScript === Value.VertAlign)
aProp.push("vertical-align:sub"); aProp.push("vertical-align:sub");
} }
if(aProp.length > 0) if(aProp.length > 0)
...@@ -435,7 +435,7 @@ CopyProcessor.prototype = ...@@ -435,7 +435,7 @@ CopyProcessor.prototype =
break; break;
case para_NewLine: case para_NewLine:
var oBr = new CopyElement("br"); var oBr = new CopyElement("br");
if( break_Page == ParaItem.BreakType) if( break_Page === ParaItem.BreakType)
{ {
oBr.oAttributes["clear"] = "all"; oBr.oAttributes["clear"] = "all";
oBr.oAttributes["style"] = "mso-special-character:line-break;page-break-before:always;"; oBr.oAttributes["style"] = "mso-special-character:line-break;page-break-before:always;";
...@@ -489,7 +489,7 @@ CopyProcessor.prototype = ...@@ -489,7 +489,7 @@ CopyProcessor.prototype =
// delete _canvas; // delete _canvas;
break; break;
case para_PageNum: case para_PageNum:
if(null != ParaItem.String && "string" == typeof(ParaItem.String)) if(null != ParaItem.String && "string" === typeof(ParaItem.String))
oTarget.addChild(new CopyElement(CopyPasteCorrectString(ParaItem.String), true)); oTarget.addChild(new CopyElement(CopyPasteCorrectString(ParaItem.String), true));
break; break;
} }
...@@ -501,7 +501,7 @@ CopyProcessor.prototype = ...@@ -501,7 +501,7 @@ CopyProcessor.prototype =
CopyRunContent: function (Container, oTarget, bOmitHyperlink) { CopyRunContent: function (Container, oTarget, bOmitHyperlink) {
for (var i = 0; i < Container.Content.length; i++) { for (var i = 0; i < Container.Content.length; i++) {
var item = Container.Content[i]; var item = Container.Content[i];
if (para_Run == item.Type) { if (para_Run === item.Type) {
var oSpan = new CopyElement("span"); var oSpan = new CopyElement("span");
this.CopyRun(item, oSpan); this.CopyRun(item, oSpan);
if(!oSpan.isEmptyChild()){ if(!oSpan.isEmptyChild()){
...@@ -509,7 +509,7 @@ CopyProcessor.prototype = ...@@ -509,7 +509,7 @@ CopyProcessor.prototype =
oTarget.addChild(oSpan); oTarget.addChild(oSpan);
} }
} }
else if (para_Hyperlink == item.Type) { else if (para_Hyperlink === item.Type) {
if (!bOmitHyperlink) { if (!bOmitHyperlink) {
var oHyperlink = new CopyElement("a"); var oHyperlink = new CopyElement("a");
var sValue = item.Get_Value(); var sValue = item.Get_Value();
...@@ -523,7 +523,7 @@ CopyProcessor.prototype = ...@@ -523,7 +523,7 @@ CopyProcessor.prototype =
else else
this.CopyRunContent(item, oTarget, true); this.CopyRunContent(item, oTarget, true);
} }
else if(para_Math == item.Type){ else if(para_Math === item.Type){
var sSrc = item.MathToImageConverter(); var sSrc = item.MathToImageConverter();
if (null != sSrc && null != sSrc.ImageUrl){ if (null != sSrc && null != sSrc.ImageUrl){
var oImg = new CopyElement("img"); var oImg = new CopyElement("img");
...@@ -537,7 +537,7 @@ CopyProcessor.prototype = ...@@ -537,7 +537,7 @@ CopyProcessor.prototype =
oTarget.addChild(oImg); oTarget.addChild(oImg);
} }
} }
else if(para_Field == item.Type) else if(para_Field === item.Type)
this.CopyRunContent(item, oTarget); this.CopyRunContent(item, oTarget);
} }
}, },
...@@ -551,7 +551,7 @@ CopyProcessor.prototype = ...@@ -551,7 +551,7 @@ CopyProcessor.prototype =
{ {
var styleName = oDocument.Styles.Get_Name( styleId ).toLowerCase(); var styleName = oDocument.Styles.Get_Name( styleId ).toLowerCase();
//������ "heading n" (n=1:6) //������ "heading n" (n=1:6)
if(0 == styleName.indexOf("heading")) if(0 === styleName.indexOf("heading"))
{ {
var nLevel = parseInt(styleName.substring("heading".length)); var nLevel = parseInt(styleName.substring("heading".length));
if(1 <= nLevel && nLevel <= 6) if(1 <= nLevel && nLevel <= 6)
...@@ -637,7 +637,7 @@ CopyProcessor.prototype = ...@@ -637,7 +637,7 @@ CopyProcessor.prototype =
//pPr //pPr
this.Commit_pPr(Item, Para); this.Commit_pPr(Item, Para);
if(false == selectedAll) if(false === selectedAll)
{ {
//если последний элемент в выделении неполностью выделенный параграф, то он копируется как обычный текст без настроек параграфа и списков //если последний элемент в выделении неполностью выделенный параграф, то он копируется как обычный текст без настроек параграфа и списков
this.CopyRunContent(Item, oDomTarget, false); this.CopyRunContent(Item, oDomTarget, false);
...@@ -658,7 +658,7 @@ CopyProcessor.prototype = ...@@ -658,7 +658,7 @@ CopyProcessor.prototype =
var oTargetList = null; var oTargetList = null;
if(oDomTarget.aChildren.length > 0){ if(oDomTarget.aChildren.length > 0){
var oPrevElem = oDomTarget.aChildren[oDomTarget.aChildren.length - 1]; var oPrevElem = oDomTarget.aChildren[oDomTarget.aChildren.length - 1];
if((bBullet && "ul" == oPrevElem.sName) || (!bBullet && "ol" == oPrevElem.sName)) if((bBullet && "ul" === oPrevElem.sName) || (!bBullet && "ol" === oPrevElem.sName))
oTargetList = oPrevElem; oTargetList = oPrevElem;
} }
if(null == oTargetList){ if(null == oTargetList){
...@@ -676,7 +676,7 @@ CopyProcessor.prototype = ...@@ -676,7 +676,7 @@ CopyProcessor.prototype =
_BorderToStyle : function(border, name) _BorderToStyle : function(border, name)
{ {
var res = ""; var res = "";
if(border_None == border.Value) if(border_None === border.Value)
res += name + ":none;"; res += name + ":none;";
else else
{ {
...@@ -698,13 +698,13 @@ CopyProcessor.prototype = ...@@ -698,13 +698,13 @@ CopyProcessor.prototype =
var nMarginTop = 0; var nMarginTop = 0;
var nMarginRight = 1.9; var nMarginRight = 1.9;
var nMarginBottom = 0; var nMarginBottom = 0;
if(null != margins.Left && tblwidth_Mm == margins.Left.Type && null != margins.Left.W) if(null != margins.Left && tblwidth_Mm === margins.Left.Type && null != margins.Left.W)
nMarginLeft = margins.Left.W; nMarginLeft = margins.Left.W;
if(null != margins.Top && tblwidth_Mm == margins.Top.Type && null != margins.Top.W) if(null != margins.Top && tblwidth_Mm === margins.Top.Type && null != margins.Top.W)
nMarginTop = margins.Top.W; nMarginTop = margins.Top.W;
if(null != margins.Right && tblwidth_Mm == margins.Right.Type && null != margins.Right.W) if(null != margins.Right && tblwidth_Mm === margins.Right.Type && null != margins.Right.W)
nMarginRight = margins.Right.W; nMarginRight = margins.Right.W;
if(null != margins.Bottom && tblwidth_Mm == margins.Bottom.Type && null != margins.Bottom.W) if(null != margins.Bottom && tblwidth_Mm === margins.Bottom.Type && null != margins.Bottom.W)
nMarginBottom = margins.Bottom.W; nMarginBottom = margins.Bottom.W;
res = styleName + ":"+(nMarginTop * g_dKoef_mm_to_pt)+"pt "+(nMarginRight * g_dKoef_mm_to_pt)+"pt "+(nMarginBottom * g_dKoef_mm_to_pt)+"pt "+(nMarginLeft * g_dKoef_mm_to_pt)+"pt;"; res = styleName + ":"+(nMarginTop * g_dKoef_mm_to_pt)+"pt "+(nMarginRight * g_dKoef_mm_to_pt)+"pt "+(nMarginBottom * g_dKoef_mm_to_pt)+"pt "+(nMarginLeft * g_dKoef_mm_to_pt)+"pt;";
return res; return res;
...@@ -748,7 +748,7 @@ CopyProcessor.prototype = ...@@ -748,7 +748,7 @@ CopyProcessor.prototype =
var p, v; var p, v;
for(p in elem2) for(p in elem2)
{ {
if(elem2.hasOwnProperty(p) && false == elem1.hasOwnProperty(p)) if(elem2.hasOwnProperty(p) && !elem1.hasOwnProperty(p))
{ {
v = elem2[p]; v = elem2[p];
if(null != v) if(null != v)
...@@ -788,12 +788,12 @@ CopyProcessor.prototype = ...@@ -788,12 +788,12 @@ CopyProcessor.prototype =
} }
if(null != cellPr && null != cellPr.Shd) if(null != cellPr && null != cellPr.Shd)
{ {
if (c_oAscShdNil != cellPr.Shd.Value && (null != cellPr.Shd.Color || null != cellPr.Shd.Unifill)) if (c_oAscShdNil !== cellPr.Shd.Value && (null != cellPr.Shd.Color || null != cellPr.Shd.Unifill))
tcStyle += "background-color:" + this.RGBToCSS(cellPr.Shd.Color, cellPr.Shd.Unifill) + ";"; tcStyle += "background-color:" + this.RGBToCSS(cellPr.Shd.Color, cellPr.Shd.Unifill) + ";";
} }
else if(null != tablePr && null != tablePr.Shd) else if(null != tablePr && null != tablePr.Shd)
{ {
if (c_oAscShdNil != tablePr.Shd.Value && (null != tablePr.Shd.Color || null != tablePr.Shd.Unifill)) if (c_oAscShdNil !== tablePr.Shd.Value && (null != tablePr.Shd.Color || null != tablePr.Shd.Unifill))
tcStyle += "background-color:" + this.RGBToCSS(tablePr.Shd.Color, tablePr.Shd.Unifill) + ";"; tcStyle += "background-color:" + this.RGBToCSS(tablePr.Shd.Color, tablePr.Shd.Unifill) + ";";
} }
var oCellMar = {}; var oCellMar = {};
...@@ -878,7 +878,7 @@ CopyProcessor.prototype = ...@@ -878,7 +878,7 @@ CopyProcessor.prototype =
for(var i in elems.cells) for(var i in elems.cells)
{ {
var cell = row.Content[i]; var cell = row.Content[i];
if(vmerge_Continue != cell.Get_VMerge()) if(vmerge_Continue !== cell.Get_VMerge())
{ {
var StartGridCol = cell.Metrics.StartGridCol; var StartGridCol = cell.Metrics.StartGridCol;
var GridSpan = cell.Get_GridSpan(); var GridSpan = cell.Get_GridSpan();
...@@ -938,7 +938,7 @@ CopyProcessor.prototype = ...@@ -938,7 +938,7 @@ CopyProcessor.prototype =
if(true != table.Inline && null != table.PositionH) if(true != table.Inline && null != table.PositionH)
{ {
var PositionH = table.PositionH; var PositionH = table.PositionH;
if(true == PositionH.Align) if(true === PositionH.Align)
{ {
switch(PositionH.Value) switch(PositionH.Value)
{ {
...@@ -976,7 +976,7 @@ CopyProcessor.prototype = ...@@ -976,7 +976,7 @@ CopyProcessor.prototype =
DomTable.oAttributes["align"] = align; DomTable.oAttributes["align"] = align;
if(null != Pr.TableInd) if(null != Pr.TableInd)
tblStyle += "margin-left:"+(Pr.TableInd * g_dKoef_mm_to_pt)+"pt;"; tblStyle += "margin-left:"+(Pr.TableInd * g_dKoef_mm_to_pt)+"pt;";
if (null != Pr.Shd && c_oAscShdNil != Pr.Shd.Value && (null != Pr.Shd.Color || null != Pr.Shd.Unifill)) if (null != Pr.Shd && c_oAscShdNil !== Pr.Shd.Value && (null != Pr.Shd.Color || null != Pr.Shd.Unifill))
tblStyle += "background:" + this.RGBToCSS(Pr.Shd.Color, Pr.Shd.Unifill) + ";"; tblStyle += "background:" + this.RGBToCSS(Pr.Shd.Color, Pr.Shd.Unifill) + ";";
if(null != Pr.TableCellMar) if(null != Pr.TableCellMar)
tblStyle += this._MarginToStyle(Pr.TableCellMar, "mso-padding-alt"); tblStyle += this._MarginToStyle(Pr.TableCellMar, "mso-padding-alt");
...@@ -1056,7 +1056,7 @@ CopyProcessor.prototype = ...@@ -1056,7 +1056,7 @@ CopyProcessor.prototype =
} }
else if ( type_Paragraph === Item.GetType() ) else if ( type_Paragraph === Item.GetType() )
{ {
var SelectedAll = Index == elementsContent.length - 1 ? elementsContent[Index].SelectedAll : true; var SelectedAll = Index === elementsContent.length - 1 ? elementsContent[Index].SelectedAll : true;
//todo ����� ������ ��� �������� ������ ���� Index == End //todo ����� ������ ��� �������� ������ ���� Index == End
if(!bFromPresentation) if(!bFromPresentation)
this.oBinaryFileWriter.CopyParagraph(Item, SelectedAll); this.oBinaryFileWriter.CopyParagraph(Item, SelectedAll);
...@@ -1357,7 +1357,7 @@ CopyProcessor.prototype = ...@@ -1357,7 +1357,7 @@ CopyProcessor.prototype =
var sBase64 = this.oPresentationWriter.GetBase64Memory(); var sBase64 = this.oPresentationWriter.GetBase64Memory();
sBase64 = "pptData;" + this.oPresentationWriter.pos + ";" + sBase64; sBase64 = "pptData;" + this.oPresentationWriter.pos + ";" + sBase64;
if(this.oRoot.aChildren && this.oRoot.aChildren.length == 1 && AscBrowser.isSafariMacOs) if(this.oRoot.aChildren && this.oRoot.aChildren.length === 1 && AscBrowser.isSafariMacOs)
{ {
var oElem = this.oRoot.aChildren[0]; var oElem = this.oRoot.aChildren[0];
var sStyle = oElem.oAttributes["style"]; var sStyle = oElem.oAttributes["style"];
...@@ -1489,7 +1489,7 @@ CopyProcessor.prototype = ...@@ -1489,7 +1489,7 @@ CopyProcessor.prototype =
var nRowIndex = elem.row; var nRowIndex = elem.row;
if(null != nPrevRowIndex) if(null != nPrevRowIndex)
{ {
if(nPrevRowIndex + 1 != nRowIndex) if(nPrevRowIndex + 1 !== nRowIndex)
{ {
nMinGrid = null; nMinGrid = null;
nMaxGrid = null; nMaxGrid = null;
...@@ -1510,7 +1510,7 @@ CopyProcessor.prototype = ...@@ -1510,7 +1510,7 @@ CopyProcessor.prototype =
for(var j = elem.indexStart - 1; j >= 0; --j) for(var j = elem.indexStart - 1; j >= 0; --j)
{ {
var cellCur = row.Get_Cell(j); var cellCur = row.Get_Cell(j);
if(vmerge_Continue == cellCur.Get_VMerge()) if(vmerge_Continue === cellCur.Get_VMerge())
{ {
var nCurGridCol = cellCur.Metrics.StartGridCol; var nCurGridCol = cellCur.Metrics.StartGridCol;
if(nCurGridCol >= nPrevStartGrid) if(nCurGridCol >= nPrevStartGrid)
...@@ -1530,7 +1530,7 @@ CopyProcessor.prototype = ...@@ -1530,7 +1530,7 @@ CopyProcessor.prototype =
for(var j = elem.indexEnd + 1; j < row.Get_CellsCount(); ++j) for(var j = elem.indexEnd + 1; j < row.Get_CellsCount(); ++j)
{ {
var cellCur = row.Get_Cell(j); var cellCur = row.Get_Cell(j);
if(vmerge_Continue == cellCur.Get_VMerge()) if(vmerge_Continue === cellCur.Get_VMerge())
{ {
var nCurGridCol = cellCur.Metrics.StartGridCol + cellCur.Get_GridSpan() - 1; var nCurGridCol = cellCur.Metrics.StartGridCol + cellCur.Get_GridSpan() - 1;
if(nCurGridCol <= nPrevEndGrid) if(nCurGridCol <= nPrevEndGrid)
...@@ -1665,25 +1665,25 @@ CopyProcessor.prototype = ...@@ -1665,25 +1665,25 @@ CopyProcessor.prototype =
if(compilePr.TableCellBorders.Bottom) if(compilePr.TableCellBorders.Bottom)
{ {
var color = compilePr.TableCellBorders.Bottom.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap()); color = compilePr.TableCellBorders.Bottom.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap());
cell.Pr.TableCellBorders.Bottom.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b); cell.Pr.TableCellBorders.Bottom.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b);
} }
if(compilePr.TableCellBorders.Top) if(compilePr.TableCellBorders.Top)
{ {
var color = compilePr.TableCellBorders.Top.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap()); color = compilePr.TableCellBorders.Top.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap());
cell.Pr.TableCellBorders.Top.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b); cell.Pr.TableCellBorders.Top.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b);
} }
if(compilePr.TableCellBorders.Left) if(compilePr.TableCellBorders.Left)
{ {
var color = compilePr.TableCellBorders.Left.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap()); color = compilePr.TableCellBorders.Left.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap());
cell.Pr.TableCellBorders.Left.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b); cell.Pr.TableCellBorders.Left.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b);
} }
if(compilePr.TableCellBorders.Right) if(compilePr.TableCellBorders.Right)
{ {
var color = compilePr.TableCellBorders.Right.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap()); color = compilePr.TableCellBorders.Right.Get_Color2(this.oDocument.Get_Theme(), this.oDocument.Get_ColorMap());
cell.Pr.TableCellBorders.Right.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b); cell.Pr.TableCellBorders.Right.Unifill = AscFormat.CreteSolidFillRGB(color.r, color.g, color.b);
} }
} }
...@@ -1947,7 +1947,7 @@ PasteProcessor.prototype = ...@@ -1947,7 +1947,7 @@ PasteProcessor.prototype =
// Отдельно обрабатываем случай, когда курсор находится внутри таблицы // Отдельно обрабатываем случай, когда курсор находится внутри таблицы
var Item = oDocument.Content[oDocument.CurPos.ContentPos]; var Item = oDocument.Content[oDocument.CurPos.ContentPos];
if (type_Table == Item.GetType() && null != Item.CurCell) if (type_Table === Item.GetType() && null != Item.CurCell)
{ {
this.dMaxWidth = this._CalcMaxWidthByCell(Item.CurCell); this.dMaxWidth = this._CalcMaxWidthByCell(Item.CurCell);
oDocument = this._GetTargetDocument(Item.CurCell.Content); oDocument = this._GetTargetDocument(Item.CurCell.Content);
...@@ -1972,14 +1972,14 @@ PasteProcessor.prototype = ...@@ -1972,14 +1972,14 @@ PasteProcessor.prototype =
if(null != cell.Pr && null != cell.Pr.GridSpan) if(null != cell.Pr && null != cell.Pr.GridSpan)
nCellGrid = cell.Pr.GridSpan; nCellGrid = cell.Pr.GridSpan;
var nMarginLeft = 0; var nMarginLeft = 0;
if(null != cell.Pr && null != cell.Pr.TableCellMar && null != cell.Pr.TableCellMar.Left && tblwidth_Mm == cell.Pr.TableCellMar.Left.Type && null != cell.Pr.TableCellMar.Left.W) if(null != cell.Pr && null != cell.Pr.TableCellMar && null != cell.Pr.TableCellMar.Left && tblwidth_Mm === cell.Pr.TableCellMar.Left.Type && null != cell.Pr.TableCellMar.Left.W)
nMarginLeft = cell.Pr.TableCellMar.Left.W; nMarginLeft = cell.Pr.TableCellMar.Left.W;
else if(null != table.Pr && null != table.Pr.TableCellMar && null != table.Pr.TableCellMar.Left && tblwidth_Mm == table.Pr.TableCellMar.Left.Type && null != table.Pr.TableCellMar.Left.W) else if(null != table.Pr && null != table.Pr.TableCellMar && null != table.Pr.TableCellMar.Left && tblwidth_Mm === table.Pr.TableCellMar.Left.Type && null != table.Pr.TableCellMar.Left.W)
nMarginLeft = table.Pr.TableCellMar.Left.W; nMarginLeft = table.Pr.TableCellMar.Left.W;
var nMarginRight = 0; var nMarginRight = 0;
if(null != cell.Pr && null != cell.Pr.TableCellMar && null != cell.Pr.TableCellMar.Right && tblwidth_Mm == cell.Pr.TableCellMar.Right.Type && null != cell.Pr.TableCellMar.Right.W) if(null != cell.Pr && null != cell.Pr.TableCellMar && null != cell.Pr.TableCellMar.Right && tblwidth_Mm === cell.Pr.TableCellMar.Right.Type && null != cell.Pr.TableCellMar.Right.W)
nMarginRight = cell.Pr.TableCellMar.Right.W; nMarginRight = cell.Pr.TableCellMar.Right.W;
else if(null != table.Pr && null != table.Pr.TableCellMar && null != table.Pr.TableCellMar.Right && tblwidth_Mm == table.Pr.TableCellMar.Right.Type && null != table.Pr.TableCellMar.Right.W) else if(null != table.Pr && null != table.Pr.TableCellMar && null != table.Pr.TableCellMar.Right && tblwidth_Mm === table.Pr.TableCellMar.Right.Type && null != table.Pr.TableCellMar.Right.W)
nMarginRight = table.Pr.TableCellMar.Right.W; nMarginRight = table.Pr.TableCellMar.Right.W;
var nPrevSumGrid = nGridBefore; var nPrevSumGrid = nGridBefore;
for(var i = 0; i < nCellIndex; ++i) for(var i = 0; i < nCellIndex; ++i)
...@@ -2012,7 +2012,7 @@ PasteProcessor.prototype = ...@@ -2012,7 +2012,7 @@ PasteProcessor.prototype =
{ {
this.InsertInPlace(oDocument, this.aContent); this.InsertInPlace(oDocument, this.aContent);
if(false == PasteElementsId.g_bIsDocumentCopyPaste) if(false === PasteElementsId.g_bIsDocumentCopyPaste)
{ {
oDocument.Recalculate(); oDocument.Recalculate();
if(oDocument.Parent != null && oDocument.Parent.txBody != null) if(oDocument.Parent != null && oDocument.Parent.txBody != null)
...@@ -2022,7 +2022,7 @@ PasteProcessor.prototype = ...@@ -2022,7 +2022,7 @@ PasteProcessor.prototype =
} }
} }
if(false == this.bNested && nInsertLength > 0) if(false === this.bNested && nInsertLength > 0)
{ {
var bNeedMoveCursor = History.Is_LastPointNeedRecalc(); var bNeedMoveCursor = History.Is_LastPointNeedRecalc();
this.oRecalcDocument.Recalculate(); this.oRecalcDocument.Recalculate();
...@@ -2046,7 +2046,7 @@ PasteProcessor.prototype = ...@@ -2046,7 +2046,7 @@ PasteProcessor.prototype =
if(!PasteElementsId.g_bIsDocumentCopyPaste) if(!PasteElementsId.g_bIsDocumentCopyPaste)
return; return;
var paragraph = oDoc.Content[oDoc.CurPos.ContentPos]; var paragraph = oDoc.Content[oDoc.CurPos.ContentPos];
if (null != paragraph && type_Paragraph == paragraph.GetType()) { if (null != paragraph && type_Paragraph === paragraph.GetType()) {
var NearPos = { Paragraph: paragraph, ContentPos: paragraph.Get_ParaContentPos(false, false) }; var NearPos = { Paragraph: paragraph, ContentPos: paragraph.Get_ParaContentPos(false, false) };
paragraph.Check_NearestPos(NearPos); paragraph.Check_NearestPos(NearPos);
//делаем небольшой сдвиг по y, потому что сама точка TargetPos для двухстрочного параграфа определяется как верхняя //делаем небольшой сдвиг по y, потому что сама точка TargetPos для двухстрочного параграфа определяется как верхняя
...@@ -2075,7 +2075,7 @@ PasteProcessor.prototype = ...@@ -2075,7 +2075,7 @@ PasteProcessor.prototype =
this.pasteTypeContent = null; this.pasteTypeContent = null;
} }
if (i == length - 1 && true != this.bInBlock && type_Paragraph == oSelectedElement.Element.GetType()) if (i === length - 1 && true != this.bInBlock && type_Paragraph === oSelectedElement.Element.GetType())
oSelectedElement.SelectedAll = false; oSelectedElement.SelectedAll = false;
else else
oSelectedElement.SelectedAll = true; oSelectedElement.SelectedAll = true;
...@@ -2387,9 +2387,9 @@ PasteProcessor.prototype = ...@@ -2387,9 +2387,9 @@ PasteProcessor.prototype =
} }
oDoc.Remove(1, true, true); oDoc.Remove(1, true, true);
var Item = oDoc.Content[oDoc.CurPos.ContentPos]; var Item = oDoc.Content[oDoc.CurPos.ContentPos];
if( type_Paragraph == Item.GetType() ) if( type_Paragraph === Item.GetType() )
{ {
if(/*true != this.bInBlock &&*/ 1 == nNewContentLength && type_Paragraph == aNewContent[0].GetType() && Item.CurPos.ContentPos != 1) if(/*true != this.bInBlock &&*/ 1 === nNewContentLength && type_Paragraph === aNewContent[0].GetType() && Item.CurPos.ContentPos !== 1)
{ {
//������� ������ � �������� //������� ������ � ��������
var oInsertPar = aNewContent[0]; var oInsertPar = aNewContent[0];
...@@ -2406,7 +2406,7 @@ PasteProcessor.prototype = ...@@ -2406,7 +2406,7 @@ PasteProcessor.prototype =
for(var i = 0; i < nContentLength - 2; ++i)// -2 �� ����������� ����� ��������� for(var i = 0; i < nContentLength - 2; ++i)// -2 �� ����������� ����� ���������
{ {
var oCurInsItem = oInsertPar.Content[i]; var oCurInsItem = oInsertPar.Content[i];
if(para_Numbering != oCurInsItem.Type) if(para_Numbering !== oCurInsItem.Type)
{ {
Item.Internal_Content_Add(nContentPos, oCurInsItem); Item.Internal_Content_Add(nContentPos, oCurInsItem);
nContentPos++; nContentPos++;
...@@ -2434,7 +2434,7 @@ PasteProcessor.prototype = ...@@ -2434,7 +2434,7 @@ PasteProcessor.prototype =
var nStartIndex = 0; var nStartIndex = 0;
var nEndIndex = nNewContentLength - 1; var nEndIndex = nNewContentLength - 1;
if(type_Paragraph == oInsFirstPar.GetType()) if(type_Paragraph === oInsFirstPar.GetType())
{ {
//�������� �������� ������� ������������ ��������� � ������ �������� �������� //�������� �������� ������� ������������ ��������� � ������ �������� ��������
//CopyPr_Open - ������� � �������, �.�. ���� �������� ��� � ��������� //CopyPr_Open - ������� � �������, �.�. ���� �������� ��� � ���������
...@@ -2448,7 +2448,7 @@ PasteProcessor.prototype = ...@@ -2448,7 +2448,7 @@ PasteProcessor.prototype =
//�������� ��������� ������ ����� ������ �� ��������� ���� �������� //�������� ��������� ������ ����� ������ �� ��������� ���� ��������
nStartIndex++; nStartIndex++;
} }
else if(type_Table == oInsFirstPar.GetType()) else if(type_Table === oInsFirstPar.GetType())
{ {
//���� ��������� ������� � ������ ��������, �� �� ��������� ��� //���� ��������� ������� � ������ ��������, �� �� ��������� ���
if(oSourceFirstPar.IsEmpty()) if(oSourceFirstPar.IsEmpty())
...@@ -2610,7 +2610,7 @@ PasteProcessor.prototype = ...@@ -2610,7 +2610,7 @@ PasteProcessor.prototype =
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
var fPrepasteCallback = function(){ var fPrepasteCallback = function(){
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
oThis.InsertInDocument(); oThis.InsertInDocument();
if(oThis.aContent.bAddNewStyles) if(oThis.aContent.bAddNewStyles)
...@@ -2654,7 +2654,7 @@ PasteProcessor.prototype = ...@@ -2654,7 +2654,7 @@ PasteProcessor.prototype =
{ {
var paste_callback = function() var paste_callback = function()
{ {
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
for(var i = 0; i < arr_shapes.length; ++i) for(var i = 0; i < arr_shapes.length; ++i)
{ {
...@@ -2727,8 +2727,6 @@ PasteProcessor.prototype = ...@@ -2727,8 +2727,6 @@ PasteProcessor.prototype =
this.SetShortImageId(arrImages); this.SetShortImageId(arrImages);
this.api.pre_Paste(fonts, im_arr, paste_callback); this.api.pre_Paste(fonts, im_arr, paste_callback);
} }
return;
} }
else else
{ {
...@@ -2814,14 +2812,14 @@ PasteProcessor.prototype = ...@@ -2814,14 +2812,14 @@ PasteProcessor.prototype =
} }
var fPrepasteCallback = function(){ var fPrepasteCallback = function(){
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
oThis.InsertInDocument(); oThis.InsertInDocument();
if(aContent.bAddNewStyles) if(aContent.bAddNewStyles)
oThis.api.GenerateStyles(); oThis.api.GenerateStyles();
oThis.api.continueInsertDocumentUrls(); oThis.api.continueInsertDocumentUrls();
} }
} };
this.aContent = aContent.content; this.aContent = aContent.content;
//проверяем список фонтов //проверяем список фонтов
...@@ -2869,7 +2867,7 @@ PasteProcessor.prototype = ...@@ -2869,7 +2867,7 @@ PasteProcessor.prototype =
var tempCDocument = function() var tempCDocument = function()
{ {
return new CDocument( this.oDocument.DrawingDocument, false); return new CDocument( this.oDocument.DrawingDocument, false);
} };
//создаём темповый CDocument //создаём темповый CDocument
this.oDocument = AscFormat.ExecuteNoHistory(tempCDocument , this, []); this.oDocument = AscFormat.ExecuteNoHistory(tempCDocument , this, []);
...@@ -2891,12 +2889,12 @@ PasteProcessor.prototype = ...@@ -2891,12 +2889,12 @@ PasteProcessor.prototype =
element = aContent.content[i]; element = aContent.content[i];
//drawings //drawings
element.Get_AllDrawingObjects(drawings); element.Get_AllDrawingObjects(drawings);
if(type_Paragraph == element.GetType())//paragraph if(type_Paragraph === element.GetType())//paragraph
{ {
selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, null, null, true, false); selectedElement.Element = AscFormat.ConvertParagraphToPPTX(element, null, null, true, false);
elements.push(selectedElement); elements.push(selectedElement);
} }
else if(type_Table == element.GetType())//table else if(type_Table === element.GetType())//table
{ {
//TODO переделать количество строк и ширину //TODO переделать количество строк и ширину
var W = 100; var W = 100;
...@@ -2926,7 +2924,7 @@ PasteProcessor.prototype = ...@@ -2926,7 +2924,7 @@ PasteProcessor.prototype =
if(drawings && drawings.length) if(drawings && drawings.length)
{ {
//если массив содержит только изображения //если массив содержит только изображения
if(elements && 1 === elements.length && elements[0].Element && type_Paragraph == elements[0].Element.Get_Type()) if(elements && 1 === elements.length && elements[0].Element && type_Paragraph === elements[0].Element.Get_Type())
{ {
if(true === this._isParagraphContainsOnlyDrawing(elements[0].Element)) if(true === this._isParagraphContainsOnlyDrawing(elements[0].Element))
{ {
...@@ -2947,7 +2945,7 @@ PasteProcessor.prototype = ...@@ -2947,7 +2945,7 @@ PasteProcessor.prototype =
//вставка //вставка
var paste_callback = function() var paste_callback = function()
{ {
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
presentation.Insert_Content(presentationSelectedContent); presentation.Insert_Content(presentationSelectedContent);
presentation.Recalculate(); presentation.Recalculate();
...@@ -2956,7 +2954,7 @@ PasteProcessor.prototype = ...@@ -2956,7 +2954,7 @@ PasteProcessor.prototype =
window['AscCommon'].g_clipboardBase.Paste_Process_End(); window['AscCommon'].g_clipboardBase.Paste_Process_End();
} }
} };
var font_map = {}; var font_map = {};
...@@ -3011,7 +3009,6 @@ PasteProcessor.prototype = ...@@ -3011,7 +3009,6 @@ PasteProcessor.prototype =
oThis.api.pre_Paste(aContent.fonts, aContent.images, paste_callback); oThis.api.pre_Paste(aContent.fonts, aContent.images, paste_callback);
} }
} }
}, },
_pasteBinaryFromPresentation: function(base64, bDuplicate) _pasteBinaryFromPresentation: function(base64, bDuplicate)
...@@ -3021,13 +3018,13 @@ PasteProcessor.prototype = ...@@ -3021,13 +3018,13 @@ PasteProcessor.prototype =
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
var fPrepasteCallback = function(){ var fPrepasteCallback = function(){
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
oThis.InsertInDocument(); oThis.InsertInDocument();
if(aContent.bAddNewStyles) if(aContent.bAddNewStyles)
oThis.api.GenerateStyles(); oThis.api.GenerateStyles();
} }
} };
pptx_content_loader.Clear(); pptx_content_loader.Clear();
...@@ -3282,7 +3279,7 @@ PasteProcessor.prototype = ...@@ -3282,7 +3279,7 @@ PasteProcessor.prototype =
//вставка //вставка
var paste_callback = function() var paste_callback = function()
{ {
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
presentation.Insert_Content(presentationSelectedContent); presentation.Insert_Content(presentationSelectedContent);
presentation.Recalculate(); presentation.Recalculate();
...@@ -3315,7 +3312,7 @@ PasteProcessor.prototype = ...@@ -3315,7 +3312,7 @@ PasteProcessor.prototype =
var paste_callback = function() var paste_callback = function()
{ {
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
var presentationSelectedContent = new PresentationSelectedContent(); var presentationSelectedContent = new PresentationSelectedContent();
presentationSelectedContent.Drawings = arr_shapes; presentationSelectedContent.Drawings = arr_shapes;
...@@ -3742,7 +3739,7 @@ PasteProcessor.prototype = ...@@ -3742,7 +3739,7 @@ PasteProcessor.prototype =
oThis._Execute(node, {}, true, true, false); oThis._Execute(node, {}, true, true, false);
oThis._AddNextPrevToContent(oThis.oDocument); oThis._AddNextPrevToContent(oThis.oDocument);
if(false == oThis.bNested) if(false === oThis.bNested)
{ {
oThis.InsertInDocument(); oThis.InsertInDocument();
} }
...@@ -3971,7 +3968,7 @@ PasteProcessor.prototype = ...@@ -3971,7 +3968,7 @@ PasteProcessor.prototype =
res.Color = new CDocumentColor(border.c.getR(), border.c.getG(), border.c.getB()); res.Color = new CDocumentColor(border.c.getR(), border.c.getG(), border.c.getB());
return res; return res;
} };
var addFont = function(fontFamily) var addFont = function(fontFamily)
{ {
...@@ -3983,7 +3980,7 @@ PasteProcessor.prototype = ...@@ -3983,7 +3980,7 @@ PasteProcessor.prototype =
t.oFonts[fontFamily] = {Name: fontFamily, Index: -1}; t.oFonts[fontFamily] = {Name: fontFamily, Index: -1};
fonts.push(new CFont(fontFamily, 0, "", 0)); fonts.push(new CFont(fontFamily, 0, "", 0));
} };
//grid //grid
var grid = []; var grid = [];
...@@ -4136,7 +4133,7 @@ PasteProcessor.prototype = ...@@ -4136,7 +4133,7 @@ PasteProcessor.prototype =
nUnicode = nCharCode; nUnicode = nCharCode;
if (null != nUnicode) { if (null != nUnicode) {
var Item; var Item;
if (0x20 != nUnicode && 0xA0 != nUnicode && 0x2009 != nUnicode) { if (0x20 !== nUnicode && 0xA0 !== nUnicode && 0x2009 !== nUnicode) {
Item = new ParaText(); Item = new ParaText();
Item.Set_CharCode(nUnicode); Item.Set_CharCode(nUnicode);
} }
...@@ -4338,7 +4335,7 @@ PasteProcessor.prototype = ...@@ -4338,7 +4335,7 @@ PasteProcessor.prototype =
content = aNewContent[i]; content = aNewContent[i];
drawingObj = content.Get_AllDrawingObjects(); drawingObj = content.Get_AllDrawingObjects();
if(!drawingObj || (drawingObj && !drawingObj.length) || content.GetType() == type_Table) if(!drawingObj || (drawingObj && !drawingObj.length) || content.GetType() === type_Table)
{ {
allDrawingObj = null; allDrawingObj = null;
break; break;
...@@ -4347,8 +4344,8 @@ PasteProcessor.prototype = ...@@ -4347,8 +4344,8 @@ PasteProcessor.prototype =
for(var n = 0; n < drawingObj.length; n++) for(var n = 0; n < drawingObj.length; n++)
{ {
allDrawingObj[allDrawingObj.length] = drawingObj[n]; allDrawingObj[allDrawingObj.length] = drawingObj[n];
}; }
}; }
if(allDrawingObj && allDrawingObj.length) if(allDrawingObj && allDrawingObj.length)
this.oLogicDocument.Select_Drawings(allDrawingObj, oDoc); this.oLogicDocument.Select_Drawings(allDrawingObj, oDoc);
...@@ -4563,7 +4560,7 @@ PasteProcessor.prototype = ...@@ -4563,7 +4560,7 @@ PasteProcessor.prototype =
_Prepeare : function(node, fCallback) _Prepeare : function(node, fCallback)
{ {
var oThis = this; var oThis = this;
if(true == this.bUploadImage || true == this.bUploadFonts) if(true === this.bUploadImage || true === this.bUploadFonts)
{ {
//����������� �� ��������� �������� ������ ������� � ��������. //����������� �� ��������� �������� ������ ������� � ��������.
var aPrepeareFonts = this._Prepeare_recursive(node, true, true); var aPrepeareFonts = this._Prepeare_recursive(node, true, true);
...@@ -4577,7 +4574,7 @@ PasteProcessor.prototype = ...@@ -4577,7 +4574,7 @@ PasteProcessor.prototype =
{ {
this.oImages[image] = window["Native"]["GetImageUrl"](this.oImages[image]); this.oImages[image] = window["Native"]["GetImageUrl"](this.oImages[image]);
} }
else if(0 == src.indexOf("file:")) else if(0 === src.indexOf("file:"))
{ {
if (window["AscDesktopEditor"] !== undefined) if (window["AscDesktopEditor"] !== undefined)
{ {
...@@ -4636,7 +4633,7 @@ PasteProcessor.prototype = ...@@ -4636,7 +4633,7 @@ PasteProcessor.prototype =
var nodeType = node.nodeType; var nodeType = node.nodeType;
if(!bIgnoreStyle) if(!bIgnoreStyle)
{ {
if(Node.TEXT_NODE == nodeType) if(Node.TEXT_NODE === nodeType)
{ {
var computedStyle = this._getComputedStyle(node.parentNode); var computedStyle = this._getComputedStyle(node.parentNode);
if ( computedStyle ) if ( computedStyle )
...@@ -4656,10 +4653,10 @@ PasteProcessor.prototype = ...@@ -4656,10 +4653,10 @@ PasteProcessor.prototype =
{ {
var child = node.childNodes[i]; var child = node.childNodes[i];
var child_nodeType = child.nodeType; var child_nodeType = child.nodeType;
if(!(Node.ELEMENT_NODE == child_nodeType || Node.TEXT_NODE == child_nodeType)) if(!(Node.ELEMENT_NODE === child_nodeType || Node.TEXT_NODE === child_nodeType))
continue; continue;
//�������� ������� ��������� ������ �� \t,\n,\r //�������� ������� ��������� ������ �� \t,\n,\r
if( Node.TEXT_NODE == child.nodeType) if( Node.TEXT_NODE === child.nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
if(!value) if(!value)
...@@ -4681,10 +4678,10 @@ PasteProcessor.prototype = ...@@ -4681,10 +4678,10 @@ PasteProcessor.prototype =
//���� ����� ����� ������� //���� ����� ����� �������
this.oFonts[font_family].Index = -1; this.oFonts[font_family].Index = -1;
aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0)); aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0));
}; }
return aPrepeareFonts; return aPrepeareFonts;
}; }
}, },
_checkFontsOnLoad: function(fonts) _checkFontsOnLoad: function(fonts)
{ {
...@@ -4694,14 +4691,14 @@ PasteProcessor.prototype = ...@@ -4694,14 +4691,14 @@ PasteProcessor.prototype =
}, },
_IsBlockElem : function(name) _IsBlockElem : function(name)
{ {
if( "p" == name || "div" == name || "ul" == name || "ol" == name || "li" == name || "table" == name || "tbody" == name || "tr" == name || "td" == name || "th" == name || if( "p" === name || "div" === name || "ul" === name || "ol" === name || "li" === name || "table" === name || "tbody" === name || "tr" === name || "td" === name || "th" === name ||
"h1" == name || "h2" == name || "h3" == name || "h4" == name || "h5" == name || "h6" == name || "center" == name) "h1" === name || "h2" === name || "h3" === name || "h4" === name || "h5" === name || "h6" === name || "center" === name)
return true; return true;
return false; return false;
}, },
_getComputedStyle : function(node){ _getComputedStyle : function(node){
var computedStyle = null; var computedStyle = null;
if(null != node && Node.ELEMENT_NODE == node.nodeType) if(null != node && Node.ELEMENT_NODE === node.nodeType)
{ {
var defaultView = node.ownerDocument.defaultView; var defaultView = node.ownerDocument.defaultView;
computedStyle = defaultView.getComputedStyle( node, null ); computedStyle = defaultView.getComputedStyle( node, null );
...@@ -4711,7 +4708,7 @@ PasteProcessor.prototype = ...@@ -4711,7 +4708,7 @@ PasteProcessor.prototype =
_ValueToMm : function(value) _ValueToMm : function(value)
{ {
var obj = this._ValueToMmType(value); var obj = this._ValueToMmType(value);
if(obj && "%" != obj.type && "none" != obj.type) if(obj && "%" !== obj.type && "none" !== obj.type)
return obj.val; return obj.val;
return null; return null;
}, },
...@@ -4721,36 +4718,36 @@ PasteProcessor.prototype = ...@@ -4721,36 +4718,36 @@ PasteProcessor.prototype =
var oType; var oType;
if(!isNaN(oVal)) if(!isNaN(oVal))
{ {
if(-1 != value.indexOf("%")) if(-1 !== value.indexOf("%"))
{ {
oType = "%"; oType = "%";
oVal /= 100; oVal /= 100;
} }
else if(-1 != value.indexOf("px")) else if(-1 !== value.indexOf("px"))
{ {
oType = "px"; oType = "px";
oVal *= g_dKoef_pix_to_mm; oVal *= g_dKoef_pix_to_mm;
} }
else if(-1 != value.indexOf("in")) else if(-1 !== value.indexOf("in"))
{ {
oType = "in"; oType = "in";
oVal *= g_dKoef_in_to_mm; oVal *= g_dKoef_in_to_mm;
} }
else if(-1 != value.indexOf("cm")) else if(-1 !== value.indexOf("cm"))
{ {
oType = "cm"; oType = "cm";
oVal *= 10; oVal *= 10;
} }
else if(-1 != value.indexOf("mm")) else if(-1 !== value.indexOf("mm"))
{ {
oType = "mm"; oType = "mm";
} }
else if(-1 != value.indexOf("pt")) else if(-1 !== value.indexOf("pt"))
{ {
oType = "pt"; oType = "pt";
oVal *= g_dKoef_pt_to_mm; oVal *= g_dKoef_pt_to_mm;
} }
else if(-1 != value.indexOf("pc")) else if(-1 !== value.indexOf("pc"))
{ {
oType = "pc"; oType = "pc";
oVal *= g_dKoef_pc_to_mm; oVal *= g_dKoef_pc_to_mm;
...@@ -4765,48 +4762,48 @@ PasteProcessor.prototype = ...@@ -4765,48 +4762,48 @@ PasteProcessor.prototype =
{ {
if(!color || color.length == 0) if(!color || color.length == 0)
return null; return null;
if("transparent" == color) if("transparent" === color)
return null; return null;
if("aqua" == color) if("aqua" === color)
return new CDocumentColor(0, 255, 255); return new CDocumentColor(0, 255, 255);
else if("black" == color) else if("black" === color)
return new CDocumentColor(0, 0, 0); return new CDocumentColor(0, 0, 0);
else if("blue" == color) else if("blue" === color)
return new CDocumentColor(0, 0, 255); return new CDocumentColor(0, 0, 255);
else if("fuchsia" == color) else if("fuchsia" === color)
return new CDocumentColor(255, 0, 255); return new CDocumentColor(255, 0, 255);
else if("gray" == color) else if("gray" === color)
return new CDocumentColor(128, 128, 128); return new CDocumentColor(128, 128, 128);
else if("green" == color) else if("green" === color)
return new CDocumentColor(0, 128, 0); return new CDocumentColor(0, 128, 0);
else if("lime" == color) else if("lime" === color)
return new CDocumentColor(0, 255, 0); return new CDocumentColor(0, 255, 0);
else if("maroon" == color) else if("maroon" === color)
return new CDocumentColor(128, 0, 0); return new CDocumentColor(128, 0, 0);
else if("navy" == color) else if("navy" === color)
return new CDocumentColor(0, 0, 128); return new CDocumentColor(0, 0, 128);
else if("olive" == color) else if("olive" === color)
return new CDocumentColor(128, 128, 0); return new CDocumentColor(128, 128, 0);
else if("purple" == color) else if("purple" === color)
return new CDocumentColor(128, 0, 128); return new CDocumentColor(128, 0, 128);
else if("red" == color) else if("red" === color)
return new CDocumentColor(255, 0, 0); return new CDocumentColor(255, 0, 0);
else if("silver" == color) else if("silver" === color)
return new CDocumentColor(192, 192, 192); return new CDocumentColor(192, 192, 192);
else if("teal" == color) else if("teal" === color)
return new CDocumentColor(0, 128, 128); return new CDocumentColor(0, 128, 128);
else if("white" == color) else if("white" === color)
return new CDocumentColor(255, 255, 255); return new CDocumentColor(255, 255, 255);
else if("yellow" == color) else if("yellow" === color)
return new CDocumentColor(255, 255, 0); return new CDocumentColor(255, 255, 0);
else else
{ {
if(0 == color.indexOf("#")) if(0 === color.indexOf("#"))
{ {
var hex = color.substring(1); var hex = color.substring(1);
if(hex.length == 3) if(hex.length === 3)
hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2); hex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);
if(hex.length == 6) if(hex.length === 6)
{ {
var r = parseInt("0x" + hex.substring(0,2)); var r = parseInt("0x" + hex.substring(0,2));
var g = parseInt("0x" + hex.substring(2,4)); var g = parseInt("0x" + hex.substring(2,4));
...@@ -4814,11 +4811,11 @@ PasteProcessor.prototype = ...@@ -4814,11 +4811,11 @@ PasteProcessor.prototype =
return new CDocumentColor(r, g, b); return new CDocumentColor(r, g, b);
} }
} }
if(0 == color.indexOf("rgb")) if(0 === color.indexOf("rgb"))
{ {
var nStart = color.indexOf('('); var nStart = color.indexOf('(');
var nEnd = color.indexOf(')'); var nEnd = color.indexOf(')');
if(-1 != nStart && -1 != nEnd && nStart < nEnd) if(-1 !== nStart && -1 !== nEnd && nStart < nEnd)
{ {
var temp = color.substring(nStart + 1, nEnd); var temp = color.substring(nStart + 1, nEnd);
var aParems = temp.split(','); var aParems = temp.split(',');
...@@ -4834,15 +4831,15 @@ PasteProcessor.prototype = ...@@ -4834,15 +4831,15 @@ PasteProcessor.prototype =
var oG = this._ValueToMmType(aParems[1]); var oG = this._ValueToMmType(aParems[1]);
var oB = this._ValueToMmType(aParems[2]); var oB = this._ValueToMmType(aParems[2]);
var r,g,b; var r,g,b;
if(oR && "%" == oR.type) if(oR && "%" === oR.type)
r = parseInt(255 * oR.val / 100); r = parseInt(255 * oR.val / 100);
else else
r = oR.val; r = oR.val;
if(oG && "%" == oG.type) if(oG && "%" === oG.type)
g = parseInt(255 * oG.val / 100); g = parseInt(255 * oG.val / 100);
else else
g = oG.val; g = oG.val;
if(oB && "%" == oB.type) if(oB && "%" === oB.type)
b = parseInt(255 * oB.val / 100); b = parseInt(255 * oB.val / 100);
else else
b = oB.val; b = oB.val;
...@@ -4871,11 +4868,11 @@ PasteProcessor.prototype = ...@@ -4871,11 +4868,11 @@ PasteProcessor.prototype =
//����������� ����� �� ������ � ������� �������� �������� //����������� ����� �� ������ � ������� �������� ��������
var t = this; var t = this;
var sNodeName = node.nodeName.toLowerCase(); var sNodeName = node.nodeName.toLowerCase();
if(node != this.oRootNode) if(node !== this.oRootNode)
{ {
while(false == this._IsBlockElem(sNodeName)) while(false === this._IsBlockElem(sNodeName))
{ {
if(this.oRootNode != node.parentNode) if(this.oRootNode !== node.parentNode)
{ {
node = node.parentNode; node = node.parentNode;
sNodeName = node.nodeName.toLowerCase(); sNodeName = node.nodeName.toLowerCase();
...@@ -4884,7 +4881,7 @@ PasteProcessor.prototype = ...@@ -4884,7 +4881,7 @@ PasteProcessor.prototype =
break; break;
} }
} }
if("td" == sNodeName || "th" == sNodeName) if("td" === sNodeName || "th" === sNodeName)
{ {
//для случая <td>br<span></span></td> без текста в ячейке //для случая <td>br<span></span></td> без текста в ячейке
var oNewSpacing = new CParaSpacing(); var oNewSpacing = new CParaSpacing();
...@@ -4966,11 +4963,11 @@ PasteProcessor.prototype = ...@@ -4966,11 +4963,11 @@ PasteProcessor.prototype =
if(font_size && Para.TextPr && Para.TextPr.Value) if(font_size && Para.TextPr && Para.TextPr.Value)
{ {
var obj = this._ValueToMmType(font_size); var obj = this._ValueToMmType(font_size);
if(obj && "%" != obj.type && "none" != obj.type) if(obj && "%" !== obj.type && "none" !== obj.type)
{ {
font_size = obj.val; font_size = obj.val;
//���� ������� �� ������������ ������� ������� �������� ���������� ������, ��� ���������� ��� ������� 8, 11, 14, 20, 26pt //���� ������� �� ������������ ������� ������� �������� ���������� ������, ��� ���������� ��� ������� 8, 11, 14, 20, 26pt
if("px" == obj.type && false == this.bIsDoublePx) if("px" === obj.type && false === this.bIsDoublePx)
font_size = Math.round(font_size * g_dKoef_mm_to_pt); font_size = Math.round(font_size * g_dKoef_mm_to_pt);
else else
font_size = Math.round(2 * font_size * g_dKoef_mm_to_pt) / 2;//���������� �������� ���������. font_size = Math.round(2 * font_size * g_dKoef_mm_to_pt) / 2;//���������� �������� ���������.
...@@ -5028,7 +5025,7 @@ PasteProcessor.prototype = ...@@ -5028,7 +5025,7 @@ PasteProcessor.prototype =
Ind.FirstLine = text_indent; Ind.FirstLine = text_indent;
// if(null != pPr.Ind.FirstLine && true == this.bUseScaleKoef) // if(null != pPr.Ind.FirstLine && true == this.bUseScaleKoef)
// pPr.Ind.FirstLine = pPr.Ind.FirstLine * this.dScaleKoef; // pPr.Ind.FirstLine = pPr.Ind.FirstLine * this.dScaleKoef;
if(false == this._isEmptyProperty(Ind) && !pNoHtmlPr['mso-list']) if(false === this._isEmptyProperty(Ind) && !pNoHtmlPr['mso-list'])
Para.Set_Ind(Ind); Para.Set_Ind(Ind);
//Jc //Jc
var text_align = computedStyle.getPropertyValue( "text-align" ); var text_align = computedStyle.getPropertyValue( "text-align" );
...@@ -5036,11 +5033,11 @@ PasteProcessor.prototype = ...@@ -5036,11 +5033,11 @@ PasteProcessor.prototype =
{ {
//����� ��������� -webkit-right //����� ��������� -webkit-right
var Jc = null; var Jc = null;
if(-1 != text_align.indexOf('center')) if(-1 !== text_align.indexOf('center'))
Jc = align_Center; Jc = align_Center;
else if(-1 != text_align.indexOf('right')) else if(-1 !== text_align.indexOf('right'))
Jc = align_Right; Jc = align_Right;
else if(-1 != text_align.indexOf('justify')) else if(-1 !== text_align.indexOf('justify'))
Jc = align_Justify; Jc = align_Justify;
if(null != Jc) if(null != Jc)
Para.Set_Align(Jc, false); Para.Set_Align(Jc, false);
...@@ -5069,7 +5066,7 @@ PasteProcessor.prototype = ...@@ -5069,7 +5066,7 @@ PasteProcessor.prototype =
Spacing.LineRule = Asc.linerule_Exact; Spacing.LineRule = Asc.linerule_Exact;
} }
} }
if(false == this._isEmptyProperty(Spacing)) if(false === this._isEmptyProperty(Spacing))
Para.Set_Spacing(Spacing); Para.Set_Spacing(Spacing);
//Shd //Shd
//background-color �� ����������� ��������� ��������, ���� �������� ������������ �������� //background-color �� ����������� ��������� ��������, ���� �������� ������������ ��������
...@@ -5084,7 +5081,7 @@ PasteProcessor.prototype = ...@@ -5084,7 +5081,7 @@ PasteProcessor.prototype =
if(null != background_color && (background_color = this._ParseColor(background_color))) if(null != background_color && (background_color = this._ParseColor(background_color)))
break; break;
oTempNode = oTempNode.parentNode; oTempNode = oTempNode.parentNode;
if(this.oRootNode == oTempNode || "body" == oTempNode.nodeName.toLowerCase() || true == this._IsBlockElem(oTempNode.nodeName.toLowerCase())) if(this.oRootNode === oTempNode || "body" === oTempNode.nodeName.toLowerCase() || true === this._IsBlockElem(oTempNode.nodeName.toLowerCase()))
break; break;
} }
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
...@@ -5107,7 +5104,7 @@ PasteProcessor.prototype = ...@@ -5107,7 +5104,7 @@ PasteProcessor.prototype =
if(null == oNewBorder.Bottom) if(null == oNewBorder.Bottom)
oNewBorder.Bottom = this._ExecuteBorder(computedStyle, node, "bottom", "Bottom", false); oNewBorder.Bottom = this._ExecuteBorder(computedStyle, node, "bottom", "Bottom", false);
} }
if(false == this._isEmptyProperty(oNewBorder)) if(false === this._isEmptyProperty(oNewBorder))
Para.Set_Borders(oNewBorder); Para.Set_Borders(oNewBorder);
//KeepLines , WidowControl //KeepLines , WidowControl
...@@ -5115,21 +5112,21 @@ PasteProcessor.prototype = ...@@ -5115,21 +5112,21 @@ PasteProcessor.prototype =
if(pagination) if(pagination)
{ {
//todo WidowControl //todo WidowControl
if("none" == pagination) if("none" === pagination)
;//pPr.WidowControl = !Def_pPr.WidowControl; ;//pPr.WidowControl = !Def_pPr.WidowControl;
else if(-1 != pagination.indexOf("widow-orphan") && -1 != pagination.indexOf("lines-together")) else if(-1 !== pagination.indexOf("widow-orphan") && -1 !== pagination.indexOf("lines-together"))
Para.Set_KeepLines(true); Para.Set_KeepLines(true);
else if(-1 != pagination.indexOf("none") && -1 != pagination.indexOf("lines-together")) else if(-1 !== pagination.indexOf("none") && -1 !== pagination.indexOf("lines-together"))
{ {
;//pPr.WidowControl = !Def_pPr.WidowControl; ;//pPr.WidowControl = !Def_pPr.WidowControl;
Para.Set_KeepLines(true); Para.Set_KeepLines(true);
} }
} }
//todo KeepNext //todo KeepNext
if("avoid" == pNoHtmlPr["page-break-after"]) if("avoid" === pNoHtmlPr["page-break-after"])
;//pPr.KeepNext = !Def_pPr.KeepNext; ;//pPr.KeepNext = !Def_pPr.KeepNext;
//PageBreakBefore //PageBreakBefore
if("always" == pNoHtmlPr["page-break-before"]) if("always" === pNoHtmlPr["page-break-before"])
Para.Set_PageBreakBefore(true); Para.Set_PageBreakBefore(true);
//Tabs //Tabs
var tab_stops = pNoHtmlPr["tab-stops"] var tab_stops = pNoHtmlPr["tab-stops"]
...@@ -5153,7 +5150,7 @@ PasteProcessor.prototype = ...@@ -5153,7 +5150,7 @@ PasteProcessor.prototype =
//*****num***** //*****num*****
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
if(true == pNoHtmlPr.bNum) if(true === pNoHtmlPr.bNum)
{ {
var setListTextPr = function(AbstractNum) var setListTextPr = function(AbstractNum)
{ {
...@@ -5167,26 +5164,26 @@ PasteProcessor.prototype = ...@@ -5167,26 +5164,26 @@ PasteProcessor.prototype =
var child = oFirstTextChild.childNodes[i]; var child = oFirstTextChild.childNodes[i];
var nodeType = child.nodeType; var nodeType = child.nodeType;
if(!(Node.ELEMENT_NODE == nodeType || Node.TEXT_NODE == nodeType)) if(!(Node.ELEMENT_NODE === nodeType || Node.TEXT_NODE === nodeType))
continue; continue;
//�������� ������� ��������� ������ �� \t,\n,\r //�������� ������� ��������� ������ �� \t,\n,\r
if( Node.TEXT_NODE == child.nodeType) if( Node.TEXT_NODE === child.nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
if(!value) if(!value)
continue; continue;
value = value.replace(/(\r|\t|\n)/g, ''); value = value.replace(/(\r|\t|\n)/g, '');
if("" == value) if("" === value)
continue; continue;
} }
if(Node.ELEMENT_NODE == nodeType) if(Node.ELEMENT_NODE === nodeType)
{ {
oFirstTextChild = child; oFirstTextChild = child;
bContinue = true; bContinue = true;
break; break;
} }
} }
if(false == bContinue) if(false === bContinue)
break; break;
} }
if(node != oFirstTextChild) if(node != oFirstTextChild)
...@@ -5195,12 +5192,12 @@ PasteProcessor.prototype = ...@@ -5195,12 +5192,12 @@ PasteProcessor.prototype =
{ {
var oLvl = AbstractNum.Lvl[0]; var oLvl = AbstractNum.Lvl[0];
var oTextPr = t._read_rPr(oFirstTextChild); var oTextPr = t._read_rPr(oFirstTextChild);
if(numbering_numfmt_Bullet == num) if(numbering_numfmt_Bullet === num)
oTextPr.RFonts = oLvl.TextPr.RFonts.Copy(); oTextPr.RFonts = oLvl.TextPr.RFonts.Copy();
//TODO убираю пока при всатвке извне underline/bold/italic у стиля маркера //TODO убираю пока при всатвке извне underline/bold/italic у стиля маркера
oTextPr.Bold = oTextPr.Underline = oTextPr.Italic = undefined; oTextPr.Bold = oTextPr.Underline = oTextPr.Italic = undefined;
if(oFirstTextChild.nodeName.toLowerCase() == "a" && oTextPr.Color) if(oFirstTextChild.nodeName.toLowerCase() === "a" && oTextPr.Color)
oTextPr.Color.Set(0, 0, 0); oTextPr.Color.Set(0, 0, 0);
//�������� ��������� �� node //�������� ��������� �� node
...@@ -5215,11 +5212,11 @@ PasteProcessor.prototype = ...@@ -5215,11 +5212,11 @@ PasteProcessor.prototype =
var level = 0; var level = 0;
var listId = null; var listId = null;
var startIndex; var startIndex;
if(-1 != (startIndex = pNoHtmlPr['mso-list'].indexOf("level"))) if(-1 !== (startIndex = pNoHtmlPr['mso-list'].indexOf("level")))
{ {
level = parseInt(pNoHtmlPr['mso-list'].substr(startIndex + 5, 1)) - 1; level = parseInt(pNoHtmlPr['mso-list'].substr(startIndex + 5, 1)) - 1;
} }
if(-1 != (startIndex = pNoHtmlPr['mso-list'].indexOf("lfo"))) if(-1 !== (startIndex = pNoHtmlPr['mso-list'].indexOf("lfo")))
{ {
listId = pNoHtmlPr['mso-list'].substr(startIndex, 4); listId = pNoHtmlPr['mso-list'].substr(startIndex, 4);
} }
...@@ -5421,7 +5418,7 @@ PasteProcessor.prototype = ...@@ -5421,7 +5418,7 @@ PasteProcessor.prototype =
} }
else else
{ {
if(true == pNoHtmlPr.bNum) if(true === pNoHtmlPr.bNum)
{ {
var num = numbering_presentationnumfrmt_Char; var num = numbering_presentationnumfrmt_Char;
if(null != pNoHtmlPr.numType) if(null != pNoHtmlPr.numType)
...@@ -5445,7 +5442,7 @@ PasteProcessor.prototype = ...@@ -5445,7 +5442,7 @@ PasteProcessor.prototype =
} }
var _bullet = new CPresentationBullet(); var _bullet = new CPresentationBullet();
_bullet.m_nType = num; _bullet.m_nType = num;
if(num == numbering_presentationnumfrmt_Char) if(num === numbering_presentationnumfrmt_Char)
{ {
_bullet.m_sChar = ""; _bullet.m_sChar = "";
} }
...@@ -5467,7 +5464,7 @@ PasteProcessor.prototype = ...@@ -5467,7 +5464,7 @@ PasteProcessor.prototype =
//заглушка для вставки в excel внутрь шейпа //заглушка для вставки в excel внутрь шейпа
var tempRpr; var tempRpr;
if(this.pasteInExcel === true && this.oDocument && this.oDocument.Parent && this.oDocument.Parent.parent && this.oDocument.Parent.parent.getObjectType() == AscDFH.historyitem_type_Shape) if(this.pasteInExcel === true && this.oDocument && this.oDocument.Parent && this.oDocument.Parent.parent && this.oDocument.Parent.parent.getObjectType() === AscDFH.historyitem_type_Shape)
{ {
tempRpr = new CTextPr(); tempRpr = new CTextPr();
tempRpr.Underline = rPr.Underline; tempRpr.Underline = rPr.Underline;
...@@ -5547,11 +5544,11 @@ PasteProcessor.prototype = ...@@ -5547,11 +5544,11 @@ PasteProcessor.prototype =
if(font_size) if(font_size)
{ {
var obj = this._ValueToMmType(font_size); var obj = this._ValueToMmType(font_size);
if(obj && "%" != obj.type && "none" != obj.type) if(obj && "%" !== obj.type && "none" !== obj.type)
{ {
font_size = obj.val; font_size = obj.val;
//���� ������� �� ������������ ������� ������� �������� ���������� ������, ��� ���������� ��� ������� 8, 11, 14, 20, 26pt //���� ������� �� ������������ ������� ������� �������� ���������� ������, ��� ���������� ��� ������� 8, 11, 14, 20, 26pt
if("px" == obj.type && false == this.bIsDoublePx) if("px" === obj.type && false === this.bIsDoublePx)
font_size = Math.round(font_size * g_dKoef_mm_to_pt); font_size = Math.round(font_size * g_dKoef_mm_to_pt);
else else
font_size = Math.round(2 * font_size * g_dKoef_mm_to_pt) / 2;//���������� �������� ���������. font_size = Math.round(2 * font_size * g_dKoef_mm_to_pt) / 2;//���������� �������� ���������.
...@@ -5568,11 +5565,11 @@ PasteProcessor.prototype = ...@@ -5568,11 +5565,11 @@ PasteProcessor.prototype =
var font_weight = computedStyle.getPropertyValue( "font-weight" ); var font_weight = computedStyle.getPropertyValue( "font-weight" );
if(font_weight) if(font_weight)
{ {
if("bold" == font_weight || "bolder" == font_weight || 400 < font_weight) if("bold" === font_weight || "bolder" === font_weight || 400 < font_weight)
rPr.Bold = true; rPr.Bold = true;
} }
var font_style = computedStyle.getPropertyValue( "font-style" ); var font_style = computedStyle.getPropertyValue( "font-style" );
if("italic" == font_style) if("italic" === font_style)
rPr.Italic = true; rPr.Italic = true;
var color = computedStyle.getPropertyValue( "color" ); var color = computedStyle.getPropertyValue( "color" );
if(color && (color = this._ParseColor(color))) if(color && (color = this._ParseColor(color)))
...@@ -5590,7 +5587,7 @@ PasteProcessor.prototype = ...@@ -5590,7 +5587,7 @@ PasteProcessor.prototype =
var Strikeout = null; var Strikeout = null;
var vertical_align = null; var vertical_align = null;
var oTempNode = node; var oTempNode = node;
while (true != bUseOnlyInherit && true) while (true !== bUseOnlyInherit && true)
{ {
var tempComputedStyle = this._getComputedStyle(oTempNode); var tempComputedStyle = this._getComputedStyle(oTempNode);
if(null == tempComputedStyle) if(null == tempComputedStyle)
...@@ -5600,12 +5597,12 @@ PasteProcessor.prototype = ...@@ -5600,12 +5597,12 @@ PasteProcessor.prototype =
var text_decoration = tempComputedStyle.getPropertyValue( "text-decoration" ); var text_decoration = tempComputedStyle.getPropertyValue( "text-decoration" );
if(text_decoration) if(text_decoration)
{ {
if(-1 != text_decoration.indexOf("underline")) if(-1 !== text_decoration.indexOf("underline"))
underline = true; underline = true;
else if(-1 != text_decoration.indexOf("none") && node.parentElement && node.parentElement.nodeName.toLowerCase() == "a") else if(-1 !== text_decoration.indexOf("none") && node.parentElement && node.parentElement.nodeName.toLowerCase() === "a")
underline = false; underline = false;
if(-1 != text_decoration.indexOf("line-through")) if(-1 !== text_decoration.indexOf("line-through"))
Strikeout = true; Strikeout = true;
} }
} }
...@@ -5617,7 +5614,7 @@ PasteProcessor.prototype = ...@@ -5617,7 +5614,7 @@ PasteProcessor.prototype =
else else
background_color = null; background_color = null;
} }
if(null == vertical_align || "baseline" == vertical_align) if(null == vertical_align || "baseline" === vertical_align)
{ {
vertical_align = tempComputedStyle.getPropertyValue( "vertical-align" ); vertical_align = tempComputedStyle.getPropertyValue( "vertical-align" );
if(!vertical_align) if(!vertical_align)
...@@ -5626,7 +5623,7 @@ PasteProcessor.prototype = ...@@ -5626,7 +5623,7 @@ PasteProcessor.prototype =
if(vertical_align && background_color && Strikeout && underline) if(vertical_align && background_color && Strikeout && underline)
break; break;
oTempNode = oTempNode.parentNode; oTempNode = oTempNode.parentNode;
if(this.oRootNode == oTempNode || "body" == oTempNode.nodeName.toLowerCase() || true == this._IsBlockElem(oTempNode.nodeName.toLowerCase())) if(this.oRootNode === oTempNode || "body" === oTempNode.nodeName.toLowerCase() || true === this._IsBlockElem(oTempNode.nodeName.toLowerCase()))
break; break;
} }
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
...@@ -5673,7 +5670,7 @@ PasteProcessor.prototype = ...@@ -5673,7 +5670,7 @@ PasteProcessor.prototype =
if(this.aContent.length > 0) if(this.aContent.length > 0)
{ {
var last = this.aContent[this.aContent.length - 1]; var last = this.aContent[this.aContent.length - 1];
if(type_Table == last.GetType()) if(type_Table === last.GetType())
{ {
this._Add_NewParagraph(); this._Add_NewParagraph();
} }
...@@ -5704,9 +5701,9 @@ PasteProcessor.prototype = ...@@ -5704,9 +5701,9 @@ PasteProcessor.prototype =
else else
nUnicode = nCharCode; nUnicode = nCharCode;
if (null != nUnicode) { if (null !== nUnicode) {
var Item; var Item;
if (0x20 != nUnicode && 0xA0 != nUnicode && 0x2009 != nUnicode) if (0x20 !== nUnicode && 0xA0 !== nUnicode && 0x2009 !== nUnicode)
{ {
if(!res) if(!res)
{ {
...@@ -5768,7 +5765,7 @@ PasteProcessor.prototype = ...@@ -5768,7 +5765,7 @@ PasteProcessor.prototype =
var i = arab_number.length - 1; var i = arab_number.length - 1;
while (i >= 0 && pos < text.length) while (i >= 0 && pos < text.length)
{ {
if (text.substr(pos, rom_number[i].length) == rom_number[i]) if (text.substr(pos, rom_number[i].length) === rom_number[i])
{ {
result += arab_number[i]; result += arab_number[i];
pos += rom_number[i].length; pos += rom_number[i].length;
...@@ -5911,14 +5908,14 @@ PasteProcessor.prototype = ...@@ -5911,14 +5908,14 @@ PasteProcessor.prototype =
_Paragraph_Add: function (elem) _Paragraph_Add: function (elem)
{ {
if (null != this.oCurRun) { if (null != this.oCurRun) {
if (para_Hyperlink == elem.Type) { if (para_Hyperlink === elem.Type) {
this._CommitRunToParagraph(true); this._CommitRunToParagraph(true);
this._CommitElemToParagraph(elem); this._CommitElemToParagraph(elem);
} }
else { else {
this.oCurRun.Add_ToContent(this.oCurRunContentPos, elem, false); this.oCurRun.Add_ToContent(this.oCurRunContentPos, elem, false);
this.oCurRunContentPos++; this.oCurRunContentPos++;
if (1 == this.oCurRun.Content.length) if (1 === this.oCurRun.Content.length)
this._CommitElemToParagraph(this.oCurRun); this._CommitElemToParagraph(this.oCurRun);
} }
} }
...@@ -5960,7 +5957,7 @@ PasteProcessor.prototype = ...@@ -5960,7 +5957,7 @@ PasteProcessor.prototype =
{ {
for(var i = 0, length = this.nBrCount - nIgnore; i < length; i++) for(var i = 0, length = this.nBrCount - nIgnore; i < length; i++)
{ {
if ("always" == pPr["mso-column-break-before"]) if ("always" === pPr["mso-column-break-before"])
this._Paragraph_Add(new ParaNewLine(break_Page)); this._Paragraph_Add(new ParaNewLine(break_Page));
else{ else{
if (this.bInBlock) if (this.bInBlock)
...@@ -5979,7 +5976,7 @@ PasteProcessor.prototype = ...@@ -5979,7 +5976,7 @@ PasteProcessor.prototype =
//���� ���� ���� tbody //���� ���� ���� tbody
for(var i = 0, length = node.childNodes.length; i < length; ++i) for(var i = 0, length = node.childNodes.length; i < length; ++i)
{ {
if("tbody" == node.childNodes[i].nodeName.toLowerCase()) if("tbody" === node.childNodes[i].nodeName.toLowerCase())
{ {
if(!newNode) if(!newNode)
newNode = node.childNodes[i]; newNode = node.childNodes[i];
...@@ -6027,7 +6024,7 @@ PasteProcessor.prototype = ...@@ -6027,7 +6024,7 @@ PasteProcessor.prototype =
for(var i = 0, length = node.childNodes.length; i < length; ++i) for(var i = 0, length = node.childNodes.length; i < length; ++i)
{ {
var tr = node.childNodes[i]; var tr = node.childNodes[i];
if("tr" == tr.nodeName.toLowerCase()) if("tr" === tr.nodeName.toLowerCase())
{ {
nCurSum = 0; nCurSum = 0;
nCurColWidth = 0; nCurColWidth = 0;
...@@ -6036,7 +6033,7 @@ PasteProcessor.prototype = ...@@ -6036,7 +6033,7 @@ PasteProcessor.prototype =
{ {
var tc = tr.childNodes[j]; var tc = tr.childNodes[j];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
fParseSpans(); fParseSpans();
...@@ -6085,7 +6082,7 @@ PasteProcessor.prototype = ...@@ -6085,7 +6082,7 @@ PasteProcessor.prototype =
{ {
var tc = tr.childNodes[j]; var tc = tr.childNodes[j];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
var nCurRowSpan = tc.getAttribute("rowspan"); var nCurRowSpan = tc.getAttribute("rowspan");
if(null != nCurRowSpan) if(null != nCurRowSpan)
...@@ -6141,7 +6138,7 @@ PasteProcessor.prototype = ...@@ -6141,7 +6138,7 @@ PasteProcessor.prototype =
if(null != nPrevIndex) if(null != nPrevIndex)
{ {
var nDif = nCurIndex - nPrevIndex; var nDif = nCurIndex - nPrevIndex;
if(1 == nDif) if(1 === nDif)
{ {
if(!nCurWidth && !nAllSum && columnSize) if(!nCurWidth && !nAllSum && columnSize)
{ {
...@@ -6174,7 +6171,7 @@ PasteProcessor.prototype = ...@@ -6174,7 +6171,7 @@ PasteProcessor.prototype =
aSumGrid[i] = nSum; aSumGrid[i] = nSum;
} }
//�������� content //�������� content
this._ExecuteTable(tableNode, node, table, aSumGrid, nMaxColCount != nMinColCount ? aColsCountByRow : null, pPr, bUseScaleKoef, dScaleKoef); this._ExecuteTable(tableNode, node, table, aSumGrid, nMaxColCount !== nMinColCount ? aColsCountByRow : null, pPr, bUseScaleKoef, dScaleKoef);
table.MoveCursorToStartPos(); table.MoveCursorToStartPos();
this.aContent.push(table); this.aContent.push(table);
} }
...@@ -6186,7 +6183,7 @@ PasteProcessor.prototype = ...@@ -6186,7 +6183,7 @@ PasteProcessor.prototype =
if(null != style) if(null != style)
{ {
res = new CDocumentBorder(); res = new CDocumentBorder();
if("none" == style) if("none" === style)
res.Value = border_None; res.Value = border_None;
else else
{ {
...@@ -6258,9 +6255,9 @@ PasteProcessor.prototype = ...@@ -6258,9 +6255,9 @@ PasteProcessor.prototype =
} }
if(null != sTableAlign) if(null != sTableAlign)
{ {
if(-1 != sTableAlign.indexOf('center')) if(-1 !== sTableAlign.indexOf('center'))
table.Set_TableAlign(align_Center); table.Set_TableAlign(align_Center);
else if(-1 != sTableAlign.indexOf('right')) else if(-1 !== sTableAlign.indexOf('right'))
table.Set_TableAlign(align_Right); table.Set_TableAlign(align_Right);
} }
var spacing = null; var spacing = null;
...@@ -6280,7 +6277,7 @@ PasteProcessor.prototype = ...@@ -6280,7 +6277,7 @@ PasteProcessor.prototype =
{ {
padding = trimString(padding); padding = trimString(padding);
var aMargins = padding.split(" "); var aMargins = padding.split(" ");
if(4 == aMargins.length) if(4 === aMargins.length)
{ {
var top = aMargins[0]; var top = aMargins[0];
if(null != top && null != (top = this._ValueToMm(top))) if(null != top && null != (top = this._ValueToMm(top)))
...@@ -6315,7 +6312,7 @@ PasteProcessor.prototype = ...@@ -6315,7 +6312,7 @@ PasteProcessor.prototype =
var computedStyle = this._getComputedStyle(tableNode); var computedStyle = this._getComputedStyle(tableNode);
if(computedStyle) if(computedStyle)
{ {
if(align_Left == table.Get_TableAlign()) if(align_Left === table.Get_TableAlign())
{ {
var margin_left = computedStyle.getPropertyValue( "margin-left" ); var margin_left = computedStyle.getPropertyValue( "margin-left" );
//todo возможно надо еще учесть ширину таблицы //todo возможно надо еще учесть ширину таблицы
...@@ -6356,7 +6353,7 @@ PasteProcessor.prototype = ...@@ -6356,7 +6353,7 @@ PasteProcessor.prototype =
{ {
var tr = node.childNodes[i]; var tr = node.childNodes[i];
//TODO временная правка в условии для того, чтобы избежать ошибки при копировании из excel мерженной ячейки //TODO временная правка в условии для того, чтобы избежать ошибки при копировании из excel мерженной ячейки
if("tr" == tr.nodeName.toLowerCase() && tr.childNodes && tr.childNodes.length) if("tr" === tr.nodeName.toLowerCase() && tr.childNodes && tr.childNodes.length)
{ {
var row = table.Internal_Add_Row(table.Content.length, 0); var row = table.Internal_Add_Row(table.Content.length, 0);
this._ExecuteTableRow(tr, row, aSumGrid, spacing, oRowSpans, bUseScaleKoef, dScaleKoef); this._ExecuteTableRow(tr, row, aSumGrid, spacing, oRowSpans, bUseScaleKoef, dScaleKoef);
...@@ -6367,13 +6364,13 @@ PasteProcessor.prototype = ...@@ -6367,13 +6364,13 @@ PasteProcessor.prototype =
{ {
var oThis = this; var oThis = this;
var table = row.Table; var table = row.Table;
var oTableSpacingMinValue = ("undefined" != typeof tableSpacingMinValue) ? tableSpacingMinValue : 0.02; var oTableSpacingMinValue = ("undefined" !== typeof tableSpacingMinValue) ? tableSpacingMinValue : 0.02;
if(null != spacing && spacing >= oTableSpacingMinValue) if(null != spacing && spacing >= oTableSpacingMinValue)
row.Set_CellSpacing(spacing); row.Set_CellSpacing(spacing);
if(node.style.height) if(node.style.height)
{ {
var height = node.style.height; var height = node.style.height;
if(!("auto" == height || "inherit" == height || -1 != height.indexOf("%")) && null != (height = this._ValueToMm(height))) if(!("auto" === height || "inherit" === height || -1 !== height.indexOf("%")) && null != (height = this._ValueToMm(height)))
row.Set_Height(height, Asc.linerule_AtLeast); row.Set_Height(height, Asc.linerule_AtLeast);
} }
var bBefore = false; var bBefore = false;
...@@ -6418,7 +6415,7 @@ PasteProcessor.prototype = ...@@ -6418,7 +6415,7 @@ PasteProcessor.prototype =
{ {
var tc = node.childNodes[i]; var tc = node.childNodes[i];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
if(bBefore && null != oBeforeCell) if(bBefore && null != oBeforeCell)
oBeforeCell = tc; oBeforeCell = tc;
...@@ -6434,16 +6431,16 @@ PasteProcessor.prototype = ...@@ -6434,16 +6431,16 @@ PasteProcessor.prototype =
var tc = node.childNodes[i]; var tc = node.childNodes[i];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
var nColSpan = tc.getAttribute("colspan"); var nColSpan = tc.getAttribute("colspan");
if(null != nColSpan) if(null != nColSpan)
nColSpan = nColSpan - 0; nColSpan = nColSpan - 0;
else else
nColSpan = 1; nColSpan = 1;
if(tc == oBeforeCell) if(tc === oBeforeCell)
row.Set_Before(nColSpan); row.Set_Before(nColSpan);
else if(tc == oAfterCell) else if(tc === oAfterCell)
row.Set_After(nColSpan); row.Set_After(nColSpan);
else else
{ {
...@@ -6518,7 +6515,7 @@ PasteProcessor.prototype = ...@@ -6518,7 +6515,7 @@ PasteProcessor.prototype =
oPasteProcessor.oDocument = cell.Content; oPasteProcessor.oDocument = cell.Content;
oPasteProcessor.bIgnoreNoBlockText = true; oPasteProcessor.bIgnoreNoBlockText = true;
oPasteProcessor.dMaxWidth = this._CalcMaxWidthByCell(cell); oPasteProcessor.dMaxWidth = this._CalcMaxWidthByCell(cell);
if(true == bUseScaleKoef) if(true === bUseScaleKoef)
{ {
oPasteProcessor.bUseScaleKoef = bUseScaleKoef; oPasteProcessor.bUseScaleKoef = bUseScaleKoef;
oPasteProcessor.dScaleKoef = dScaleKoef; oPasteProcessor.dScaleKoef = dScaleKoef;
...@@ -6526,7 +6523,7 @@ PasteProcessor.prototype = ...@@ -6526,7 +6523,7 @@ PasteProcessor.prototype =
oPasteProcessor._Execute(node, {}, true, true, false); oPasteProcessor._Execute(node, {}, true, true, false);
oPasteProcessor._PrepareContent(); oPasteProcessor._PrepareContent();
oPasteProcessor._AddNextPrevToContent(cell.Content); oPasteProcessor._AddNextPrevToContent(cell.Content);
if(0 == oPasteProcessor.aContent.length) if(0 === oPasteProcessor.aContent.length)
{ {
var oDocContent = cell.Content; var oDocContent = cell.Content;
var oNewPar = new Paragraph(oDocContent.DrawingDocument, oDocContent); var oNewPar = new Paragraph(oDocContent.DrawingDocument, oDocContent);
...@@ -6539,7 +6536,7 @@ PasteProcessor.prototype = ...@@ -6539,7 +6536,7 @@ PasteProcessor.prototype =
//��������� ����� ��������� //��������� ����� ���������
for(var i = 0, length = oPasteProcessor.aContent.length; i < length; ++i) for(var i = 0, length = oPasteProcessor.aContent.length; i < length; ++i)
{ {
if(i == length - 1) if(i === length - 1)
cell.Content.Internal_Content_Add(i + 1, oPasteProcessor.aContent[i], true); cell.Content.Internal_Content_Add(i + 1, oPasteProcessor.aContent[i], true);
else else
cell.Content.Internal_Content_Add(i + 1, oPasteProcessor.aContent[i], false); cell.Content.Internal_Content_Add(i + 1, oPasteProcessor.aContent[i], false);
...@@ -6553,7 +6550,7 @@ PasteProcessor.prototype = ...@@ -6553,7 +6550,7 @@ PasteProcessor.prototype =
for(var i = 0, length = node.childNodes.length; i < length; i++) for(var i = 0, length = node.childNodes.length; i < length; i++)
{ {
var child = node.childNodes[i]; var child = node.childNodes[i];
if(Node.ELEMENT_NODE == child.nodeType) if(Node.ELEMENT_NODE === child.nodeType)
{ {
var sClass = child.getAttribute("class"); var sClass = child.getAttribute("class");
var sStyle = child.getAttribute("style"); var sStyle = child.getAttribute("style");
...@@ -6589,21 +6586,21 @@ PasteProcessor.prototype = ...@@ -6589,21 +6586,21 @@ PasteProcessor.prototype =
{ {
var child = node.childNodes[i]; var child = node.childNodes[i];
var bIsBlockChild = this._IsBlockElem(child.nodeName.toLowerCase()); var bIsBlockChild = this._IsBlockElem(child.nodeName.toLowerCase());
if(true == bIsBlockChild) if(true === bIsBlockChild)
{ {
bRootHasBlock = true; bRootHasBlock = true;
bExist = true; bExist = true;
break; break;
} }
} }
if(false == bExist && true == this.bIgnoreNoBlockText) if(false === bExist && true === this.bIgnoreNoBlockText)
this.bIgnoreNoBlockText = false; this.bIgnoreNoBlockText = false;
} }
else else
{ {
if(Node.TEXT_NODE == node.nodeType) if(Node.TEXT_NODE === node.nodeType)
{ {
if(false == this.bIgnoreNoBlockText || true == bInBlock) if(false === this.bIgnoreNoBlockText || true === bInBlock)
{ {
var value = node.nodeValue; var value = node.nodeValue;
if(!value) if(!value)
...@@ -6637,7 +6634,7 @@ PasteProcessor.prototype = ...@@ -6637,7 +6634,7 @@ PasteProcessor.prototype =
nUnicode = nCharCode; nUnicode = nCharCode;
if (null != nUnicode) { if (null != nUnicode) {
var Item; var Item;
if (0x20 != nUnicode && 0x2009 != nUnicode) { if (0x20 !== nUnicode && 0x2009 !== nUnicode) {
Item = new ParaText(); Item = new ParaText();
Item.Set_CharCode(nUnicode); Item.Set_CharCode(nUnicode);
} }
...@@ -6651,7 +6648,7 @@ PasteProcessor.prototype = ...@@ -6651,7 +6648,7 @@ PasteProcessor.prototype =
return bAddParagraph; return bAddParagraph;
} }
var sNodeName = node.nodeName.toLowerCase(); var sNodeName = node.nodeName.toLowerCase();
if("table" == sNodeName && this.pasteInExcel !== true && this.pasteInPresentationShape !== true) if("table" === sNodeName && this.pasteInExcel !== true && this.pasteInPresentationShape !== true)
{ {
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
...@@ -6667,51 +6664,51 @@ PasteProcessor.prototype = ...@@ -6667,51 +6664,51 @@ PasteProcessor.prototype =
if(style) if(style)
this._parseCss(style, pPr); this._parseCss(style, pPr);
if("h1" == sNodeName) if("h1" === sNodeName)
pPr.hLevel = 0; pPr.hLevel = 0;
else if("h2" == sNodeName) else if("h2" === sNodeName)
pPr.hLevel = 1; pPr.hLevel = 1;
else if("h3" == sNodeName) else if("h3" === sNodeName)
pPr.hLevel = 2; pPr.hLevel = 2;
else if("h4" == sNodeName) else if("h4" === sNodeName)
pPr.hLevel = 3; pPr.hLevel = 3;
else if("h5" == sNodeName) else if("h5" === sNodeName)
pPr.hLevel = 4; pPr.hLevel = 4;
else if("h6" == sNodeName) else if("h6" === sNodeName)
pPr.hLevel = 5; pPr.hLevel = 5;
if("ul" == sNodeName || "ol" == sNodeName || "li" == sNodeName) if("ul" === sNodeName || "ol" === sNodeName || "li" === sNodeName)
{ {
//в данном случае если нет тега li, то списоком не считаем //в данном случае если нет тега li, то списоком не считаем
if("li" == sNodeName) if("li" === sNodeName)
{ {
pPr.bNum = true; pPr.bNum = true;
} }
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
if("ul" == sNodeName) if("ul" === sNodeName)
pPr.numType = numbering_numfmt_Bullet; pPr.numType = numbering_numfmt_Bullet;
else if("ol" == sNodeName) else if("ol" === sNodeName)
pPr.numType = numbering_numfmt_Decimal; pPr.numType = numbering_numfmt_Decimal;
} }
else else
{ {
if("ul" == sNodeName) if("ul" === sNodeName)
pPr.numType = numbering_presentationnumfrmt_Char; pPr.numType = numbering_presentationnumfrmt_Char;
else if("ol" == sNodeName) else if("ol" === sNodeName)
pPr.numType = numbering_presentationnumfrmt_ArabicPeriod; pPr.numType = numbering_presentationnumfrmt_ArabicPeriod;
} }
} }
else if(pPr["mso-list"]) else if(pPr["mso-list"])
{ {
if("p" == sNodeName) if("p" === sNodeName)
{ {
pPr.bNum = true; pPr.bNum = true;
} }
} }
if("img" == sNodeName && this.pasteInExcel !== true) if("img" === sNodeName && this.pasteInExcel !== true)
{ {
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
...@@ -6824,7 +6821,7 @@ PasteProcessor.prototype = ...@@ -6824,7 +6821,7 @@ PasteProcessor.prototype =
} }
//��������� linebreak, ���� �� �� ��������� ������� �������� � �� ����� ��� ������� ������� //��������� linebreak, ���� �� �� ��������� ������� �������� � �� ����� ��� ������� �������
var bPageBreakBefore = "always" == node.style.pageBreakBefore || "left" == node.style.pageBreakBefore || "right" == node.style.pageBreakBefore; var bPageBreakBefore = "always" === node.style.pageBreakBefore || "left" === node.style.pageBreakBefore || "right" === node.style.pageBreakBefore;
if ("br" == sNodeName || bPageBreakBefore) if ("br" == sNodeName || bPageBreakBefore)
{ {
if (bPageBreakBefore) if (bPageBreakBefore)
...@@ -6838,14 +6835,14 @@ PasteProcessor.prototype = ...@@ -6838,14 +6835,14 @@ PasteProcessor.prototype =
{ {
bAddParagraph = this._Decide_AddParagraph(node.parentNode, pPr, bAddParagraph, false); bAddParagraph = this._Decide_AddParagraph(node.parentNode, pPr, bAddParagraph, false);
this.nBrCount++;//this._Paragraph_Add( new ParaNewLine( break_Line ) ); this.nBrCount++;//this._Paragraph_Add( new ParaNewLine( break_Line ) );
if("line-break" == pPr["mso-special-character"] || "always" == pPr["mso-column-break-before"]) if("line-break" === pPr["mso-special-character"] || "always" === pPr["mso-column-break-before"])
this._Commit_Br(0, node, pPr); this._Commit_Br(0, node, pPr);
return bAddParagraph; return bAddParagraph;
} }
} }
//�������� �� tab //�������� �� tab
if("span" == sNodeName) if("span" === sNodeName)
{ {
var nTabCount = parseInt(pPr["mso-tab-count"] || 0); var nTabCount = parseInt(pPr["mso-tab-count"] || 0);
if(nTabCount > 0) if(nTabCount > 0)
...@@ -6865,22 +6862,22 @@ PasteProcessor.prototype = ...@@ -6865,22 +6862,22 @@ PasteProcessor.prototype =
var nodeType = child.nodeType; var nodeType = child.nodeType;
//��� ����������� �� word ����� ����������� ����������� �� ������� //��� ����������� �� word ����� ����������� ����������� �� �������
//����������� ����������, ������ ������ ������ //����������� ����������, ������ ������ ������
if(Node.COMMENT_NODE == nodeType) if(Node.COMMENT_NODE === nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
var bSkip = false; var bSkip = false;
if(value) if(value)
{ {
if(-1 != value.indexOf("supportLists")) if(-1 !== value.indexOf("supportLists"))
{ {
//todo ���������� ��� ������ //todo ���������� ��� ������
pPr.bNum = true; pPr.bNum = true;
bSkip = true; bSkip = true;
} }
if(-1 != value.indexOf("supportLineBreakNewLine")) if(-1 !== value.indexOf("supportLineBreakNewLine"))
bSkip = true; bSkip = true;
} }
if(true == bSkip) if(true === bSkip)
{ {
//���������� ��� �� �������������� ����������� //���������� ��� �� �������������� �����������
var j = i + 1; var j = i + 1;
...@@ -6888,10 +6885,10 @@ PasteProcessor.prototype = ...@@ -6888,10 +6885,10 @@ PasteProcessor.prototype =
{ {
var tempNode = node.childNodes[j]; var tempNode = node.childNodes[j];
var tempNodeType = tempNode.nodeType; var tempNodeType = tempNode.nodeType;
if(Node.COMMENT_NODE == tempNodeType) if(Node.COMMENT_NODE === tempNodeType)
{ {
var tempvalue = tempNode.nodeValue; var tempvalue = tempNode.nodeValue;
if(tempvalue && -1 != tempvalue.indexOf("endif")) if(tempvalue && -1 !== tempvalue.indexOf("endif"))
break; break;
} }
} }
...@@ -6901,10 +6898,10 @@ PasteProcessor.prototype = ...@@ -6901,10 +6898,10 @@ PasteProcessor.prototype =
} }
var sChildNodeName = child.nodeName.toLowerCase(); var sChildNodeName = child.nodeName.toLowerCase();
if(!(Node.ELEMENT_NODE == nodeType || Node.TEXT_NODE == nodeType) || sChildNodeName === "style" || sChildNodeName === "#comment" || sChildNodeName === "script") if(!(Node.ELEMENT_NODE === nodeType || Node.TEXT_NODE === nodeType) || sChildNodeName === "style" || sChildNodeName === "#comment" || sChildNodeName === "script")
continue; continue;
//�������� ������� ��������� ������ �� \t,\n,\r //�������� ������� ��������� ������ �� \t,\n,\r
if( Node.TEXT_NODE == child.nodeType) if( Node.TEXT_NODE === child.nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
if(!value) if(!value)
...@@ -6924,7 +6921,7 @@ PasteProcessor.prototype = ...@@ -6924,7 +6921,7 @@ PasteProcessor.prototype =
var oOldHyperlink = null; var oOldHyperlink = null;
var oOldHyperlinkContentPos = null; var oOldHyperlinkContentPos = null;
var oHyperlink = null; var oHyperlink = null;
if("a" == sChildNodeName) if("a" === sChildNodeName)
{ {
var href = child.href; var href = child.href;
if(null != href) if(null != href)
...@@ -6963,7 +6960,7 @@ PasteProcessor.prototype = ...@@ -6963,7 +6960,7 @@ PasteProcessor.prototype =
bAddParagraph = this._Execute(child, Common_CopyObj(pPr), false, bAddParagraph, bIsBlockChild || bInBlock); bAddParagraph = this._Execute(child, Common_CopyObj(pPr), false, bAddParagraph, bIsBlockChild || bInBlock);
if(bIsBlockChild) if(bIsBlockChild)
bAddParagraph = true; bAddParagraph = true;
if ("a" == sChildNodeName && null != oHyperlink) { if ("a" === sChildNodeName && null != oHyperlink) {
this.oCurHyperlink = oOldHyperlink; this.oCurHyperlink = oOldHyperlink;
this.oCurHyperlinkContentPos = oOldHyperlinkContentPos; this.oCurHyperlinkContentPos = oOldHyperlinkContentPos;
if(oHyperlink.Content.length > 0) if(oHyperlink.Content.length > 0)
...@@ -6985,7 +6982,7 @@ PasteProcessor.prototype = ...@@ -6985,7 +6982,7 @@ PasteProcessor.prototype =
for(var k = 0; k < oHyperlink.Content.length; k++) for(var k = 0; k < oHyperlink.Content.length; k++)
{ {
if(oHyperlink.Content[k].Type == para_Run) if(oHyperlink.Content[k].Type === para_Run)
oHyperlink.Content[k].Set_RStyle(hyperLinkStyle); oHyperlink.Content[k].Set_RStyle(hyperLinkStyle);
} }
} }
...@@ -7017,7 +7014,7 @@ PasteProcessor.prototype = ...@@ -7017,7 +7014,7 @@ PasteProcessor.prototype =
var shape = arrShapes[arrShapes.length - 1]; var shape = arrShapes[arrShapes.length - 1];
this.aContent = shape.txBody.content.Content; this.aContent = shape.txBody.content.Content;
if(true == bRoot) if(true === bRoot)
{ {
//���� ������� ��������� ���, �� �������� ���� //���� ������� ��������� ���, �� �������� ����
var bExist = false; var bExist = false;
...@@ -7025,21 +7022,21 @@ PasteProcessor.prototype = ...@@ -7025,21 +7022,21 @@ PasteProcessor.prototype =
{ {
var child = node.childNodes[i]; var child = node.childNodes[i];
var bIsBlockChild = this._IsBlockElem(child.nodeName.toLowerCase()); var bIsBlockChild = this._IsBlockElem(child.nodeName.toLowerCase());
if(true == bIsBlockChild) if(true === bIsBlockChild)
{ {
bRootHasBlock = true; bRootHasBlock = true;
bExist = true; bExist = true;
break; break;
} }
} }
if(false == bExist && true == this.bIgnoreNoBlockText) if(false === bExist && true === this.bIgnoreNoBlockText)
this.bIgnoreNoBlockText = false; this.bIgnoreNoBlockText = false;
} }
else else
{ {
if(Node.TEXT_NODE == node.nodeType) if(Node.TEXT_NODE === node.nodeType)
{ {
if(false == this.bIgnoreNoBlockText || true == bInBlock) if(false === this.bIgnoreNoBlockText || true === bInBlock)
{ {
var value = node.nodeValue; var value = node.nodeValue;
if(!value) if(!value)
...@@ -7077,9 +7074,9 @@ PasteProcessor.prototype = ...@@ -7077,9 +7074,9 @@ PasteProcessor.prototype =
} }
else else
nUnicode = nCharCode; nUnicode = nCharCode;
if (null != nUnicode) { if (null !== nUnicode) {
var Item; var Item;
if (0x20 != nUnicode && 0xA0 != nUnicode && 0x2009 != nUnicode) { if (0x20 !== nUnicode && 0xA0 !== nUnicode && 0x2009 !== nUnicode) {
Item = new ParaText(); Item = new ParaText();
Item.Value = nUnicode; Item.Value = nUnicode;
} }
...@@ -7094,7 +7091,7 @@ PasteProcessor.prototype = ...@@ -7094,7 +7091,7 @@ PasteProcessor.prototype =
return; return;
} }
var sNodeName = node.nodeName.toLowerCase(); var sNodeName = node.nodeName.toLowerCase();
if("table" == sNodeName) if("table" === sNodeName)
{ {
this._StartExecuteTablePresentation(node, pPr, arrShapes, arrImages, arrTables); this._StartExecuteTablePresentation(node, pPr, arrShapes, arrImages, arrTables);
return; return;
...@@ -7105,39 +7102,39 @@ PasteProcessor.prototype = ...@@ -7105,39 +7102,39 @@ PasteProcessor.prototype =
if(style) if(style)
this._parseCss(style, pPr); this._parseCss(style, pPr);
if("h1" == sNodeName) if("h1" === sNodeName)
pPr.hLevel = 0; pPr.hLevel = 0;
else if("h2" == sNodeName) else if("h2" === sNodeName)
pPr.hLevel = 1; pPr.hLevel = 1;
else if("h3" == sNodeName) else if("h3" === sNodeName)
pPr.hLevel = 2; pPr.hLevel = 2;
else if("h4" == sNodeName) else if("h4" === sNodeName)
pPr.hLevel = 3; pPr.hLevel = 3;
else if("h5" == sNodeName) else if("h5" === sNodeName)
pPr.hLevel = 4; pPr.hLevel = 4;
else if("h6" == sNodeName) else if("h6" === sNodeName)
pPr.hLevel = 5; pPr.hLevel = 5;
if("ul" == sNodeName || "ol" == sNodeName || "li" == sNodeName) if("ul" === sNodeName || "ol" === sNodeName || "li" === sNodeName)
{ {
pPr.bNum = true; pPr.bNum = true;
if(PasteElementsId.g_bIsDocumentCopyPaste) if(PasteElementsId.g_bIsDocumentCopyPaste)
{ {
if("ul" == sNodeName) if("ul" === sNodeName)
pPr.numType = numbering_numfmt_Bullet; pPr.numType = numbering_numfmt_Bullet;
else if("ol" == sNodeName) else if("ol" === sNodeName)
pPr.numType = numbering_numfmt_Decimal; pPr.numType = numbering_numfmt_Decimal;
} }
else else
{ {
if("ul" == sNodeName) if("ul" === sNodeName)
pPr.numType = numbering_presentationnumfrmt_Char; pPr.numType = numbering_presentationnumfrmt_Char;
else if("ol" == sNodeName) else if("ol" === sNodeName)
pPr.numType = numbering_presentationnumfrmt_ArabicPeriod; pPr.numType = numbering_presentationnumfrmt_ArabicPeriod;
} }
} }
if("img" == sNodeName) if("img" === sNodeName)
{ {
//bAddParagraph = this._Decide_AddParagraph(node, pPr, bAddParagraph); //bAddParagraph = this._Decide_AddParagraph(node, pPr, bAddParagraph);
...@@ -7182,9 +7179,9 @@ PasteProcessor.prototype = ...@@ -7182,9 +7179,9 @@ PasteProcessor.prototype =
} }
//��������� linebreak, ���� �� �� ��������� ������� �������� � �� ����� ��� ������� ������� //��������� linebreak, ���� �� �� ��������� ������� �������� � �� ����� ��� ������� �������
if("br" == sNodeName || "always" == node.style.pageBreakBefore) if("br" === sNodeName || "always" === node.style.pageBreakBefore)
{ {
if("always" == node.style.pageBreakBefore) if("always" === node.style.pageBreakBefore)
{ {
shape.paragraphAdd(new ParaNewLine( break_Line )); shape.paragraphAdd(new ParaNewLine( break_Line ));
} }
...@@ -7195,7 +7192,7 @@ PasteProcessor.prototype = ...@@ -7195,7 +7192,7 @@ PasteProcessor.prototype =
} }
//�������� �� tab //�������� �� tab
if("span" == sNodeName) if("span" === sNodeName)
{ {
var nTabCount = parseInt(pPr["mso-tab-count"] || 0); var nTabCount = parseInt(pPr["mso-tab-count"] || 0);
if(nTabCount > 0) if(nTabCount > 0)
...@@ -7219,22 +7216,22 @@ PasteProcessor.prototype = ...@@ -7219,22 +7216,22 @@ PasteProcessor.prototype =
var nodeType = child.nodeType; var nodeType = child.nodeType;
//��� ����������� �� word ����� ����������� ����������� �� ������� //��� ����������� �� word ����� ����������� ����������� �� �������
//����������� ����������, ������ ������ ������ //����������� ����������, ������ ������ ������
if(Node.COMMENT_NODE == nodeType) if(Node.COMMENT_NODE === nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
var bSkip = false; var bSkip = false;
if(value) if(value)
{ {
if(-1 != value.indexOf("supportLists")) if(-1 !== value.indexOf("supportLists"))
{ {
//todo ���������� ��� ������ //todo ���������� ��� ������
pPr.bNum = true; pPr.bNum = true;
bSkip = true; bSkip = true;
} }
if(-1 != value.indexOf("supportLineBreakNewLine")) if(-1 !== value.indexOf("supportLineBreakNewLine"))
bSkip = true; bSkip = true;
} }
if(true == bSkip) if(true === bSkip)
{ {
//���������� ��� �� �������������� ����������� //���������� ��� �� �������������� �����������
var j = i + 1; var j = i + 1;
...@@ -7242,10 +7239,10 @@ PasteProcessor.prototype = ...@@ -7242,10 +7239,10 @@ PasteProcessor.prototype =
{ {
var tempNode = node.childNodes[j]; var tempNode = node.childNodes[j];
var tempNodeType = tempNode.nodeType; var tempNodeType = tempNode.nodeType;
if(Node.COMMENT_NODE == tempNodeType) if(Node.COMMENT_NODE === tempNodeType)
{ {
var tempvalue = tempNode.nodeValue; var tempvalue = tempNode.nodeValue;
if(tempvalue && -1 != tempvalue.indexOf("endif")) if(tempvalue && -1 !== tempvalue.indexOf("endif"))
break; break;
} }
} }
...@@ -7254,10 +7251,10 @@ PasteProcessor.prototype = ...@@ -7254,10 +7251,10 @@ PasteProcessor.prototype =
} }
} }
if(!(Node.ELEMENT_NODE == nodeType || Node.TEXT_NODE == nodeType)) if(!(Node.ELEMENT_NODE === nodeType || Node.TEXT_NODE === nodeType))
continue; continue;
//�������� ������� ��������� ������ �� \t,\n,\r //�������� ������� ��������� ������ �� \t,\n,\r
if( Node.TEXT_NODE == child.nodeType) if( Node.TEXT_NODE === child.nodeType)
{ {
var value = child.nodeValue; var value = child.nodeValue;
if(!value) if(!value)
...@@ -7278,7 +7275,7 @@ PasteProcessor.prototype = ...@@ -7278,7 +7275,7 @@ PasteProcessor.prototype =
var bHyperlink = false; var bHyperlink = false;
var isPasteHyperlink = null; var isPasteHyperlink = null;
if("a" == sChildNodeName) if("a" === sChildNodeName)
{ {
var href = child.href; var href = child.href;
if(null != href) if(null != href)
...@@ -7296,7 +7293,7 @@ PasteProcessor.prototype = ...@@ -7296,7 +7293,7 @@ PasteProcessor.prototype =
this.oDocument = shape.txBody.content; this.oDocument = shape.txBody.content;
var Pos = ( true == this.oDocument.Selection.Use ? this.oDocument.Selection.StartPos : this.oDocument.CurPos.ContentPos ); var Pos = ( true === this.oDocument.Selection.Use ? this.oDocument.Selection.StartPos : this.oDocument.CurPos.ContentPos );
isPasteHyperlink = node.getElementsByTagName('img'); isPasteHyperlink = node.getElementsByTagName('img');
var text = null; var text = null;
...@@ -7335,7 +7332,7 @@ PasteProcessor.prototype = ...@@ -7335,7 +7332,7 @@ PasteProcessor.prototype =
//���� ���� ���� tbody //���� ���� ���� tbody
for(var i = 0, length = node.childNodes.length; i < length; ++i) for(var i = 0, length = node.childNodes.length; i < length; ++i)
{ {
if("tbody" == node.childNodes[i].nodeName.toLowerCase()) if("tbody" === node.childNodes[i].nodeName.toLowerCase())
{ {
node = node.childNodes[i]; node = node.childNodes[i];
break; break;
...@@ -7366,7 +7363,7 @@ PasteProcessor.prototype = ...@@ -7366,7 +7363,7 @@ PasteProcessor.prototype =
for(var i = 0, length = node.childNodes.length; i < length; ++i) for(var i = 0, length = node.childNodes.length; i < length; ++i)
{ {
var tr = node.childNodes[i]; var tr = node.childNodes[i];
if("tr" == tr.nodeName.toLowerCase()) if("tr" === tr.nodeName.toLowerCase())
{ {
nCurSum = 0; nCurSum = 0;
nCurColWidth = 0; nCurColWidth = 0;
...@@ -7375,7 +7372,7 @@ PasteProcessor.prototype = ...@@ -7375,7 +7372,7 @@ PasteProcessor.prototype =
{ {
var tc = tr.childNodes[j]; var tc = tr.childNodes[j];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
fParseSpans(); fParseSpans();
...@@ -7423,7 +7420,7 @@ PasteProcessor.prototype = ...@@ -7423,7 +7420,7 @@ PasteProcessor.prototype =
{ {
var tc = tr.childNodes[j]; var tc = tr.childNodes[j];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
var nCurRowSpan = tc.getAttribute("rowspan"); var nCurRowSpan = tc.getAttribute("rowspan");
if(null != nCurRowSpan) if(null != nCurRowSpan)
...@@ -7434,7 +7431,7 @@ PasteProcessor.prototype = ...@@ -7434,7 +7431,7 @@ PasteProcessor.prototype =
if(dMaxSum < nCurSum) if(dMaxSum < nCurSum)
dMaxSum = nCurSum; dMaxSum = nCurSum;
//������� ������ tr //������� ������ tr
if(0 == nCurColWidth) if(0 === nCurColWidth)
{ {
node.removeChild(tr); node.removeChild(tr);
length--; length--;
...@@ -7442,7 +7439,7 @@ PasteProcessor.prototype = ...@@ -7442,7 +7439,7 @@ PasteProcessor.prototype =
} }
else else
{ {
if(0 == nMinColCount || nMinColCount > nCurColWidth) if(0 === nMinColCount || nMinColCount > nCurColWidth)
nMinColCount = nCurColWidth; nMinColCount = nCurColWidth;
if(nMaxColCount < nCurColWidth) if(nMaxColCount < nCurColWidth)
nMaxColCount = nCurColWidth; nMaxColCount = nCurColWidth;
...@@ -7479,7 +7476,7 @@ PasteProcessor.prototype = ...@@ -7479,7 +7476,7 @@ PasteProcessor.prototype =
if(null != nPrevIndex) if(null != nPrevIndex)
{ {
var nDif = nCurIndex - nPrevIndex; var nDif = nCurIndex - nPrevIndex;
if(1 == nDif) if(1 === nDif)
aGrid.push(nCurWidth); aGrid.push(nCurWidth);
else else
{ {
...@@ -7531,7 +7528,7 @@ PasteProcessor.prototype = ...@@ -7531,7 +7528,7 @@ PasteProcessor.prototype =
var sTableAlign = null; var sTableAlign = null;
if(null != tableNode.align) if(null != tableNode.align)
sTableAlign = tableNode.align sTableAlign = tableNode.align
else if(null != tableNode.parentNode && this.oRootNode != tableNode.parentNode) else if(null != tableNode.parentNode && this.oRootNode !== tableNode.parentNode)
{ {
var computedStyleParent = this._getComputedStyle(tableNode.parentNode); var computedStyleParent = this._getComputedStyle(tableNode.parentNode);
if(null != computedStyleParent) if(null != computedStyleParent)
...@@ -7542,9 +7539,9 @@ PasteProcessor.prototype = ...@@ -7542,9 +7539,9 @@ PasteProcessor.prototype =
} }
if(null != sTableAlign) if(null != sTableAlign)
{ {
if(-1 != sTableAlign.indexOf('center')) if(-1 !== sTableAlign.indexOf('center'))
table.Set_TableAlign(align_Center); table.Set_TableAlign(align_Center);
else if(-1 != sTableAlign.indexOf('right')) else if(-1 !== sTableAlign.indexOf('right'))
table.Set_TableAlign(align_Right); table.Set_TableAlign(align_Right);
} }
var spacing = null; var spacing = null;
...@@ -7564,7 +7561,7 @@ PasteProcessor.prototype = ...@@ -7564,7 +7561,7 @@ PasteProcessor.prototype =
{ {
padding = trimString(padding); padding = trimString(padding);
var aMargins = padding.split(" "); var aMargins = padding.split(" ");
if(4 == aMargins.length) if(4 === aMargins.length)
{ {
var top = aMargins[0]; var top = aMargins[0];
if(null != top && null != (top = this._ValueToMm(top))) if(null != top && null != (top = this._ValueToMm(top)))
...@@ -7599,7 +7596,7 @@ PasteProcessor.prototype = ...@@ -7599,7 +7596,7 @@ PasteProcessor.prototype =
var computedStyle = this._getComputedStyle(tableNode); var computedStyle = this._getComputedStyle(tableNode);
if(computedStyle) if(computedStyle)
{ {
if(align_Left == table.Get_TableAlign()) if(align_Left === table.Get_TableAlign())
{ {
var margin_left = computedStyle.getPropertyValue( "margin-left" ); var margin_left = computedStyle.getPropertyValue( "margin-left" );
//todo возможно надо еще учесть ширину таблицы //todo возможно надо еще учесть ширину таблицы
...@@ -7639,7 +7636,7 @@ PasteProcessor.prototype = ...@@ -7639,7 +7636,7 @@ PasteProcessor.prototype =
for(var i = 0, length = node.childNodes.length; i < length; ++i) for(var i = 0, length = node.childNodes.length; i < length; ++i)
{ {
var tr = node.childNodes[i]; var tr = node.childNodes[i];
if("tr" == tr.nodeName.toLowerCase() && tr.children.length !== 0)//в случае, если внутри строки нет ни одной ячейки, не добавляем данную строку if("tr" === tr.nodeName.toLowerCase() && tr.children.length !== 0)//в случае, если внутри строки нет ни одной ячейки, не добавляем данную строку
{ {
var row = table.Internal_Add_Row(table.Content.length, 0); var row = table.Internal_Add_Row(table.Content.length, 0);
this._ExecuteTableRowPresentation(tr, row, aSumGrid, spacing, oRowSpans, bUseScaleKoef, dScaleKoef, arrShapes, arrImages, arrTables); this._ExecuteTableRowPresentation(tr, row, aSumGrid, spacing, oRowSpans, bUseScaleKoef, dScaleKoef, arrShapes, arrImages, arrTables);
...@@ -7655,7 +7652,7 @@ PasteProcessor.prototype = ...@@ -7655,7 +7652,7 @@ PasteProcessor.prototype =
if(node.style.height) if(node.style.height)
{ {
var height = node.style.height; var height = node.style.height;
if(!("auto" == height || "inherit" == height || -1 != height.indexOf("%")) && null != (height = this._ValueToMm(height))) if(!("auto" === height || "inherit" === height || -1 !== height.indexOf("%")) && null != (height = this._ValueToMm(height)))
row.Set_Height(height, Asc.linerule_AtLeast); row.Set_Height(height, Asc.linerule_AtLeast);
} }
var bBefore = false; var bBefore = false;
...@@ -7700,7 +7697,7 @@ PasteProcessor.prototype = ...@@ -7700,7 +7697,7 @@ PasteProcessor.prototype =
{ {
var tc = node.childNodes[i]; var tc = node.childNodes[i];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
if(bBefore && null != oBeforeCell) if(bBefore && null != oBeforeCell)
oBeforeCell = tc; oBeforeCell = tc;
...@@ -7716,16 +7713,16 @@ PasteProcessor.prototype = ...@@ -7716,16 +7713,16 @@ PasteProcessor.prototype =
var tc = node.childNodes[i]; var tc = node.childNodes[i];
var tcName = tc.nodeName.toLowerCase(); var tcName = tc.nodeName.toLowerCase();
if("td" == tcName || "th" == tcName) if("td" === tcName || "th" === tcName)
{ {
var nColSpan = tc.getAttribute("colspan"); var nColSpan = tc.getAttribute("colspan");
if(null != nColSpan) if(null != nColSpan)
nColSpan = nColSpan - 0; nColSpan = nColSpan - 0;
else else
nColSpan = 1; nColSpan = 1;
if(tc == oBeforeCell) if(tc === oBeforeCell)
row.Set_Before(nColSpan); row.Set_Before(nColSpan);
else if(tc == oAfterCell) else if(tc === oAfterCell)
row.Set_After(nColSpan); row.Set_After(nColSpan);
else else
{ {
...@@ -7769,13 +7766,13 @@ PasteProcessor.prototype = ...@@ -7769,13 +7766,13 @@ PasteProcessor.prototype =
var border = this._ExecuteBorder(computedStyle, node, "left", "Left", bAddIfNull, true); var border = this._ExecuteBorder(computedStyle, node, "left", "Left", bAddIfNull, true);
if(null != border) if(null != border)
cell.Set_Border(border, 3); cell.Set_Border(border, 3);
var border = this._ExecuteBorder(computedStyle, node, "top", "Top", bAddIfNull, true); border = this._ExecuteBorder(computedStyle, node, "top", "Top", bAddIfNull, true);
if(null != border) if(null != border)
cell.Set_Border(border, 0); cell.Set_Border(border, 0);
var border = this._ExecuteBorder(computedStyle, node, "right", "Right", bAddIfNull, true); border = this._ExecuteBorder(computedStyle, node, "right", "Right", bAddIfNull, true);
if(null != border) if(null != border)
cell.Set_Border(border, 1); cell.Set_Border(border, 1);
var border = this._ExecuteBorder(computedStyle, node, "bottom", "Bottom", bAddIfNull, true); border = this._ExecuteBorder(computedStyle, node, "bottom", "Bottom", bAddIfNull, true);
if(null != border) if(null != border)
cell.Set_Border(border, 2); cell.Set_Border(border, 2);
...@@ -7808,7 +7805,7 @@ PasteProcessor.prototype = ...@@ -7808,7 +7805,7 @@ PasteProcessor.prototype =
//��������� ����� ��������� //��������� ����� ���������
for(var i = 0, length = content.Content.length; i < length; ++i) for(var i = 0, length = content.Content.length; i < length; ++i)
{ {
if(i == length - 1) if(i === length - 1)
cell.Content.Internal_Content_Add(i + 1, content.Content[i], true); cell.Content.Internal_Content_Add(i + 1, content.Content[i], true);
else else
cell.Content.Internal_Content_Add(i + 1, content.Content[i], false); cell.Content.Internal_Content_Add(i + 1, content.Content[i], false);
...@@ -7919,7 +7916,7 @@ function Check_LoadingDataBeforePrepaste(_api, _fonts, _images, _callback) ...@@ -7919,7 +7916,7 @@ function Check_LoadingDataBeforePrepaste(_api, _fonts, _images, _callback)
for (var font_family in _fonts) for (var font_family in _fonts)
{ {
aPrepeareFonts.push(new CFont(font_family, 0, "", 0)); aPrepeareFonts.push(new CFont(font_family, 0, "", 0));
}; }
var isDesktopEditor = (window["AscDesktopEditor"] !== undefined) ? true : false; var isDesktopEditor = (window["AscDesktopEditor"] !== undefined) ? true : false;
var isDesktopEditorLocal = false; var isDesktopEditorLocal = false;
......
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