Commit 1d964126 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@51279 954022d7-b5bf-4e40-9824-e11837661b57
parent 5044186f
......@@ -510,6 +510,18 @@ DrawingObjectsController.prototype =
},
editChartDrawingObjects: function(chart)
{
if(this.selectedObjects.length === 1
&& (this.selectedObjects[0].isChart()
|| (isRealObject(this.curState.group) && this.curState.group.selectedObjects.length === 1 && this.curState.group.selectedObjects[0].isChart())))
{
this.checkSelectedObjectsAndCallback(this.editChartCallback, [chart]);
}
},
editChartCallback: function(chart)
{
if(this.selectedObjects.length === 1)
{
......@@ -517,6 +529,7 @@ DrawingObjectsController.prototype =
{
this.selectedObjects[0].setChart(chart);
this.selectedObjects[0].recalculate();
this.drawingObjects.showDrawingObjects(true);
return;
}
......@@ -528,7 +541,9 @@ DrawingObjectsController.prototype =
{
this.curState.group.selectedObjects[0].setChart(chart);
this.curState.group.selectedObjects[0].recalculate();
this.drawingObjects.showDrawingObjects(true);
return;
}
}
}
......
......@@ -31,6 +31,11 @@ CChartLayout.prototype =
return this.Id;
},
getObjectType: function()
{
return CLASS_TYPE_CHART_LAYOUT;
},
setXMode: function(mode)
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Layout_Set_X_Mode, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataGOSingleProp(this.xMode, mode)), null);
......@@ -177,11 +182,11 @@ CChartLayout.prototype =
if(r.GetBool())
this.xMode = r.GetLong();
this.setXMode(r.GetLong());
if(r.GetBool())
this.yMode = r.GetLong();
this.setYMode(r.GetLong());
if(r.GetBool())
......@@ -193,10 +198,10 @@ CChartLayout.prototype =
if(r.GetBool())
this.x = r.GetDouble();
this.setX(r.GetDouble());
if(r.GetBool())
this.y = r.GetDouble();
this.setY(r.GetDouble());
if(r.GetBool())
this.w = r.GetDouble();
......
......@@ -136,6 +136,9 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit)
this.setDrawingDocument(DrawingDocument);
this.setParent(Parent);
this.setTextPr(new ParaTextPr());
//this.Internal_Content_Add(this.Content.length, new ParaNumbering());
//this.Internal_Content_Add(this.Content.length, new ParaEnd());
//this.Internal_Content_Add(this.Content.length, new ParaEmpty());
}
}
......
......@@ -259,6 +259,11 @@ CTableId.prototype =
Class = new asc_CChart();
break;
}
case CLASS_TYPE_CHART_LAYOUT:
{
Class = new CChartLayout();
break;
}
}
if(isRealObject(Class))
......@@ -873,6 +878,12 @@ CTextBody.prototype =
var r_ins = body_pr.rIns;
var l_ins = body_pr.lIns;
var max_content_width = maxWidth - r_ins - l_ins;
for(var i = 0; i < this.content.Content.length; ++i)
{
var par = this.content.Content[i];
par.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
}
this.content.Reset(0, 0, max_content_width, 20000);
this.content.Recalculate_Page(0, true);
var max_width = 0;
......@@ -892,6 +903,11 @@ CTextBody.prototype =
getRectHeight: function(maxHeight, width)
{
for(var i = 0; i < this.content.Content.length; ++i)
{
var par = this.content.Content[i];
par.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
}
this.content.Reset(0, 0, width, 20000);
this.content.Recalculate_Page(0, true);
var content_height = this.getSummaryHeight();
......@@ -1059,7 +1075,7 @@ CTextBody.prototype =
var par = dc.Content[i];
for(var i = 0; i < par.Content.length; ++i)
{
if(!(par.Content[i] instanceof ParaEnd || par.Content[i] instanceof ParaEmpty) && par.Content[i].Copy)
if(!(par.Content[i] instanceof ParaEnd || par.Content[i] instanceof ParaEmpty || par.Content[i] instanceof ParaNumbering) && par.Content[i].Copy)
this.content.Paragraph_Add(par.Content[i].Copy());
}
}
......
//----------------------------------------------------------------------------------- // Global counters //----------------------------------------------------------------------------------- function CIdCounter() { this.m_sUserId = null; this.m_bLoad = true; this.m_nIdCounterLoad = 0; // Счетчик Id для загрузки this.m_nIdCounterEdit = 0; // Счетчик Id для работы this.Get_NewId = function() { if ( true === this.m_bLoad || null === this.m_sUserId ) { this.m_nIdCounterLoad++; return ("" + this.m_nIdCounterLoad); } else { this.m_nIdCounterEdit++; return ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); } }; this.Set_UserId = function(sUserId) { this.m_sUserId = sUserId; }; this.Set_Load = function(bValue) { this.m_bLoad = bValue; }; } var g_oIdCounter = null; var CLASS_TYPE_TABLE_ID = 0; var CLASS_TYPE_DOCUMENT_CONTENT = 1; var CLASS_TYPE_SHAPE = 2; var CLASS_TYPE_IMAGE = 3; var CLASS_TYPE_GROUP = 4; var CLASS_TYPE_XFRM = 5; var CLASS_TYPE_GEOMETRY = 6; var CLASS_TYPE_PATH = 7; var CLASS_TYPE_PARAGRAPH = 8; var CLASS_TYPE_TEXT_BODY = 9; var CLASS_TYPE_TEXT_PR = 10; var CLASS_TYPE_UNI_FILL = 11; var CLASS_TYPE_PATTERN_FILL = 12; var CLASS_TYPE_GRAD_FILL = 13; var CLASS_TYPE_SOLID_FILL = 14; var CLASS_TYPE_UNI_COLOR = 15; var CLASS_TYPE_SCHEME_COLOR = 16; var CLASS_TYPE_RGB_COLOR = 17; var CLASS_TYPE_PRST_COLOR = 18; var CLASS_TYPE_SYS_COLOR = 19; var CLASS_TYPE_LINE = 20; var CLASS_TYPE_CHART_AS_GROUP = 21; var CLASS_TYPE_CHART_LEGEND = 22; var CLASS_TYPE_CHART_TITLE = 23; var CLASS_TYPE_COLOR_MOD = 24; var CLASS_TYPE_LEGEND_ENTRY = 25; var CLASS_TYPE_CHART_DATA = 26; var CLASS_TYPE_NO_FILL = 27; var CLASS_TYPE_GS = 28; var CLASS_TYPE_GRAD_LIN = 29; var CLASS_TYPE_GRAD_PAT = 30; var CLASS_TYPE_BLIP_FILL = 31; var g_oTableId = null;
\ No newline at end of file
//----------------------------------------------------------------------------------- // Global counters //----------------------------------------------------------------------------------- function CIdCounter() { this.m_sUserId = null; this.m_bLoad = true; this.m_nIdCounterLoad = 0; // Счетчик Id для загрузки this.m_nIdCounterEdit = 0; // Счетчик Id для работы this.Get_NewId = function() { if ( true === this.m_bLoad || null === this.m_sUserId ) { this.m_nIdCounterLoad++; return ("" + this.m_nIdCounterLoad); } else { this.m_nIdCounterEdit++; return ("" + this.m_sUserId + "_" + this.m_nIdCounterEdit); } }; this.Set_UserId = function(sUserId) { this.m_sUserId = sUserId; }; this.Set_Load = function(bValue) { this.m_bLoad = bValue; }; } var g_oIdCounter = null; var CLASS_TYPE_TABLE_ID = 0; var CLASS_TYPE_DOCUMENT_CONTENT = 1; var CLASS_TYPE_SHAPE = 2; var CLASS_TYPE_IMAGE = 3; var CLASS_TYPE_GROUP = 4; var CLASS_TYPE_XFRM = 5; var CLASS_TYPE_GEOMETRY = 6; var CLASS_TYPE_PATH = 7; var CLASS_TYPE_PARAGRAPH = 8; var CLASS_TYPE_TEXT_BODY = 9; var CLASS_TYPE_TEXT_PR = 10; var CLASS_TYPE_UNI_FILL = 11; var CLASS_TYPE_PATTERN_FILL = 12; var CLASS_TYPE_GRAD_FILL = 13; var CLASS_TYPE_SOLID_FILL = 14; var CLASS_TYPE_UNI_COLOR = 15; var CLASS_TYPE_SCHEME_COLOR = 16; var CLASS_TYPE_RGB_COLOR = 17; var CLASS_TYPE_PRST_COLOR = 18; var CLASS_TYPE_SYS_COLOR = 19; var CLASS_TYPE_LINE = 20; var CLASS_TYPE_CHART_AS_GROUP = 21; var CLASS_TYPE_CHART_LEGEND = 22; var CLASS_TYPE_CHART_TITLE = 23; var CLASS_TYPE_COLOR_MOD = 24; var CLASS_TYPE_LEGEND_ENTRY = 25; var CLASS_TYPE_CHART_DATA = 26; var CLASS_TYPE_NO_FILL = 27; var CLASS_TYPE_GS = 28; var CLASS_TYPE_GRAD_LIN = 29; var CLASS_TYPE_GRAD_PAT = 30; var CLASS_TYPE_BLIP_FILL = 31; var CLASS_TYPE_CHART_LAYOUT = 32; var g_oTableId = null;
\ No newline at end of file
......
......@@ -805,8 +805,28 @@ function MoveInternalChartObjectState(drawingObjectsController, drawingObjects,
this.onMouseUp = function(e, x, y)
{
History.Create_NewPoint();
this.drawingObjectsController.trackEnd();
var track_objects = this.drawingObjectsController.arrTrackObjects;
this.drawingObjects.objectLocker.addObjectId(this.chartElement.chartGroup.Get_Id());
var track_objects2 = [];
for(var i = 0; i < track_objects.length; ++i)
{
track_objects2.push(track_objects[i]);
}
var drawingObjects = this.drawingObjects;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
track_objects2[0].trackEnd();
drawingObjects.showDrawingObjects(true);
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new ChartState(this.drawingObjectsController, this.drawingObjects, this.chartElement.chartGroup));
......@@ -2472,7 +2492,7 @@ function PreMoveState(drawingObjectsController, drawingObjects, startX, startY,
var gr_obj = this.majorObject;
if(gr_obj.isChart())
{
this.drawingObjectsController.changeCurrentState(new ExtpectDoubleClickState(this.drawingObjectsController, this.drawingObjects));
this.drawingObjectsController.changeCurrentState(new ExtpectDoubleClickState(this.drawingObjectsController, this.drawingObjects, gr_obj));
asc["editor"].asc_endAddShape();
return;
/* if(false === this.graphicObjects.document.Document_Is_SelectionLocked(changestype_Drawing_Props, {Type : changestype_2_Element_and_Type , Element : gr_obj.Parent, CheckType : changestype_Paragraph_Content} )) {
......@@ -2530,17 +2550,17 @@ function PreMoveState(drawingObjectsController, drawingObjects, startX, startY,
};
}
function ExtpectDoubleClickState(drawingObjectsController, drawingObjects)
function ExtpectDoubleClickState(drawingObjectsController, drawingObjects, chart)
{
this.id = STATES_ID_EXPECT_DOUBLE_CLICK;
this.drawingObjects = drawingObjects;
this.drawingObjectsController = drawingObjectsController;
this.nullState = new NullState(drawingObjectsController, drawingObjects);
this.chart = chart;
this.onMouseDown = function(e, x, y)
{
this.drawingObjectsController.changeCurrentState(new NullState(this.drawingObjectsController, this.drawingObjects));
if(e.ClickCount > 1)
if(e.ClickCount > 1 && (this.chart.lockType === c_oAscLockTypes.kLockTypeNone || this.chart.lockType === c_oAscLockTypes.kLockTypeMine))
{
this.drawingObjects.showChartSettings();
}
......
......@@ -72,7 +72,7 @@ function OverlayObject(geometry, extX, extY, brush, pen, transform)
function RotateTrackShapeImage(originalObject)
{
this.originalObject = originalObject;
this.transform = new CMatrix();
this.transform = originalObject.transform.CreateDublicate();
this.overlayObject = new OverlayObject(originalObject.spPr.geometry, originalObject.extX, originalObject.extY, originalObject.brush, originalObject.pen, this.transform);
this.angle = originalObject.rot;
......
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