Commit 820c2456 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug #31860 - [Copy&Paste] Обрезается графический объект, скопированный из PE,...

Bug #31860 - [Copy&Paste] Обрезается графический объект, скопированный из PE, если он выходил за пределы канвы;
Поправлено падение при генерации preview textArt в пустой презентации

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68718 954022d7-b5bf-4e40-9824-e11837661b57
parent dd1eaa1e
......@@ -673,6 +673,10 @@ TextArtPreviewManager.prototype.getCanvas = function()
TextArtPreviewManager.prototype.getShapeByPrst = function(prst)
{
var oShape = this.getShape();
if(!oShape)
{
return null;
}
var oContent = oShape.getDocContent();
var textStr = "abcde";
......@@ -831,12 +835,19 @@ TextArtPreviewManager.prototype.getShape = function()
}
else
{
if(editor && editor.WordControl && editor.WordControl.m_oLogicDocument.Slides && editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage])
if(editor && editor.WordControl && Array.isArray(editor.WordControl.m_oLogicDocument.Slides))
{
if(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage])
{
oShape.setParent(editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage]);
oParent = editor.WordControl.m_oLogicDocument.Slides[editor.WordControl.m_oLogicDocument.CurPage];
bWord = false;
}
else
{
return null;
}
}
}
var oParentObjects = oShape.getParentObjects();
var oTrack = new NewShapeTrack("textRect", 0, 0, oParentObjects.theme, oParentObjects.master, oParentObjects.layout, oParentObjects.slide, 0);
......@@ -879,6 +890,10 @@ TextArtPreviewManager.prototype.getTAShape = function()
if(!this.TAShape)
{
var oShape = this.getShape();
if(!oShape)
{
return null;
}
var oContent = oShape.getDocContent();
var sText = "Ta";
var oParagraph = oContent.Content[0];
......@@ -902,6 +917,10 @@ TextArtPreviewManager.prototype.getWordArtPreview = function(prst)
var ctx = _canvas.getContext('2d');
var graphics = new CGraphics();
var oShape = this.getShapeByPrst(prst);
if(!oShape)
{
return "";
}
graphics.init(ctx, _canvas.width, _canvas.height, oShape.extX, oShape.extY);
graphics.m_oFontManager = g_fontManager;
graphics.transform(1,0,0,1,0,0);
......@@ -933,6 +952,11 @@ TextArtPreviewManager.prototype.generateTextArtStyles = function()
var ctx = _canvas.getContext('2d');
var graphics = new CGraphics();
var oShape = this.getTAShape();
if(!oShape)
{
this.TextArtStyles.length = 0;
return;
}
oShape.recalculate();
graphics.m_oFontManager = g_fontManager;
......
......@@ -3521,14 +3521,6 @@
}
};
if(startRow < 0)
{
startRow = 0;
}
if(startCol < 0)
{
startCol = 0;
}
for(var i = 0; i < data.Drawings.length; i++)
{
......
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