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) ...@@ -198,6 +198,14 @@ function CreateUniFillByUniColorCopy(uniColor)
return ret; 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) function CopyRunToPPTX(Run, Paragraph, bHyper)
{ {
var NewRun = new ParaRun(Paragraph, false); var NewRun = new ParaRun(Paragraph, false);
...@@ -2182,10 +2190,6 @@ CShape.prototype = ...@@ -2182,10 +2190,6 @@ CShape.prototype =
this.cachedImage = null; this.cachedImage = null;
this.recalculateLocalTransform(this.transform); this.recalculateLocalTransform(this.transform);
this.invertTransform = global_MatrixTransformer.Invert(this.transform); this.invertTransform = global_MatrixTransformer.Invert(this.transform);
//if(this.drawingBase && !this.group)
//{
// this.drawingBase.setGraphicObjectCoords();
//}
this.localTransform = this.transform.CreateDublicate(); this.localTransform = this.transform.CreateDublicate();
}, },
...@@ -2204,7 +2208,7 @@ CShape.prototype = ...@@ -2204,7 +2208,7 @@ CShape.prototype =
}, },
Check_AutoFit: function () { Check_AutoFit: function () {
return this.checkAutofit(true); return this.checkAutofit(true) || this.checkContentWordArt(this.getDocContent());
}, },
...@@ -2509,7 +2513,6 @@ CShape.prototype = ...@@ -2509,7 +2513,6 @@ CShape.prototype =
else { else {
this.extY = oContentMetrics.contentH + t_ins + b_ins; this.extY = oContentMetrics.contentH + t_ins + b_ins;
} }
} }
else { else {
if (oGeometry) { if (oGeometry) {
...@@ -2550,7 +2553,7 @@ CShape.prototype = ...@@ -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); var dSin = Math.sin(this.rot), dCos = Math.cos(this.rot);
...@@ -2599,52 +2602,6 @@ CShape.prototype = ...@@ -2599,52 +2602,6 @@ CShape.prototype =
this.x += dTrDeltaX; this.x += dTrDeltaX;
this.y += dTrDeltaY; 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.localX = this.x;
this.localY = this.y; this.localY = this.y;
...@@ -2780,9 +2737,9 @@ CShape.prototype = ...@@ -2780,9 +2737,9 @@ CShape.prototype =
return oRet; 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(); var oMainGroup = this.getMainGroup();
if(oMainGroup) if(oMainGroup)
...@@ -2802,7 +2759,7 @@ CShape.prototype = ...@@ -2802,7 +2759,7 @@ CShape.prototype =
CheckSpPrXfrm(this, true); CheckSpPrXfrm(this, true);
this.spPr.xfrm.setExtX(this.extX); this.spPr.xfrm.setExtX(this.extX);
this.spPr.xfrm.setExtY(this.extY); this.spPr.xfrm.setExtY(this.extY);
if(!this.bWordShape) if(!this.bWordShape || this.group)
{ {
this.spPr.xfrm.setOffX(this.x); this.spPr.xfrm.setOffX(this.x);
this.spPr.xfrm.setOffY(this.y); this.spPr.xfrm.setOffY(this.y);
...@@ -2814,12 +2771,22 @@ CShape.prototype = ...@@ -2814,12 +2771,22 @@ CShape.prototype =
if(oMainGroup) if(oMainGroup)
{ {
oMainGroup.updateCoordinatesAfterInternalResize(); oMainGroup.updateCoordinatesAfterInternalResize();
if(oMainGroup.parent && oMainGroup.parent.CheckWH)
{
oMainGroup.parent.CheckWH();
if(this.bWordShape)
{
editor.WordControl.m_oLogicDocument.Recalculate();
}
}
} }
else else
{ {
this.checkDrawingBaseCoords(); this.checkDrawingBaseCoords();
} }
return true;
} }
return false;
}, },
...@@ -3121,7 +3088,7 @@ CShape.prototype = ...@@ -3121,7 +3088,7 @@ CShape.prototype =
hitInTextRect: function (x, y) { hitInTextRect: function (x, y) {
var oController = this.getDrawingObjectsController && this.getDrawingObjectsController(); var oController = this.getDrawingObjectsController && this.getDrawingObjectsController();
if(!this.txWarpStruct || if(!this.txWarpStruct || !this.recalcInfo.warpGeometry ||
this.recalcInfo.warpGeometry.preset === "textNoShape" || this.recalcInfo.warpGeometry.preset === "textNoShape" ||
oController && (getTargetTextObject(oController) === this || (oController.curState.startTargetTextObject === this))) oController && (getTargetTextObject(oController) === this || (oController.curState.startTargetTextObject === this)))
{ {
...@@ -4251,13 +4218,6 @@ CShape.prototype = ...@@ -4251,13 +4218,6 @@ CShape.prototype =
} }
}, },
handleContent: function(pageIndex/*для текста*/)
{
this.recalcContent();
this.recalcContent2 && this.recalcContent2();
this.recalcTransformText();
},
Undo: function (data) Undo: function (data)
{ {
switch (data.Type) switch (data.Type)
......
...@@ -663,7 +663,7 @@ CTextDrawer.prototype = ...@@ -663,7 +663,7 @@ CTextDrawer.prototype =
{ {
if(oLastCommand.m_aContent.length === 0) 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]; oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
...@@ -671,11 +671,11 @@ CTextDrawer.prototype = ...@@ -671,11 +671,11 @@ CTextDrawer.prototype =
{ {
if(oLastObjectToDraw.geometry.pathLst.length === 0 || (oLastObjectToDraw.geometry.pathLst.length === 1 && oLastObjectToDraw.geometry.pathLst[0].ArrPathCommandInfo.length === 0)) 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 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]; oLastObjectToDraw = oLastCommand.m_aContent[oLastCommand.m_aContent.length - 1];
} }
} }
...@@ -1389,13 +1389,32 @@ CTextDrawer.prototype = ...@@ -1389,13 +1389,32 @@ CTextDrawer.prototype =
}, },
GetFillFromTextPr: function(oTextPr) GetFillFromTextPr: function(oTextPr)
{
if(oTextPr)
{ {
return oTextPr.TextFill ? oTextPr.TextFill : oTextPr.Unifill; 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) GetPenFromTextPr: function(oTextPr)
{
if(oTextPr)
{ {
return oTextPr.TextOutline; return oTextPr.TextOutline;
}
return null;
}, },
......
...@@ -1975,6 +1975,13 @@ CGraphicObjects.prototype = ...@@ -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); 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_WrappingType(WRAPPING_TYPE_NONE);
para_drawing.Set_DrawingType(drawing_Anchor); 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); var group = this.getGroup(objects_for_grouping);
group.spPr.xfrm.setOffX(0); group.spPr.xfrm.setOffX(0);
group.spPr.xfrm.setOffY(0); group.spPr.xfrm.setOffY(0);
......
...@@ -4421,7 +4421,7 @@ ParaDrawing.prototype = ...@@ -4421,7 +4421,7 @@ ParaDrawing.prototype =
this.Height = 0; this.Height = 0;
return; 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.Width = this.Extent.W;
this.Height = this.Extent.H; 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