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