Commit 8b12f62e 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@64326 954022d7-b5bf-4e40-9824-e11837661b57
parent d4ae1236
......@@ -2673,6 +2673,7 @@ function DrawingObjects() {
{
_this.controller.setGraphicObjectPropsCallBack(props);
_this.controller.startRecalculate();
_this.sendGraphicObjectProps();
api.exucuteHistoryEnd = false;
}
else
......@@ -2689,13 +2690,13 @@ function DrawingObjects() {
ExecuteNoHistory(function(){
_this.controller.setGraphicObjectPropsCallBack(props);
_this.controller.startRecalculate();
_this.sendGraphicObjectProps();
}, this, []);
}
// _this.controller.setGraphicObjectProps( objectProperties );
}
_this.sendGraphicObjectProps();
};
_this.showChartSettings = function() {
......
......@@ -6303,7 +6303,7 @@ DrawingObjectsController.prototype =
return;
}
}
this.checkSelectedObjectsAndCallback(this.setGraphicObjectPropsCallBack, [props], true, historydescription_Spreadsheet_SetGraphicObjectsProps);
this.checkSelectedObjectsAndCallback(this.setGraphicObjectPropsCallBack, [props], false, historydescription_Spreadsheet_SetGraphicObjectsProps);
var oApplyProps = null;
if(props)
{
......
......@@ -2762,7 +2762,30 @@ CShape.prototype =
}
if(oBodyPr.wrap === nTWTNone)
{
var dMaxWidth = this.bWordShape ? 1000/*TODO: to get size of the text area*/ : 100000;
var dMaxWidth = 100000;
if(this.bWordShape)
{
var oParaDrawing = getParaDrawing(this);
if(oParaDrawing)
{
var oParentParagraph = oParaDrawing.Get_ParentParagraph();
if(oParentParagraph)
{
var oSectPr = oParentParagraph.Get_SectPr();
if(oSectPr)
{
if(!(oBodyPr.vert === nVertTTvert || oBodyPr.vert === nVertTTvert270))
{
dMaxWidth = oSectPr.Get_PageWidth() - oSectPr.Get_PageMargin_Left() - oSectPr.Get_PageMargin_Right() - l_ins - r_ins;
}
else
{
dMaxWidth = oSectPr.Get_PageHeight() - oSectPr.Get_PageMargin_Top() - oSectPr.Get_PageMargin_Bottom();
}
}
}
}
}
var dMaxWidthRec = RecalculateDocContentByMaxLine(oDocContent, dMaxWidth, this.bWordShape);
oDocContent.Set_StartPage(0);
oDocContent.Reset(0, 0, dMaxWidthRec, 20000);
......@@ -5174,4 +5197,18 @@ function CreateBinaryReader(szSrc, offset, srcLen)
}
return stream;
}
function getParaDrawing(oDrawing)
{
var oCurDrawing = oDrawing;
while(oCurDrawing.group)
{
oCurDrawing = oCurDrawing.group;
}
if(oCurDrawing.parent instanceof ParaDrawing)
{
return oCurDrawing.parent;
}
return null;
}
\ No newline at end of file
......@@ -2281,6 +2281,14 @@ ParaTextPr.prototype =
var unifill = new CUniFill();
unifill.Read_FromBinary(Reader);
this.Value.Unifill = unifill;
if(typeof CollaborativeEditing !== "undefined")
{
if(unifill.fill && unifill.fill.type === FILL_TYPE_BLIP && typeof unifill.fill.RasterImageId === "string" && unifill.fill.RasterImageId.length > 0)
{
CollaborativeEditing.Add_NewImage(getFullImageSrc2(unifill.fill.RasterImageId));
}
}
}
else
this.Value.Unifill = undefined;
......@@ -4613,6 +4621,12 @@ ParaDrawing.prototype =
return false;
},
Set_Parent : function(oParent)
{
History.Add(this, {Type: historyitem_Drawing_SetParent, oldPr: this.Parent, newPr: oParent});
this.Parent = oParent;
},
Update_Position : function(Paragraph, ParaLayout, PageLimits, PageLimitsOrigin, LineNum)
{
if ( undefined != this.PositionH_Old )
......@@ -4631,15 +4645,6 @@ ParaDrawing.prototype =
this.Parent = Paragraph;
this.DocumentContent = this.Parent.Parent;
//this.GraphicObj.parent = this;
// if ( this.GraphicObj.arrGraphicObjects )
// {
// var Count = this.GraphicObj.arrGraphicObjects.length;
// for ( var Index = 0; Index < Count; Index++ )
// this.GraphicObj.arrGraphicObjects[Index].parent = this;
// }
//
var PageNum = ParaLayout.PageNum;
var OtherFlowObjects = editor.WordControl.m_oLogicDocument.DrawingObjects.getAllFloatObjectsOnPage( PageNum, this.Parent.Parent );
......@@ -5207,6 +5212,11 @@ ParaDrawing.prototype =
this.Locked = Data.OldPr;
break;
}
case historyitem_Drawing_SetParent:
{
this.Parent = Data.oldPr;
break;
}
}
},
......@@ -5333,6 +5343,11 @@ ParaDrawing.prototype =
this.Locked = Data.NewPr;
break;
}
case historyitem_Drawing_SetParent:
{
this.Parent = Data.newPr;
break;
}
}
},
......@@ -5714,6 +5729,12 @@ ParaDrawing.prototype =
writeBool(Writer, Data.NewPr);
break;
}
case historyitem_Drawing_SetParent:
{
writeObject(w, data.newPr);
break;
}
}
return Writer;
......@@ -5887,6 +5908,12 @@ ParaDrawing.prototype =
this.Locked = readBool(Reader);
break;
}
case historyitem_Drawing_SetParent:
{
this.Parent = readObject(Reader);
break;
}
}
},
//-----------------------------------------------------------------------------------
......
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