Commit cc247a82 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@62978 954022d7-b5bf-4e40-9824-e11837661b57
parent e9af6664
......@@ -198,6 +198,14 @@ function CreateUniFillByUniColorCopy(uniColor)
return ret;
}
function CreateUniFillByUniColor(uniColor)
{
var ret = new CUniFill();
ret.setFill(new CSolidFill());
ret.fill.setColor(uniColor.createDuplicate());
return ret;
}
function CopyRunToPPTX(Run, Paragraph, bHyper)
{
var NewRun = new ParaRun(Paragraph, false);
......@@ -2182,10 +2190,6 @@ CShape.prototype =
this.cachedImage = null;
this.recalculateLocalTransform(this.transform);
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
//if(this.drawingBase && !this.group)
//{
// this.drawingBase.setGraphicObjectCoords();
//}
this.localTransform = this.transform.CreateDublicate();
},
......@@ -2204,7 +2208,7 @@ CShape.prototype =
},
Check_AutoFit: function () {
return this.checkAutofit(true);
return this.checkAutofit(true) || this.checkContentWordArt(this.getDocContent());
},
......@@ -2509,7 +2513,6 @@ CShape.prototype =
else {
this.extY = oContentMetrics.contentH + t_ins + b_ins;
}
}
else {
if (oGeometry) {
......@@ -2550,7 +2553,7 @@ CShape.prototype =
}
}
if(!this.bWordShape)//в презентациях и в таблицах изменям позицию: по горизонтали - в зависимости от выравнивания первого параграфа в контенте,
if(!this.bWordShape || this.group)//в презентациях и в таблицах изменям позицию: по горизонтали - в зависимости от выравнивания первого параграфа в контенте,
// по вертикали - в зависимости от вертикального выравнивания контента.
{
var dSin = Math.sin(this.rot), dCos = Math.cos(this.rot);
......@@ -2599,52 +2602,6 @@ CShape.prototype =
this.x += dTrDeltaX;
this.y += dTrDeltaY;
}
/*if(!this.bWordShape)
{
switch (oBodyPr.anchor) {
case 0: //b
{
dDeltaY = dOldExtY - this.extY;
break;
}
case 1: //ctr
case 2: //dist
case 3: //just
{// (Text Anchor Enum ( Center ))
dDeltaY = (dOldExtY - this.extY) / 2;
break;
}
case 4: //t
{//Top
break;
}
}
if (oBodyPr.wrap === nTWTNone){
oContent = this.getDocContent();
oParaPr = oContent.Content[0].CompiledPr.ParaPr;
switch (oParaPr.Jc) {
case align_Right:
{
dDeltaX = dOldExtX - this.extX;
break;
}
case align_Left:
{
break;
}
default:
//case align_Center:
//case align_Justify:
{
dDeltaX = (dOldExtX - this.extX) / 2;
break;
}
}
}
}*/
}
this.localX = this.x;
this.localY = this.y;
......@@ -2780,9 +2737,9 @@ CShape.prototype =
return oRet;
},
checkExtentsByDocContent: function()
checkExtentsByDocContent: function(bForce)
{
if(!this.bWordShape && this.checkAutofit(true))
if((!this.bWordShape || this.group || bForce) && this.checkAutofit(true))
{
var oMainGroup = this.getMainGroup();
if(oMainGroup)
......@@ -2802,7 +2759,7 @@ CShape.prototype =
CheckSpPrXfrm(this, true);
this.spPr.xfrm.setExtX(this.extX);
this.spPr.xfrm.setExtY(this.extY);
if(!this.bWordShape)
if(!this.bWordShape || this.group)
{
this.spPr.xfrm.setOffX(this.x);
this.spPr.xfrm.setOffY(this.y);
......@@ -2814,12 +2771,22 @@ CShape.prototype =
if(oMainGroup)
{
oMainGroup.updateCoordinatesAfterInternalResize();
if(oMainGroup.parent && oMainGroup.parent.CheckWH)
{
oMainGroup.parent.CheckWH();
if(this.bWordShape)
{
editor.WordControl.m_oLogicDocument.Recalculate();
}
}
}
else
{
this.checkDrawingBaseCoords();
}
return true;
}
return false;
},
......@@ -3121,7 +3088,7 @@ CShape.prototype =
hitInTextRect: function (x, y) {
var oController = this.getDrawingObjectsController && this.getDrawingObjectsController();
if(!this.txWarpStruct ||
if(!this.txWarpStruct || !this.recalcInfo.warpGeometry ||
this.recalcInfo.warpGeometry.preset === "textNoShape" ||
oController && (getTargetTextObject(oController) === this || (oController.curState.startTargetTextObject === this)))
{
......@@ -4251,13 +4218,6 @@ CShape.prototype =
}
},
handleContent: function(pageIndex/*для текста*/)
{
this.recalcContent();
this.recalcContent2 && this.recalcContent2();
this.recalcTransformText();
},
Undo: function (data)
{
switch (data.Type)
......
......@@ -663,7 +663,7 @@ CTextDrawer.prototype =
{
if(oLastCommand.m_aContent.length === 0)
{
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.m_oTextPr.TextOutline, this.Width, this.Height, new Geometry(), this.m_oTransform, this));
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new Geometry(), this.m_oTransform, this));
}
oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
......@@ -671,11 +671,11 @@ CTextDrawer.prototype =
{
if(oLastObjectToDraw.geometry.pathLst.length === 0 || (oLastObjectToDraw.geometry.pathLst.length === 1 && oLastObjectToDraw.geometry.pathLst[0].ArrPathCommandInfo.length === 0))
{
oLastObjectToDraw.resetBrushPen(this.GetFillFromTextPr(this.m_oTextPr), this.m_oTextPr.TextOutline)
oLastObjectToDraw.resetBrushPen(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr))
}
else
{
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.m_oTextPr.TextOutline, this.Width, this.Height, new Geometry(), this.m_oTransform, this));
oLastCommand.m_aContent.push(new ObjectToDraw(this.GetFillFromTextPr(this.m_oTextPr), this.GetPenFromTextPr(this.m_oTextPr), this.Width, this.Height, new Geometry(), this.m_oTransform, this));
oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
}
}
......@@ -1390,12 +1390,31 @@ CTextDrawer.prototype =
GetFillFromTextPr: function(oTextPr)
{
return oTextPr.TextFill ? oTextPr.TextFill : oTextPr.Unifill;
if(oTextPr)
{
return oTextPr.TextFill ? oTextPr.TextFill : oTextPr.Unifill;
}
else
{
if(this.m_oBrush.Color1.R !== -1)
{
var Color = this.m_oBrush.Color1;
return CreateUniFillByUniColor(CreateUniColorRGB(Color.R, Color.G, Color.B));
}
else
{
return CreateUniFillByUniColor(CreateUniColorRGB(0, 0, 0));
}
}
},
GetPenFromTextPr: function(oTextPr)
{
return oTextPr.TextOutline;
if(oTextPr)
{
return oTextPr.TextOutline;
}
return null;
},
......
......@@ -1975,6 +1975,13 @@ CGraphicObjects.prototype =
var para_drawing = new ParaDrawing(common_bounds.maxX - common_bounds.minX, common_bounds.maxY - common_bounds.minY, null, this.drawingDocument, null, null);
para_drawing.Set_WrappingType(WRAPPING_TYPE_NONE);
para_drawing.Set_DrawingType(drawing_Anchor);
for(i = 0; i < objects_for_grouping.length; ++i)
{
if(objects_for_grouping[i].checkExtentsByDocContent && objects_for_grouping[i].checkExtentsByDocContent(true))
{
objects_for_grouping[i].updatePosition(objects_for_grouping[i].posX, objects_for_grouping[i].posY)
}
}
var group = this.getGroup(objects_for_grouping);
group.spPr.xfrm.setOffX(0);
group.spPr.xfrm.setOffY(0);
......
......@@ -4421,7 +4421,7 @@ ParaDrawing.prototype =
this.Height = 0;
return;
}
if(isRealNumber(this.Extent.W) && isRealNumber(this.Extent.H))
if(isRealNumber(this.Extent.W) && isRealNumber(this.Extent.H) && (!this.GraphicObj.checkAutofit || !this.GraphicObj.checkAutofit()))
{
this.Width = this.Extent.W;
this.Height = this.Extent.H;
......
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