Commit 07966d34 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

правка для фоновых цветов таблицы при вставке из word

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55779 954022d7-b5bf-4e40-9824-e11837661b57
parent e3e74f5f
...@@ -3233,7 +3233,7 @@ ...@@ -3233,7 +3233,7 @@
this.aResult[row + activeRange.r1][col + activeRange.c1][0].colSpan = colSpan; this.aResult[row + activeRange.r1][col + activeRange.c1][0].colSpan = colSpan;
//backgroundColor //backgroundColor
backgroundColor = this.getBackgroundColorTCell(childrens[i].elem); backgroundColor = this.getBackgroundColorTCell(childrens[i]);
if(backgroundColor) if(backgroundColor)
this.aResult[row + activeRange.r1][col + activeRange.c1][0].bc = backgroundColor; this.aResult[row + activeRange.r1][col + activeRange.c1][0].bc = backgroundColor;
...@@ -3248,7 +3248,7 @@ ...@@ -3248,7 +3248,7 @@
var colSpan = null; var colSpan = null;
var rowSpan = null; var rowSpan = null;
this._parseParagraph(childrens[i].elem, activeRange, childrens[i].top + activeRange.r1, childrens[i].left + activeRange.c1); this._parseParagraph(childrens[i], activeRange, childrens[i].top + activeRange.r1, childrens[i].left + activeRange.c1);
} }
else else
this._parseChildren(childrens[i], activeRange); this._parseChildren(childrens[i], activeRange);
...@@ -3306,7 +3306,7 @@ ...@@ -3306,7 +3306,7 @@
_parseParagraph: function(paragraph, activeRange, row, col, rowSpan, colSpan) _parseParagraph: function(paragraph, activeRange, row, col, rowSpan, colSpan)
{ {
var content = paragraph.Content; var content = paragraph.elem.Content;
var row, cTextPr, fontFamily = "Arial"; var row, cTextPr, fontFamily = "Arial";
var text = null; var text = null;
var oNewItem = [], cloneNewItem; var oNewItem = [], cloneNewItem;
...@@ -3347,27 +3347,27 @@ ...@@ -3347,27 +3347,27 @@
oNewItem.bc = backgroundColor; oNewItem.bc = backgroundColor;
//настройки параграфа //настройки параграфа
paragraph.CompiledPr.NeedRecalc = true; paragraph.elem.CompiledPr.NeedRecalc = true;
var paraPr = paragraph.Get_CompiledPr(); var paraPr = paragraph.elem.Get_CompiledPr();
var paragraphFontFamily = paraPr.TextPr.FontFamily.Name; var paragraphFontFamily = paraPr.TextPr.FontFamily.Name;
//Numbering //Numbering
var LvlPr = null; var LvlPr = null;
var Lvl = null; var Lvl = null;
var oNumPr = paragraph.Numbering_Get(); var oNumPr = paragraph.elem.Numbering_Get();
var numberingText = null; var numberingText = null;
var formatText; var formatText;
if(oNumPr != null) if(oNumPr != null)
{ {
var aNum = paragraph.Parent.Numbering.Get_AbstractNum( oNumPr.NumId ); var aNum = paragraph.elem.Parent.Numbering.Get_AbstractNum( oNumPr.NumId );
if(null != aNum) if(null != aNum)
{ {
LvlPr = aNum.Lvl[oNumPr.Lvl]; LvlPr = aNum.Lvl[oNumPr.Lvl];
Lvl = oNumPr.Lvl; Lvl = oNumPr.Lvl;
}; };
numberingText = this._parseNumbering(paragraph); numberingText = this._parseNumbering(paragraph.elem);
if(text == null) if(text == null)
text = ""; text = "";
...@@ -3433,17 +3433,12 @@ ...@@ -3433,17 +3433,12 @@
var compiledPrCell, color; var compiledPrCell, color;
var backgroundColor = null; var backgroundColor = null;
var tableCell; //TODO внутреннии таблицы без стиля - цвет фона белый
if(elem && elem instanceof CTableCell) var tableCell = this._getParentByTag(elem, c_oAscBoundsElementType.Cell);
tableCell = elem;
else if(elem && elem.Parent && elem.Parent instanceof CTableCell)
tableCell = elem.Parent;
else if(elem.Parent && elem.Parent.Parent && elem.Parent.Parent instanceof CTableCell)
tableCell = elem.Parent.Parent;
if(tableCell) if(tableCell)
{ {
compiledPrCell = tableCell.Get_CompiledPr(); compiledPrCell = tableCell.elem.Get_CompiledPr();
if(compiledPrCell) if(compiledPrCell)
{ {
...@@ -3455,6 +3450,22 @@ ...@@ -3455,6 +3450,22 @@
return backgroundColor; return backgroundColor;
}, },
_getParentByTag: function(elem, tag)
{
var result;
if(!elem)
return null;
if(elem.type == tag)
result = elem;
else if(elem.parent)
result = this._getParentByTag(elem.parent, tag);
else if(!elem.parent)
result = null;
return result;
},
_parseParaRun: function(paraRun, oNewItem, paraPr, s, row, c1, text) _parseParaRun: function(paraRun, oNewItem, paraPr, s, row, c1, text)
{ {
var paraRunContent = paraRun.Content; var paraRunContent = paraRun.Content;
......
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