Commit eac45c1e authored by GoshaZotov's avatar GoshaZotov

== -> === + refactoring

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