Commit 358fbf28 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

баги в текстартах

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63793 954022d7-b5bf-4e40-9824-e11837661b57
parent 79938f2f
...@@ -9347,7 +9347,7 @@ function CreatePrstTxWarpGeometry(prst) ...@@ -9347,7 +9347,7 @@ function CreatePrstTxWarpGeometry(prst)
f.AddHandlePolar('adj1', '0', '21599999', 'adj2', '0', '100000', 'x2', 'y2'); f.AddHandlePolar('adj1', '0', '21599999', 'adj2', '0', '100000', 'x2', 'y2');
f.AddPathCommand(0, false, 'none', undefined, undefined, undefined); f.AddPathCommand(0, false, 'none', undefined, undefined, undefined);
f.AddPathCommand(1, 'x1', 'y1'); f.AddPathCommand(1, 'x1', 'y1');
f.AddPathCommand(3, 'wd2', 'y1', 'adval', 'swAng'); f.AddPathCommand(3, 'wd2', 'hd2', 'adval', 'swAng');
f.AddPathCommand(0, false, 'none', undefined, undefined, undefined); f.AddPathCommand(0, false, 'none', undefined, undefined, undefined);
f.AddPathCommand(1, 'x2', 'y2'); f.AddPathCommand(1, 'x2', 'y2');
f.AddPathCommand(3, 'iwd2', 'ihd2', 'adval', 'swAng'); f.AddPathCommand(3, 'iwd2', 'ihd2', 'adval', 'swAng');
......
...@@ -280,7 +280,7 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent) ...@@ -280,7 +280,7 @@ function ConvertParagraphToPPTX(paragraph, drawingDocument, newParent)
oNewEndPr.Unifill = oNewEndPr.TextFill; oNewEndPr.Unifill = oNewEndPr.TextFill;
oNewEndPr.TextFill = undefined; oNewEndPr.TextFill = undefined;
} }
new_paragraph.TextPr.Set_Value( paragraph.TextPr.Value ); new_paragraph.TextPr.Set_Value( oNewEndPr );
new_paragraph.Internal_Content_Remove2(0, new_paragraph.Content.length); new_paragraph.Internal_Content_Remove2(0, new_paragraph.Content.length);
var Count = paragraph.Content.length; var Count = paragraph.Content.length;
for ( var Index = 0; Index < Count; Index++ ) for ( var Index = 0; Index < Count; Index++ )
...@@ -3660,7 +3660,8 @@ CShape.prototype = ...@@ -3660,7 +3660,8 @@ CShape.prototype =
else else
{ {
var bNeedRestoreState = false; var bNeedRestoreState = false;
if(this.bWordShape && this.clipRect && (!this.bodyPr.prstTxWarp || this.bodyPr.prstTxWarp.preset === "textNoShape")) var bEditTextArt = isRealObject(oController) && (getTargetTextObject(oController) === this);
if(this.bWordShape && this.clipRect && (!this.bodyPr.prstTxWarp || this.bodyPr.prstTxWarp.preset === "textNoShape" || bEditTextArt))
{ {
bNeedRestoreState = true; bNeedRestoreState = true;
var clip_rect = this.clipRect; var clip_rect = this.clipRect;
...@@ -3680,7 +3681,6 @@ CShape.prototype = ...@@ -3680,7 +3681,6 @@ CShape.prototype =
} }
} }
var bEditTextArt = isRealObject(oController) && (getTargetTextObject(oController) === this);
var oTransform = this.transformTextWordArt; var oTransform = this.transformTextWordArt;
if(editor && editor.ShowParaMarks) if(editor && editor.ShowParaMarks)
{ {
...@@ -4951,8 +4951,9 @@ CShape.prototype = ...@@ -4951,8 +4951,9 @@ CShape.prototype =
var bNeedRecalc = oBodyPr.prstTxWarp && (oBodyPr.prstTxWarp.pathLst.length / 2 - ((oBodyPr.prstTxWarp.pathLst.length / 2) >> 0) > 0) , dOneLineWidth, dMinPolygonLength = 0, dKoeff = 1; var bNeedRecalc = oBodyPr.prstTxWarp && (oBodyPr.prstTxWarp.pathLst.length / 2 - ((oBodyPr.prstTxWarp.pathLst.length / 2) >> 0) > 0) , dOneLineWidth, dMinPolygonLength = 0, dKoeff = 1;
var oTheme = this.Get_Theme(), oColorMap = this.Get_ColorMap(); var oTheme = this.Get_Theme(), oColorMap = this.Get_ColorMap();
var oTextDrawer = new CTextDrawer(dWidth, dHeight, true, oTheme, bNeedRecalc); var oTextDrawer = new CTextDrawer(dWidth, dHeight, true, oTheme, bNeedRecalc);
oTextDrawer.bCheckLines = bTransform && bNeedWarp;
var oContentToDraw = oContent; var oContentToDraw = oContent;
if(bNeedRecalc) if(bNeedRecalc && bNeedWarp)
{ {
oContentToDraw = oContent.Copy(oContent.Parent, oContent.DrawingDocument); oContentToDraw = oContent.Copy(oContent.Parent, oContent.DrawingDocument);
var bNeedTurnOn = false; var bNeedTurnOn = false;
...@@ -5001,9 +5002,9 @@ CShape.prototype = ...@@ -5001,9 +5002,9 @@ CShape.prototype =
oRet.oTxWarpStructParamarks.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff); oRet.oTxWarpStructParamarks.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
if(bNeedNoTransform && bCheckWordArtContent) if(bNeedNoTransform && bCheckWordArtContent)
{ {
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer); oContent.Draw(oContent.StartPage, oTextDrawer);
oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure; oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this); oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, dWidth, dHeight, this);
oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths(); oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths();
} }
} }
...@@ -5020,9 +5021,9 @@ CShape.prototype = ...@@ -5020,9 +5021,9 @@ CShape.prototype =
{ {
if(bNeedNoTransform && bCheckWordArtContent) if(bNeedNoTransform && bCheckWordArtContent)
{ {
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer); oContent.Draw(oContent.StartPage, oTextDrawer);
oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure; oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this); oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, dWidth, dHeight, this);
oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths(); oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths();
} }
} }
...@@ -5041,9 +5042,9 @@ CShape.prototype = ...@@ -5041,9 +5042,9 @@ CShape.prototype =
oRet.oTxWarpStruct.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff); oRet.oTxWarpStruct.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
if(bNeedNoTransform && bCheckWordArtContent) if(bNeedNoTransform && bCheckWordArtContent)
{ {
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer); oContent.Draw(oContent.StartPage, oTextDrawer);
oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure; oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this); oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, dWidth, dHeight, this);
oRet.oTxWarpStructNoTransform.checkUnionPaths(); oRet.oTxWarpStructNoTransform.checkUnionPaths();
} }
} }
...@@ -5060,9 +5061,9 @@ CShape.prototype = ...@@ -5060,9 +5061,9 @@ CShape.prototype =
{ {
if(bNeedNoTransform && bCheckWordArtContent) if(bNeedNoTransform && bCheckWordArtContent)
{ {
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer); oContent.Draw(oContent.StartPage, oTextDrawer);
oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure; oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this); oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, dWidth, dHeight, this);
oRet.oTxWarpStructNoTransform.checkUnionPaths(); oRet.oTxWarpStructNoTransform.checkUnionPaths();
} }
} }
......
...@@ -466,6 +466,9 @@ function CTextDrawer(dWidth, dHeight, bDivByLInes, oTheme, bDivGlyphs) ...@@ -466,6 +466,9 @@ function CTextDrawer(dWidth, dHeight, bDivByLInes, oTheme, bDivGlyphs)
this.m_aStackCurRowMaxIndex = null; this.m_aStackCurRowMaxIndex = null;
this.m_aByParagraphs = null; this.m_aByParagraphs = null;
this.bCheckLines = false;
this.lastX = null;
this.lastY = null;
if(this.m_bDivByLines) if(this.m_bDivByLines)
{ {
this.m_aByLines = []; this.m_aByLines = [];
...@@ -981,14 +984,35 @@ CTextDrawer.prototype = ...@@ -981,14 +984,35 @@ CTextDrawer.prototype =
{ {
oPathToDraw.moveTo(this.xKoeff*x, this.yKoeff*y); oPathToDraw.moveTo(this.xKoeff*x, this.yKoeff*y);
} }
this.lastX = x;
this.lastY = y;
}, },
_l : function(x,y) _l : function(x,y)
{ {
if(this.bCheckLines)
{
if(Math.abs(x - this.lastX) < EPSILON_TEXT_AUTOFIT && Math.abs(x - this.lastX) < Math.abs(y - this.lastY))
{
this.checkCurveBezier(this.lastX, this.lastY, this.lastX, this.lastY + (y - this.lastY)/3, this.lastX, this.lastY + 2*(y - this.lastY)/3, x, y, PATH_DIV_EPSILON);
this.lastX = x;
this.lastY = y;
return;
}
else if(Math.abs(y - this.lastY) < EPSILON_TEXT_AUTOFIT && Math.abs(y - this.lastY) < Math.abs(x - this.lastX))
{
this.checkCurveBezier(this.lastX, this.lastY, this.lastX + (x - this.lastX)/3, this.lastY, this.lastX + 2*(x - this.lastX)/3, this.lastY, x, y, PATH_DIV_EPSILON);
this.lastX = x;
this.lastY = y;
return;
}
}
var oPathToDraw = this.Get_PathToDraw(); var oPathToDraw = this.Get_PathToDraw();
if(oPathToDraw) if(oPathToDraw)
{ {
oPathToDraw.lnTo(this.xKoeff*x, this.yKoeff*y); oPathToDraw.lnTo(this.xKoeff*x, this.yKoeff*y);
} }
this.lastX = x;
this.lastY = y;
}, },
_c : function(x1,y1,x2,y2,x3,y3) _c : function(x1,y1,x2,y2,x3,y3)
{ {
...@@ -997,6 +1021,8 @@ CTextDrawer.prototype = ...@@ -997,6 +1021,8 @@ CTextDrawer.prototype =
{ {
oPathToDraw.cubicBezTo(this.xKoeff*x1, this.yKoeff*y1, this.xKoeff*x2, this.yKoeff*y2, this.xKoeff*x3, this.yKoeff*y3); oPathToDraw.cubicBezTo(this.xKoeff*x1, this.yKoeff*y1, this.xKoeff*x2, this.yKoeff*y2, this.xKoeff*x3, this.yKoeff*y3);
} }
this.lastX = x3;
this.lastY = y3;
}, },
_c2 : function(x1,y1,x2,y2) _c2 : function(x1,y1,x2,y2)
{ {
...@@ -1005,6 +1031,8 @@ CTextDrawer.prototype = ...@@ -1005,6 +1031,8 @@ CTextDrawer.prototype =
{ {
oPathToDraw.quadBezTo(this.xKoeff*x1, this.yKoeff*y1, this.xKoeff*x2, this.yKoeff*y2); oPathToDraw.quadBezTo(this.xKoeff*x1, this.yKoeff*y1, this.xKoeff*x2, this.yKoeff*y2);
} }
this.lastX = x2;
this.lastY = y2;
}, },
ds : function() ds : function()
{ {
...@@ -1258,9 +1286,10 @@ CTextDrawer.prototype = ...@@ -1258,9 +1286,10 @@ CTextDrawer.prototype =
{ {
}, },
checkCurveBezier: function(x0, y0, x1, y1, x2, y2, x3, y3) checkCurveBezier: function(x0, y0, x1, y1, x2, y2, x3, y3, dEpsilon)
{ {
var arr_point = partition_bezier4(x0, y0, x1, y1, x2, y2, x3, y3, UNDERLINE_DIV_EPSILON), i, count = arr_point.length >> 2; var _epsilon = dEpsilon ? dEpsilon : UNDERLINE_DIV_EPSILON;
var arr_point = partition_bezier4(x0, y0, x1, y1, x2, y2, x3, y3, _epsilon), i, count = arr_point.length >> 2;
for(i = 0; i < count; ++i) for(i = 0; i < count; ++i)
{ {
var k = 4*i; var k = 4*i;
...@@ -1268,31 +1297,16 @@ CTextDrawer.prototype = ...@@ -1268,31 +1297,16 @@ CTextDrawer.prototype =
} }
}, },
// smart methods for horizontal / vertical lines // smart methods for horizontal / vertical lines
drawHorLine : function(align, y, x, r, penW, AdditionalData) drawHorLine : function(align, y, x, r, penW)
{ {
// if(!AdditionalData) this._s();
// { this._m(x, y);
// this.p_width(1000 * penW);
// this._s();
// this._m(x, y);
// this._l(r, y);
// this.ds();
// this._e();
// }
// else
{
this._s();
this._m(x, y);
this.checkCurveBezier(x, y, x + ((r-x)/3), y, x + (2/3) * (r - x), y, r, y);// this._l(r, y); this.checkCurveBezier(x, y, x + ((r-x)/3), y, x + (2/3) * (r - x), y, r, y);// this._l(r, y);
this._l(r, y + penW); this._l(r, y + penW);
this.checkCurveBezier(r, y + penW, x + (2/3) * (r - x), y + penW, x + ((r-x)/3), y + penW, x, y + penW);//this._l(x, y + penW); this.checkCurveBezier(r, y + penW, x + (2/3) * (r - x), y + penW, x + ((r-x)/3), y + penW, x, y + penW);//this._l(x, y + penW);
this._z(); this._z();
this.ds(); this.ds();
}
}, },
drawHorLine2 : function(align, y, x, r, penW) drawHorLine2 : function(align, y, x, r, penW)
......
...@@ -542,10 +542,6 @@ CShape.prototype.Refresh_RecalcData2 = function() ...@@ -542,10 +542,6 @@ CShape.prototype.Refresh_RecalcData2 = function()
HdrFtr.Refresh_RecalcData2(); HdrFtr.Refresh_RecalcData2();
}; };
CShape.prototype.getStartPageAbsolute = function()
{
return 0;
};
CShape.prototype.Get_StartPage_Absolute = function() CShape.prototype.Get_StartPage_Absolute = function()
{ {
return 0; return 0;
......
...@@ -5698,7 +5698,29 @@ ParaRun.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll) ...@@ -5698,7 +5698,29 @@ ParaRun.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
if ( true === this.Selection_CheckParaEnd() ) if ( true === this.Selection_CheckParaEnd() )
{ {
if ( undefined === IncFontSize ) if ( undefined === IncFontSize )
this.Paragraph.TextPr.Apply_TextPr( TextPr ); {
if(!TextPr.AscFill && !TextPr.AscLine && !TextPr.AscUnifill)
{
this.Paragraph.TextPr.Apply_TextPr( TextPr );
}
else
{
var EndTextPr = this.Paragraph.Get_CompiledPr2(false).TextPr.Copy();
EndTextPr.Merge( this.Paragraph.TextPr.Value );
if(TextPr.AscFill)
{
this.Paragraph.TextPr.Set_TextFill(CorrectUniFill(TextPr.AscFill, EndTextPr.TextFill, 0));
}
if(TextPr.AscUnifill)
{
this.Paragraph.TextPr.Set_Unifill(CorrectUniFill(TextPr.AscUnifill, EndTextPr.Unifill, 0));
}
if(TextPr.AscLine)
{
this.Paragraph.TextPr.Set_TextOutline(CorrectUniStroke(TextPr.AscLine, EndTextPr.TextOutline, 0));
}
}
}
else else
{ {
var Para = this.Paragraph; var Para = this.Paragraph;
......
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