Commit 21c2240a 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@52008 954022d7-b5bf-4e40-9824-e11837661b57
parent 439673f9
...@@ -1774,8 +1774,9 @@ CopyProcessor.prototype = ...@@ -1774,8 +1774,9 @@ CopyProcessor.prototype =
{ {
case STATES_ID_TEXT_ADD: case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP: case STATES_ID_TEXT_ADD_IN_GROUP:
case STATES_ID_CHART_TEXT_ADD:
{ {
if(graphicObjects.State.textObject instanceof CShape) if(graphicObjects.State.textObject instanceof CShape || graphicObjects.State.textObject instanceof CChartTitle)
{ {
this.oPresentationWriter.WriteString2("TeamLab1"); this.oPresentationWriter.WriteString2("TeamLab1");
this.oPresentationWriter.WriteString2(editor.DocumentUrl); this.oPresentationWriter.WriteString2(editor.DocumentUrl);
...@@ -3476,10 +3477,11 @@ PasteProcessor.prototype = ...@@ -3476,10 +3477,11 @@ PasteProcessor.prototype =
{ {
case STATES_ID_TEXT_ADD: case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP: case STATES_ID_TEXT_ADD_IN_GROUP:
case STATES_ID_CHART_TEXT_ADD:
{ {
if(presentation.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) if(presentation.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{ {
var content = (slide.graphicObjects.State.textObject instanceof CShape) ? slide.graphicObjects.State.textObject.txBody.content : slide.graphicObjects.State.textObject.graphicObject.CurCell.Content; var content = (slide.graphicObjects.State.textObject instanceof CShape || slide.graphicObjects.State.textObject instanceof CChartTitle) ? slide.graphicObjects.State.textObject.txBody.content : slide.graphicObjects.State.textObject.graphicObject.CurCell.Content;
oThis.insertInPlace2(content, shape.txBody.content.Content); oThis.insertInPlace2(content, shape.txBody.content.Content);
shape.txBody.content = new CDocumentContent(shape.txBody, editor.WordControl.m_oDrawingDocument, 0 , 0, 0, 0, false, false); shape.txBody.content = new CDocumentContent(shape.txBody, editor.WordControl.m_oDrawingDocument, 0 , 0, 0, 0, false, false);
shape.txBody.setDocContent(shape.txBody.content); shape.txBody.setDocContent(shape.txBody.content);
...@@ -3495,7 +3497,9 @@ PasteProcessor.prototype = ...@@ -3495,7 +3497,9 @@ PasteProcessor.prototype =
} }
slide.graphicObjects.State.textObject.recalcInfo.recalculateContent = true; slide.graphicObjects.State.textObject.recalcInfo.recalculateContent = true;
slide.graphicObjects.State.textObject.recalcInfo.recalculateTransformText = true; slide.graphicObjects.State.textObject.recalcInfo.recalculateTransformText = true;
editor.WordControl.m_oLogicDocument.recalcMap[slide.graphicObjects.State.textObject.Id] = slide.graphicObjects.State.textObject;
var recalc_object = !(slide.graphicObjects.State.textObject instanceof CChartTitle) ? slide.graphicObjects.State.textObject : slide.graphicObjects.State.textObject.chartGroup;
editor.WordControl.m_oLogicDocument.recalcMap[recalc_object.Id] = recalc_object;
} }
break; break;
} }
......
...@@ -124,6 +124,20 @@ CChartTitle.prototype = ...@@ -124,6 +124,20 @@ CChartTitle.prototype =
}, },
getTextSelectionState: function () {
if (this.txBody) {
return this.txBody.content.Get_SelectionState();
}
return [];
},
setTextSelectionState: function (s) {
if (this.txBody) {
this.txBody.content.Set_SelectionState(s, s.length - 1);
}
},
Get_Styles: function() Get_Styles: function()
{ {
var styles = new CStyles(); var styles = new CStyles();
......
...@@ -3307,6 +3307,10 @@ CGraphicObjects.prototype = { ...@@ -3307,6 +3307,10 @@ CGraphicObjects.prototype = {
break; break;
} }
case STATES_ID_GROUP: case STATES_ID_GROUP:
case STATES_ID_CHANGE_ADJ_IN_GROUP:
case STATES_ID_ROTATE_IN_GROUP:
case STATES_ID_RESIZE_IN_GROUP:
case STATES_ID_MOVE_IN_GROUP:
{ {
s.id = STATES_ID_GROUP; s.id = STATES_ID_GROUP;
s.group = this.State.group; s.group = this.State.group;
...@@ -3317,6 +3321,30 @@ CGraphicObjects.prototype = { ...@@ -3317,6 +3321,30 @@ CGraphicObjects.prototype = {
} }
break; break;
} }
case STATES_ID_CHART_TEXT_ADD:
{
s.id = STATES_ID_CHART_TEXT_ADD;
s.chart = this.State.chart;
s.textObject = this.State.textObject;
s.textSelectionState = this.State.textObject.getTextSelectionState();
break;
}
case STATES_ID_CHART:
case STATES_ID_MOVE_INTERNAL_CHART_OBJECT:
{
s.id = STATES_ID_CHART;
s.chart = this.State.chart;
var selected_title;
var chart = this.State.chart;
if(chart.chartTitle && chart.chartTitle.selected)
selected_title = chart.chartTitle;
else if(chart.hAxisTitle && chart.hAxisTitle.selected)
selected_title = chart.hAxisTitle;
else if(chart.vAxisTitle && chart.vAxisTitle.selected)
selected_title = chart.vAxisTitle;
s.selectedTitle = selected_title;
break;
}
default : default :
{ {
s.id = STATES_ID_NULL; s.id = STATES_ID_NULL;
...@@ -3364,6 +3392,22 @@ CGraphicObjects.prototype = { ...@@ -3364,6 +3392,22 @@ CGraphicObjects.prototype = {
this.changeCurrentState(new GroupState(this, this.slide, s.group)); this.changeCurrentState(new GroupState(this, this.slide, s.group));
break; break;
} }
case STATES_ID_CHART_TEXT_ADD:
{
s.chart.select(this);
s.textObject.select();
s.textObject.setTextSelectionState(s.textSelectionState);
this.changeCurrentState(new ChartTextAdd(this, this.slide, s.chart, s.textObject));
break;
}
case STATES_ID_CHART:
{
s.chart.select(this);
if(s.selectedTitle)
s.selectedTitle.select();
this.changeCurrentState(new ChartState(this, this.slide, s.chart));
break;
}
default : default :
{ {
for(var i = 0; i < s.selectedObjects.length; ++i) for(var i = 0; i < s.selectedObjects.length; ++i)
......
...@@ -1036,7 +1036,7 @@ function MoveInternalChartObjectState(drawingObjectsController, drawingObjects, ...@@ -1036,7 +1036,7 @@ function MoveInternalChartObjectState(drawingObjectsController, drawingObjects,
this.startX = startX; this.startX = startX;
this.startY = startY; this.startY = startY;
this.chartElement = chartElement; this.chartElement = chartElement;
this.chart = chartElement.chartGroup;
this.onMouseDown = function(e, x, y) this.onMouseDown = function(e, x, y)
{ {
......
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