Commit 7ee8eb51 authored by Sergey Luzyanin's avatar Sergey Luzyanin

add content by double click

parent f2d88475
......@@ -599,6 +599,31 @@ CShape.prototype.Get_Worksheet = function()
return this.worksheet;
};
CShape.prototype.Set_CurrentElement = function()
{
var drawing_objects = this.getDrawingObjectsController();
if(drawing_objects)
{
drawing_objects.resetSelection(true);
if(this.group)
{
var main_group = this.group.getMainGroup();
drawing_objects.selectObject(main_group, 0);
main_group.selectObject(this, 0);
main_group.selection.textSelection = this;
drawing_objects.selection.groupSelection = main_group;
}
else
{
drawing_objects.selectObject(this, 0);
drawing_objects.selection.textSelection = this;
}
}
};
AscFormat.CTextBody.prototype.Get_Worksheet = function()
{
return this.parent && this.parent.Get_Worksheet && this.parent.Get_Worksheet();
......
......@@ -937,8 +937,6 @@ DrawingObjectsController.prototype =
handleDblClickEmptyShape: function(oShape){
if(!this.drawingObjects.cSld)
return;
this.checkSelectedObjectsAndCallback(function () {
if(!oShape.getDocContent() && !CheckLinePresetForParagraphAdd(oShape)){
if(!oShape.bWordShape){
......@@ -10500,4 +10498,5 @@ function ApplyPresetToChartSpace(oChartSpace, aPreset, bCreate){
window['AscFormat'].ApplyDLblsProps = ApplyDLblsProps;
window['AscFormat'].CollectDLbls = CollectDLbls;
window['AscFormat'].CollectSettingsSpPr = CollectSettingsSpPr;
window['AscFormat'].CheckLinePresetForParagraphAdd = CheckLinePresetForParagraphAdd;
})(window);
......@@ -2339,6 +2339,29 @@ CGraphicObjects.prototype =
this.curState = state;
},
handleDblClickEmptyShape: function(oShape){
if(!oShape.getDocContent() && !AscFormat.CheckLinePresetForParagraphAdd(oShape)){
if(false === this.document.Document_Is_SelectionLocked(changestype_Drawing_Props))
{
History.Create_NewPoint(AscDFH.historydescription_Document_GrObjectsBringBackward);
if(!oShape.bWordShape){
oShape.createTextBody();
}
else{
oShape.createTextBoxContent();
}
this.document.Recalculate();
var oContent = oShape.getDocContent();
oContent.Set_CurrentElement(0, true);
this.updateSelectionState();
}
this.clearTrackObjects();
this.clearPreTrackObjects();
this.changeCurrentState(new AscFormat.NullState(this));
}
},
canGroup: function(bGetArray)
{
var selection_array = this.selectedObjects;
......
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