Commit 43b8afa3 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@55961 954022d7-b5bf-4e40-9824-e11837661b57
parent 3e77c1d3
...@@ -3060,6 +3060,7 @@ function DrawingObjects() { ...@@ -3060,6 +3060,7 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(this); drawingObject.graphicObject.setDrawingObjects(this);
aObjects.push(drawingObject); aObjects.push(drawingObject);
//drawingObject.graphicObject.addToDrawingObjects(); //drawingObject.graphicObject.addToDrawingObjects();
drawingObject.setGraphicObjectCoords();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject); var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
aBoundsCheckers.push(boundsChecker); aBoundsCheckers.push(boundsChecker);
} }
......
...@@ -330,8 +330,8 @@ DrawingObjectsController.prototype = ...@@ -330,8 +330,8 @@ DrawingObjectsController.prototype =
group.selection.textSelection = object; group.selection.textSelection = object;
} }
this.changeCurrentState(new TextAddState(this, object)); this.changeCurrentState(new TextAddState(this, object));
if(e.ClickCount < 2) //if(e.ClickCount < 2)
this.updateSelectionState(); this.updateSelectionState();
return true; return true;
} }
else else
...@@ -1195,7 +1195,7 @@ DrawingObjectsController.prototype = ...@@ -1195,7 +1195,7 @@ DrawingObjectsController.prototype =
getTheme: function() getTheme: function()
{ {
return this.draw return window["Asc"]["editor"].wbModel.theme;
}, },
getParagraphTextPr: function() getParagraphTextPr: function()
...@@ -2457,8 +2457,8 @@ DrawingObjectsController.prototype = ...@@ -2457,8 +2457,8 @@ DrawingObjectsController.prototype =
this.recalculate(); this.recalculate();
} }
} }
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
this.updateOverlay();
}, },
...@@ -3117,12 +3117,7 @@ DrawingObjectsController.prototype = ...@@ -3117,12 +3117,7 @@ DrawingObjectsController.prototype =
{ {
if(this.bNoResetSeclectionState === true) if(this.bNoResetSeclectionState === true)
return; return;
var count = this.selectedObjects.length; this.resetSelection();
while(count > 0)
{
this.selectedObjects[0].deselect(this);
--count;
}
this.changeCurrentState(new NullState(this, this.drawingObjects)); this.changeCurrentState(new NullState(this, this.drawingObjects));
this.updateSelectionState(); this.updateSelectionState();
var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {}); var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {});
...@@ -3144,16 +3139,19 @@ DrawingObjectsController.prototype = ...@@ -3144,16 +3139,19 @@ DrawingObjectsController.prototype =
resetSelection: function() resetSelection: function()
{ {
var count = this.selectedObjects.length; this.resetInternalSelection();
while(count > 0) for(var i = 0; i < this.selectedObjects.length; ++i)
{ {
var selected_object = this.selectedObjects[0]; this.selectedObjects[i].selected = false;
var old_group = selected_object.group;
selected_object.group = null;
this.selectedObjects[0].deselect(this);
selected_object.group = old_group;
--count;
} }
this.selectedObjects.length = 0;
this.selection =
{
selectedObjects: [],
groupSelection: null,
chartSelection: null,
textSelection: null
};
}, },
clearPreTrackObjects: function() clearPreTrackObjects: function()
...@@ -3697,6 +3695,25 @@ DrawingObjectsController.prototype = ...@@ -3697,6 +3695,25 @@ DrawingObjectsController.prototype =
var ParaPr = this.getParagraphParaPr(); var ParaPr = this.getParagraphParaPr();
var TextPr = this.getParagraphTextPr(); var TextPr = this.getParagraphTextPr();
if ( ParaPr && TextPr ) { if ( ParaPr && TextPr ) {
var theme = this.getTheme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(TextPr.FontFamily)
{
TextPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(TextPr.FontFamily.Name);
}
if(TextPr.RFonts)
{
if(TextPr.RFonts.Ascii)
TextPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.Ascii.Name);
if(TextPr.RFonts.EastAsia)
TextPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.EastAsia.Name);
if(TextPr.RFonts.HAnsi)
TextPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.HAnsi.Name);
if(TextPr.RFonts.CS)
TextPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(TextPr.RFonts.CS.Name);
}
}
this.prepareParagraphProperties(ParaPr, TextPr, ascSelectedObjects); this.prepareParagraphProperties(ParaPr, TextPr, ascSelectedObjects);
} }
......
...@@ -63,6 +63,7 @@ StartAddNewShape.prototype = ...@@ -63,6 +63,7 @@ StartAddNewShape.prototype =
asc["editor"].asc_endAddShape(); asc["editor"].asc_endAddShape();
} }
this.drawingObjects.clearTrackObjects(); this.drawingObjects.clearTrackObjects();
this.drawingObjects.drawingObjects.showDrawingObjects(true);
this.drawingObjects.updateOverlay(); this.drawingObjects.updateOverlay();
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects)); this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
} }
...@@ -83,7 +84,7 @@ NullState.prototype = ...@@ -83,7 +84,7 @@ NullState.prototype =
var b_no_handle_selected = false; var b_no_handle_selected = false;
if(selection.groupSelection) if(selection.groupSelection)
{ {
ret = handleSelectedObjects(this.drawingObjects, e, x, y, selection.groupSelection, pageIndex, true); ret = handleSelectedObjects(this.drawingObjects, e, x, y, selection.groupSelection, pageIndex, false);
if(ret) if(ret)
return ret; return ret;
ret = handleFloatObjects(this.drawingObjects, selection.groupSelection.arrGraphicObjects, e, x, y, selection.groupSelection, pageIndex, false); ret = handleFloatObjects(this.drawingObjects, selection.groupSelection.arrGraphicObjects, e, x, y, selection.groupSelection, pageIndex, false);
...@@ -95,7 +96,6 @@ NullState.prototype = ...@@ -95,7 +96,6 @@ NullState.prototype =
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE) if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{ {
this.drawingObjects.resetInternalSelection(); this.drawingObjects.resetInternalSelection();
this.drawingObjects.updateOverlay();
} }
if(!b_no_handle_selected) if(!b_no_handle_selected)
{ {
...@@ -106,7 +106,9 @@ NullState.prototype = ...@@ -106,7 +106,9 @@ NullState.prototype =
ret = handleFloatObjects(this.drawingObjects, this.drawingObjects.getDrawingArray(), e, x, y, null, pageIndex, false); ret = handleFloatObjects(this.drawingObjects, this.drawingObjects.getDrawingArray(), e, x, y, null, pageIndex, false);
if(ret) if(ret)
{
return ret; return ret;
}
return null; return null;
}, },
...@@ -348,7 +350,7 @@ PreMoveState.prototype = ...@@ -348,7 +350,7 @@ PreMoveState.prototype =
this.onMouseUp(e, x, y, pageIndex); this.onMouseUp(e, x, y, pageIndex);
return; return;
} }
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.parent.pageIndex) if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.selectStartPage)
{ {
this.drawingObjects.swapTrackObjects(); this.drawingObjects.swapTrackObjects();
this.drawingObjects.changeCurrentState(new MoveState(this.drawingObjects, this.majorObject, this.startX, this.startY)); this.drawingObjects.changeCurrentState(new MoveState(this.drawingObjects, this.majorObject, this.startX, this.startY));
...@@ -617,7 +619,7 @@ PreMoveInGroupState.prototype = ...@@ -617,7 +619,7 @@ PreMoveInGroupState.prototype =
this.onMouseUp(e, x, y, pageIndex); this.onMouseUp(e, x, y, pageIndex);
return; return;
} }
if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.parent.pageIndex) if(Math.abs(this.startX - x) > MOVE_DELTA || Math.abs(this.startY - y) > MOVE_DELTA || pageIndex !== this.majorObject.selectStartPage)
{ {
this.drawingObjects.swapTrackObjects(); this.drawingObjects.swapTrackObjects();
this.drawingObjects.changeCurrentState(new MoveInGroupState(this.drawingObjects, this.majorObject, this.group, this.startX, this.startY)); this.drawingObjects.changeCurrentState(new MoveInGroupState(this.drawingObjects, this.majorObject, this.group, this.startX, this.startY));
......
...@@ -251,8 +251,10 @@ DrawingObjectsController.prototype.onMouseDown = function(e, x, y) ...@@ -251,8 +251,10 @@ DrawingObjectsController.prototype.onMouseDown = function(e, x, y)
{ {
e.ShiftKey = e.shiftKey; e.ShiftKey = e.shiftKey;
e.CtrlKey = e.metaKey || e.ctrlKey; e.CtrlKey = e.metaKey || e.ctrlKey;
return this.curState.onMouseDown(e, x, y, 0); var ret = this.curState.onMouseDown(e, x, y, 0);
this.updateOverlay();
this.updateSelectionState();
return ret;
}; };
DrawingObjectsController.prototype.OnMouseDown = DrawingObjectsController.prototype.onMouseDown; DrawingObjectsController.prototype.OnMouseDown = DrawingObjectsController.prototype.onMouseDown;
...@@ -332,7 +334,7 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(asc_chart, o ...@@ -332,7 +334,7 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(asc_chart, o
DrawingObjectsController.prototype.isPointInDrawingObjects = function(x, y, e) DrawingObjectsController.prototype.isPointInDrawingObjects = function(x, y, e)
{ {
this.handleEventMode = HANDLE_EVENT_MODE_CURSOR; this.handleEventMode = HANDLE_EVENT_MODE_CURSOR;
var ret = this.onMouseDown(e || {}, x, y); var ret = this.curState.onMouseDown(e || {}, x, y);
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE; this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
return ret; return ret;
} }
......
...@@ -6279,7 +6279,28 @@ ...@@ -6279,7 +6279,28 @@
selectionType = objectInfo.flags.selectionType = this.objectRender.getGraphicSelectionType(graphicObjects[0].Id); selectionType = objectInfo.flags.selectionType = this.objectRender.getGraphicSelectionType(graphicObjects[0].Id);
var textPr = this.objectRender.controller.getParagraphTextPr(); var textPr = this.objectRender.controller.getParagraphTextPr();
var theme = this.objectRender.controller.getTheme();
if(theme && theme.themeElements && theme.themeElements.fontScheme)
{
if(textPr.FontFamily)
{
textPr.FontFamily.Name = theme.themeElements.fontScheme.checkFont(textPr.FontFamily.Name);
}
if(textPr.RFonts)
{
if(textPr.RFonts.Ascii)
textPr.RFonts.Ascii.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.Ascii.Name);
if(textPr.RFonts.EastAsia)
textPr.RFonts.EastAsia.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.EastAsia.Name);
if(textPr.RFonts.HAnsi)
textPr.RFonts.HAnsi.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.HAnsi.Name);
if(textPr.RFonts.CS)
textPr.RFonts.CS.Name = theme.themeElements.fontScheme.checkFont(textPr.RFonts.CS.Name);
}
}
var paraPr = this.objectRender.controller.getParagraphParaPr(); var paraPr = this.objectRender.controller.getParagraphParaPr();
var shape_props = this.objectRender.controller.getDrawingProps().shapeProps;
if (textPr && paraPr) { if (textPr && paraPr) {
objectInfo.text = this.objectRender.controller.Get_SelectedText(); objectInfo.text = this.objectRender.controller.Get_SelectedText();
...@@ -6291,14 +6312,17 @@ ...@@ -6291,14 +6312,17 @@
case align_Justify : horAlign = "justify"; break; case align_Justify : horAlign = "justify"; break;
} }
var vertAlign = "center"; var vertAlign = "center";
switch (paraPr.anchor) { if(shape_props)
case VERTICAL_ANCHOR_TYPE_BOTTOM: vertAlign = "bottom"; break; {
case VERTICAL_ANCHOR_TYPE_CENTER: vertAlign = "center"; break; switch (shape_props.verticalTextAlign) {
case VERTICAL_ANCHOR_TYPE_BOTTOM: vertAlign = "bottom"; break;
case VERTICAL_ANCHOR_TYPE_TOP: case VERTICAL_ANCHOR_TYPE_CENTER: vertAlign = "center"; break;
case VERTICAL_ANCHOR_TYPE_DISTRIBUTED:
case VERTICAL_ANCHOR_TYPE_JUSTIFIED: vertAlign = "top"; break; case VERTICAL_ANCHOR_TYPE_TOP:
} case VERTICAL_ANCHOR_TYPE_DISTRIBUTED:
case VERTICAL_ANCHOR_TYPE_JUSTIFIED: vertAlign = "top"; break;
}
}
objectInfo.halign = horAlign; objectInfo.halign = horAlign;
objectInfo.valign = vertAlign; objectInfo.valign = vertAlign;
......
...@@ -196,10 +196,9 @@ CChartSpace.prototype.createMoveTrack = CShape.prototype.createMoveTrack; ...@@ -196,10 +196,9 @@ CChartSpace.prototype.createMoveTrack = CShape.prototype.createMoveTrack;
CChartSpace.prototype.getAspect = CShape.prototype.getAspect; CChartSpace.prototype.getAspect = CShape.prototype.getAspect;
CChartSpace.prototype.getRectBounds = CShape.prototype.getRectBounds; CChartSpace.prototype.getRectBounds = CShape.prototype.getRectBounds;
CChartSpace.prototype.draw = function(graphics) /*CChartSpace.prototype.draw = function(graphics)
{ {
/*this.setRecalculateInfo();
this.recalculate();*/
var intGrid = graphics.GetIntegerGrid(); var intGrid = graphics.GetIntegerGrid();
graphics.SetIntegerGrid(false); graphics.SetIntegerGrid(false);
graphics.transform3(this.transform, false); graphics.transform3(this.transform, false);
...@@ -252,7 +251,7 @@ CChartSpace.prototype.draw = function(graphics) ...@@ -252,7 +251,7 @@ CChartSpace.prototype.draw = function(graphics)
} }
} }
}; }; */
CChartSpace.prototype.recalculate = function() CChartSpace.prototype.recalculate = function()
{ {
if(this.bDeleted) if(this.bDeleted)
......
...@@ -1844,22 +1844,7 @@ CGraphicObjects.prototype = ...@@ -1844,22 +1844,7 @@ CGraphicObjects.prototype =
//TODO //TODO
}, },
resetSelection: function() resetSelection: DrawingObjectsController.prototype.resetSelection,
{
this.resetInternalSelection();
for(var i = 0; i < this.selectedObjects.length; ++i)
{
this.selectedObjects[i].selected = false;
}
this.selectedObjects.length = 0;
this.selection =
{
selectedObjects: [],
groupSelection: null,
chartSelection: null,
textSelection: null
};
},
resetSelection2: function() resetSelection2: function()
{ {
......
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