Commit e76b6e9b authored by Sergey Luzyanin's avatar Sergey Luzyanin

create DocumentContent before input text into shape

parent e2e4cfa9
......@@ -1214,6 +1214,32 @@ DrawingObjectsController.prototype =
return {X: 0, Y: 0, PageIndex: pageIndex};
},
CreateDocContent: function(){
var oController = this;
if(this.selection.groupSelection){
oController = this.selection.groupSelection;
}
if(oController.selection.textSelection){
return;
}
if(oController.selectedObjects.length === 1 && oController.selectedObjects[0].getObjectType() === AscDFH.historyitem_type_Shape){
var oShape = oController.selectedObjects[0];
if(oShape.bWordShape){
if(!oShape.textBoxContent){
oShape.createTextBoxContent();
}
}
else{
if(!oShape.txBody){
oShape.createTextBody();
}
}
oController.selection.textSelection = oShape;
}
},
getContextMenuPosition: function(pageIndex)
{
var i, aDrawings, dX, dY, oTargetTextObject;
......@@ -8935,6 +8961,7 @@ function CalcLiterByLength(aAlphaBet, nLength)
//--------------------------------------------------------export----------------------------------------------------
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].HANDLE_EVENT_MODE_HANDLE = HANDLE_EVENT_MODE_HANDLE;
......
......@@ -514,7 +514,9 @@ CPresentation.prototype =
if (false === this.Document_Is_SelectionLocked(changestype_Drawing_Props, null, true))
{
this.Create_NewHistoryPoint(AscDFH.historydescription_Document_CompositeInput);
if(this.Slides[this.CurPage]){
this.Slides[this.CurPage].graphicObjects.CreateDocContent();
}
this.DrawingDocument.TargetStart();
this.DrawingDocument.TargetShow();
......
......@@ -11028,7 +11028,7 @@ CDocument.prototype.Begin_CompositeInput = function()
if (false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content, null, true))
{
this.Create_NewHistoryPoint(AscDFH.historydescription_Document_CompositeInput);
this.DrawingObjects.CreateDocContent();
this.DrawingDocument.TargetStart();
this.DrawingDocument.TargetShow();
......
......@@ -292,7 +292,7 @@ CGraphicObjects.prototype =
createTextArt: DrawingObjectsController.prototype.createTextArt,
getChartObject: DrawingObjectsController.prototype.getChartObject,
getChartSpace2: DrawingObjectsController.prototype.getChartSpace2,
CreateDocContent: DrawingObjectsController.prototype.CreateDocContent,
getAllBoundsRectOnPageForMath: function(nPageIndex)
{
......
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