Commit 39159f29 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@63677 954022d7-b5bf-4e40-9824-e11837661b57
parent 408e0795
......@@ -440,6 +440,9 @@ function CShape()
this.txWarpStruct = null;
this.txWarpStructParamarks = null;
this.txWarpStructNoTransform = null;
this.txWarpStructParamarksNoTransform = null;
this.setRecalculateInfo();
this.Lock = new CLock();
......@@ -2208,7 +2211,7 @@ CShape.prototype =
},
Check_AutoFit: function () {
return this.checkAutofit(true) || this.checkContentWordArt(this.getDocContent());
return this.checkAutofit(true) || this.checkContentWordArt(this.getDocContent()) || this.getBodyPr().prstTxWarp != null;
},
......@@ -3429,7 +3432,7 @@ CShape.prototype =
}
var oController = this.getDrawingObjectsController && this.getDrawingObjectsController();
if(!this.txWarpStruct || oController && (getTargetTextObject(oController) === this) /*|| this.haveSelectedDrawingInContent()*/)
if(!this.txWarpStruct && !this.txWarpStructParamarksNoTransform || (!this.txWarpStructParamarksNoTransform && oController && (getTargetTextObject(oController) === this)) /*|| this.haveSelectedDrawingInContent()*/)
{
if (this.txBody)
{
......@@ -3558,14 +3561,30 @@ CShape.prototype =
graphics.AddClipRect(clip_rect.x, clip_rect.y, clip_rect.w, clip_rect.h);
}
}
var bEditTextArt = isRealObject(oController) && (getTargetTextObject(oController) === this);
var oTransform = this.transformTextWordArt;
if(editor && editor.ShowParaMarks)
{
this.txWarpStructParamarks.draw(graphics, oTransform, oTheme, oColorMap);
if(bEditTextArt && this.txWarpStructParamarksNoTransform)
{
this.txWarpStructParamarksNoTransform.draw(graphics, this.transformText, oTheme, oColorMap);
}
else if(this.txWarpStructParamarks)
{
this.txWarpStructParamarks.draw(graphics, oTransform, oTheme, oColorMap);
}
}
else
{
this.txWarpStruct.draw(graphics, oTransform, oTheme, oColorMap);
if(bEditTextArt && this.txWarpStructNoTransform)
{
this.txWarpStructNoTransform.draw(graphics, this.transformText, oTheme, oColorMap);
}
else if(this.txWarpStruct)
{
this.txWarpStruct.draw(graphics, oTransform, oTheme, oColorMap);
}
}
if(bNeedRestoreState)
{
......@@ -4801,16 +4820,19 @@ CShape.prototype =
return false;
},
checkTextWarp: function(oContent, oBodyPr, dWidth, dHeight)
checkTextWarp: function(oContent, oBodyPr, dWidth, dHeight, bNeedNoTransform, bNeedWarp)
{
var oRet = {oTxWarpStruct: null, oTxWarpStructParamarks: null};
if((oBodyPr.prstTxWarp && oBodyPr.prstTxWarp.preset !== "textNoShape") || this.checkContentWordArt(oContent))
var oRet = {oTxWarpStruct: null, oTxWarpStructParamarks: null, oTxWarpStructNoTransform: null, oTxWarpStructParamarksNoTransform: null};
var bTransform = isRealObject(oBodyPr.prstTxWarp) && oBodyPr.prstTxWarp.preset !== "textNoShape" && bNeedWarp;
var warpGeometry = oBodyPr.prstTxWarp;
warpGeometry && warpGeometry.Recalculate(dWidth, dHeight);
this.recalcInfo.warpGeometry = warpGeometry;
var bCheckWordArtContent = this.checkContentWordArt(oContent);
if(bTransform || bCheckWordArtContent)
{
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 oTextDrawer = new CTextDrawer(dWidth, dHeight, true, oTheme, bNeedRecalc);
var warpGeometry = oBodyPr.prstTxWarp;
warpGeometry && warpGeometry.Recalculate(dWidth, dHeight);
var oContentToDraw = oContent;
if(bNeedRecalc)
{
......@@ -4829,7 +4851,7 @@ CShape.prototype =
oContentToDraw.Set_ApplyToAll(false);
if(bNeedTurnOn)
{
editor.WordControl.m_oLogicDocument.TurnOn_Recalculate();
editor.WordControl.m_oLogicDocument.TurnOn_Recalculate(false);
}
dMinPolygonLength = warpGeometry.getMinPathPolygonLength();
dOneLineWidth = GetRectContentWidth(oContentToDraw);
......@@ -4845,40 +4867,95 @@ CShape.prototype =
oContentToDraw.Recalculate_Page(0, true);
}
var dContentHeight = oContentToDraw.Get_SummaryHeight();
var OldShowParaMarks;
var OldShowParaMarks, width_ = dWidth*dKoeff, height_ = dHeight*dKoeff;
if(isRealObject(editor))
{
OldShowParaMarks = editor.ShowParaMarks;
editor.ShowParaMarks = true;
}
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
if(isRealObject(editor))
if(bNeedWarp)
{
editor.ShowParaMarks = OldShowParaMarks;
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStructParamarks = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarks.Recalculate(oTheme, oColorMap, width_, height_, this);
if(bTransform)
{
oRet.oTxWarpStructParamarks.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
if(bNeedNoTransform && bCheckWordArtContent)
{
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this);
oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths();
}
}
else
{
oRet.oTxWarpStructParamarks.checkUnionPaths();
if(bNeedNoTransform && bCheckWordArtContent)
{
oRet.oTxWarpStructParamarksNoTransform = oRet.oTxWarpStructParamarks;
}
}
}
else
{
if(bNeedNoTransform && bCheckWordArtContent)
{
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStructParamarksNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarksNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this);
oRet.oTxWarpStructParamarksNoTransform.checkUnionPaths();
}
}
oRet.oTxWarpStructParamarks = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructParamarks.Recalculate(oTheme, oColorMap, dWidth*dKoeff, dHeight*dKoeff, this);
warpGeometry && oRet.oTxWarpStructParamarks.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
if(isRealObject(editor))
{
OldShowParaMarks = editor.ShowParaMarks;
editor.ShowParaMarks = false;
}
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
if(isRealObject(editor))
if(bNeedWarp)
{
editor.ShowParaMarks = OldShowParaMarks;
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStruct = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStruct.Recalculate(oTheme, oColorMap, width_, height_, this);
if(bTransform)
{
oRet.oTxWarpStruct.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
if(bNeedNoTransform && bCheckWordArtContent)
{
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this);
oRet.oTxWarpStructNoTransform.checkUnionPaths();
}
}
else
{
oRet.oTxWarpStruct.checkUnionPaths();
if(bNeedNoTransform && bCheckWordArtContent)
{
oRet.oTxWarpStructNoTransform = oRet.oTxWarpStruct;
}
}
}
else
{
if(bNeedNoTransform && bCheckWordArtContent)
{
oContentToDraw.Draw(oContentToDraw.StartPage, oTextDrawer);
oRet.oTxWarpStructNoTransform = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStructNoTransform.Recalculate(oTheme, oColorMap, width_, height_, this);
oRet.oTxWarpStructNoTransform.checkUnionPaths();
}
}
oRet.oTxWarpStruct = oTextDrawer.m_oDocContentStructure;
oRet.oTxWarpStruct.Recalculate(oTheme, oColorMap, dWidth*dKoeff, dHeight*dKoeff, this);
warpGeometry && oRet.oTxWarpStruct.checkByWarpStruct(warpGeometry, dWidth, dHeight, oTheme, oColorMap, this, dOneLineWidth, oContentToDraw.XLimit, dContentHeight, dKoeff);
this.recalcInfo.warpGeometry = warpGeometry;
}
else
{
this.recalcInfo.warpGeometry = null;
if(isRealObject(editor))
{
editor.ShowParaMarks = OldShowParaMarks;
}
}
return oRet;
}
......
......@@ -501,7 +501,7 @@ CTextBody.prototype =
Check_AutoFit: function()
{
return this.parent && this.parent.checkAutofit && this.parent.checkAutofit(true) || false;
return this.parent && this.parent.Check_AutoFit && this.parent.Check_AutoFit(true) || false;
},
Refresh_RecalcData: function()
......
......@@ -111,6 +111,28 @@ CDocContentStructure.prototype.checkByWarpStruct = function(oWarpStruct, dWidth,
nLastIndex = nIndex;
}
this.checkUnionPaths(aWarpedObjects2);
};
CDocContentStructure.prototype.checkUnionPaths = function(aWarpedObjects)
{
var aWarpedObjects2;
if(Array.isArray(aWarpedObjects))
{
aWarpedObjects2 = aWarpedObjects;
}
else
{
aWarpedObjects2 = [];
for(var j = 0; j < this.m_aByLines.length; ++j)
{
var oTemp = this.m_aByLines[j];
for(var t = 0; t < oTemp.length; ++t)
{
oTemp[t].GetAllWarped(aWarpedObjects2);
}
}
}
var oLastObjectToDraw = null, oCurObjectToDraw;
for(i = 0; i < aWarpedObjects2.length; ++i)
{
......@@ -130,7 +152,6 @@ CDocContentStructure.prototype.checkByWarpStruct = function(oWarpStruct, dWidth,
oLastObjectToDraw = oCurObjectToDraw;
}
}
};
function CParagraphStructure()
......
......@@ -418,21 +418,23 @@ CShape.prototype.recalculateContent = function()
{
this.recalcInfo.bRecalculatedTitle = true;
this.recalcInfo.recalcTitle = null;
if(body_pr.prstTxWarp && body_pr.prstTxWarp.preset !== "textNoShape")
{
body_pr.prstTxWarp.Recalculate(oRecalcObj.w + oRecalcObj.correctW, oRecalcObj.h + oRecalcObj.correctH);
this.recalcInfo.warpGeometry = body_pr.prstTxWarp;
}
else
{
this.recalcInfo.warpGeometry = null;
}
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObj.w + oRecalcObj.correctW, oRecalcObj.h + oRecalcObj.correctH, true, false);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
else
{
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObj.w + oRecalcObj.correctW, oRecalcObj.h + oRecalcObj.correctH);
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObj.w + oRecalcObj.correctW, oRecalcObj.h + oRecalcObj.correctH, true, true);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
return oRecalcObj;
}
......
......@@ -500,21 +500,22 @@ CShape.prototype.recalculateContent = function()
this.recalcInfo.bRecalculatedTitle = true;
this.recalcInfo.recalcTitle = null;
if(body_pr.prstTxWarp && body_pr.prstTxWarp.preset !== "textNoShape")
{
body_pr.prstTxWarp.Recalculate(oRecalcObject.w + oRecalcObject.correctW, oRecalcObject.h + oRecalcObject.correctH);
this.recalcInfo.warpGeometry = body_pr.prstTxWarp;
}
else
{
this.recalcInfo.warpGeometry = null;
}
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObject.w + oRecalcObject.correctW, oRecalcObject.h + oRecalcObject.correctH, true, false);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
else
{
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObject.w + oRecalcObject.correctW, oRecalcObject.h + oRecalcObject.correctH);
var oTextWarpContent = this.checkTextWarp(content, body_pr, oRecalcObject.w + oRecalcObject.correctW, oRecalcObject.h + oRecalcObject.correctH, true, true);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
return oRecalcObject;
}
......@@ -638,7 +639,7 @@ CShape.prototype.recalculateContent2 = function()
content.Reset(0, 0, w, 20000);
content.Recalculate_Page(content.StartPage, true);
var oTextWarpContent = this.checkTextWarp(content, body_pr, this.txBody.contentWidth2, this.txBody.contentHeight2);
var oTextWarpContent = this.checkTextWarp(content, body_pr, this.txBody.contentWidth2, this.txBody.contentHeight2, false, true);
this.txWarpStructParamarks2 = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct2 = oTextWarpContent.oTxWarpStruct;
......
......@@ -224,21 +224,22 @@ CShape.prototype.recalculateTxBoxContent = function()
{
this.recalcInfo.bRecalculatedTitle = true;
this.recalcInfo.recalcTitle = null;
if(oBodyPr.prstTxWarp && oBodyPr.prstTxWarp.preset !== "textNoShape")
{
oBodyPr.prstTxWarp.Recalculate(oRecalcObj.w, oRecalcObj.h);
this.recalcInfo.warpGeometry = oBodyPr.prstTxWarp;
}
else
{
this.recalcInfo.warpGeometry = null;
}
var oTextWarpContent = this.checkTextWarp(this.textBoxContent, oBodyPr, oRecalcObj.w, oRecalcObj.h, true, false);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
else
{
var oTextWarpContent = this.checkTextWarp(this.textBoxContent, oBodyPr, oRecalcObj.w, oRecalcObj.h);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
var oTextWarpContent = this.checkTextWarp(this.textBoxContent, oBodyPr, oRecalcObj.w, oRecalcObj.h, true, true);
this.txWarpStructParamarks = oTextWarpContent.oTxWarpStructParamarks;
this.txWarpStruct = oTextWarpContent.oTxWarpStruct;
this.txWarpStructParamarksNoTransform = oTextWarpContent.oTxWarpStructParamarksNoTransform;
this.txWarpStructNoTransform = oTextWarpContent.oTxWarpStructNoTransform;
}
return oRecalcObj;
};
......
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