Commit 5b61e519 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@56150 954022d7-b5bf-4e40-9824-e11837661b57
parent e2d53674
......@@ -265,6 +265,16 @@ DrawingObjectsController.prototype =
handleMoveHit: function(object, e, x, y, group, bInSelect, pageIndex, bWord)
{
var b_is_inline;
if(isRealObject(group))
{
b_is_inline = group.parent && group.parent.Is_Inline();
}
else
{
b_is_inline = object.parent && object.parent.Is_Inline();
}
var b_is_selected_inline = this.selectedObjects.length === 1 && (this.selectedObjects[0].parent && this.selectedObjects[0].parent.Is_Inline());
if(this.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
var selector = group ? group : this;
......@@ -272,7 +282,7 @@ DrawingObjectsController.prototype =
{
this.arrPreTrackObjects.length = 0;
var is_selected = object.selected;
if(!(e.CtrlKey || e.ShiftKey) && !is_selected)
if(!(e.CtrlKey || e.ShiftKey) && !is_selected || b_is_inline || b_is_selected_inline)
selector.resetSelection();
selector.selectObject(object, pageIndex);
if(!is_selected)
......@@ -281,7 +291,12 @@ DrawingObjectsController.prototype =
if(!isRealObject(group))
{
this.resetInternalSelection();
if(!b_is_inline)
this.changeCurrentState(new PreMoveState(this, x, y, e.ShiftKey, e.CtrlKey, object, is_selected, true));
else
{
this.changeCurrentState(new PreMoveInlineObject(this, object, is_selected, true));
}
}
else
{
......@@ -693,6 +708,24 @@ DrawingObjectsController.prototype =
this.selectedObjects[0].drawAdjustments(drawingDocument);
}
}
if(this.document)
{
if(this.selectedObjects.length === 1 && this.selectedObjects[0].parent && !this.selectedObjects[0].parent.Is_Inline())
{
if(this.arrTrackObjects.length === 1)
{
var bounds = this.arrTrackObjects[0].getBounds();
var page_index = isRealNumber(this.arrTrackObjects[0].pageIndex) ? this.arrTrackObjects[0].pageIndex : (isRealNumber(this.arrTrackObjects[0].selectStartPage) ? this.arrTrackObjects[0].selectStartPage : 0);
var nearest_pos = this.document.Get_NearestPos(page_index, bounds.min_x, bounds.min_y, true, this.selectedObjects[0].parent);
drawingDocument.AutoShapesTrack.drawFlowAnchor(nearest_pos.Paragraph.X, nearest_pos.Paragraph.Y);
}
else
{
var paragraph = this.selectedObjects[0].parent.Get_ParentParagraph();
drawingDocument.AutoShapesTrack.drawFlowAnchor(paragraph.X, paragraph.Y);
}
}
}
return;
},
......
......@@ -153,11 +153,15 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
for(var j = grouped_objects.length - 1; j > -1; --j)
{
var cur_grouped_object = grouped_objects[j];
if(cur_grouped_object instanceof CShape || cur_grouped_object instanceof CImageShape)
switch (cur_grouped_object.getObjectType())
{
var hit_in_inner_area = cur_grouped_object.hitInInnerArea(x, y);
var hit_in_path = cur_grouped_object.hitInPath(x, y);
var hit_in_text_rect = cur_grouped_object.hitInTextRect(x, y);
case historyitem_type_Shape:
case historyitem_type_ImageShape:
case historyitem_type_ChartSpace:
{
var hit_in_inner_area = cur_grouped_object.hitInInnerArea && cur_grouped_object.hitInInnerArea(x, y);
var hit_in_path = cur_grouped_object.hitInPath && cur_grouped_object.hitInPath(x, y);
var hit_in_text_rect = cur_grouped_object.hitInTextRect && cur_grouped_object.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
return drawingObjectsController.handleMoveHit(drawing, e, x, y, null, false, pageIndex, true);
......@@ -168,52 +172,10 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
}
}
}
return false;
}
function handleTable(drawing, drawingObjects, drawingObjectsController, e, x, y, handleState)
{
var hit_in_inner_area = drawing.hitInInnerArea(x, y);
var hit_in_bounding_rect = drawing.hitInBoundingRect(x, y);
if(hit_in_bounding_rect || hit_in_inner_area)
{
resetGroupChartSelection(drawingObjectsController.State);
if(e.CtrlKey && drawingObjectsController.selectedObjects.length > 0)
{
var b_selected = drawing.selected;
drawing.select(drawingObjectsController);
for(var j = 0; j < drawingObjectsController.selectedObjects.length; ++j)
{
drawingObjectsController.addPreTrackObject(drawingObjectsController.selectedObjects[j].createMoveTrack());
}
drawingObjectsController.changeCurrentState(new PreMoveState(drawingObjectsController, drawingObjects, x, y, e.ShiftKey, e.CtrlKey, drawing, b_selected, true));
drawingObjects.OnUpdateOverlay();
return true;
}
else
{
drawingObjectsController.resetSelection();
drawing.select(drawingObjectsController);
if(!(e.Button === g_mouse_button_right)&&(!drawing.isTableBorder(x, y)
|| editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false))
{
drawing.selectionSetStart(e, x, y);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, drawingObjects, drawing));
}
else if(e.Button === g_mouse_button_right && drawingObjectsController.State.textObject && drawingObjectsController.State.textObject === drawing && !(drawing.pointInSelectedText(x, y)))
{
drawing.selectionSetStart(e, x, y);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, drawingObjects, drawing));
}
drawingObjects.presentation.Document_UpdateSelectionState();
drawingObjects.OnUpdateOverlay();
return true;
}
}
return false;
}
function handleChart(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord)
{
var ret = handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord);
......@@ -223,6 +185,23 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde
}
function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, pageIndex)
{
var _hit = drawing.hit && drawing.hit(x, y);
var _hit_to_path = drawing.hitToPath && drawing.hitToPath(x, y);
var b_hit_to_text = drawing.hitInTextRect && drawing.hitInTextRect(x, y);
if((_hit && !b_hit_to_text) || _hit_to_path)
{
return handleInlineHitNoText(drawing, drawingObjectsController, e, x, y, pageIndex);
}
else if(b_hit_to_text)
{
return drawingObjectsController.handleTextHit(drawing, e, x, y, null, pageIndex, true);
}
}
function handleInlineHitNoText(drawing, drawingObjects, e, x, y, pageIndex)
{
var selected_objects = drawingObjects.selectedObjects;
......@@ -252,38 +231,29 @@ function handleInlineHitNoText(drawing, drawingObjects, e, x, y, pageIndex)
function handleInlineObjects(drawingObjectsController, drawingArr, e, x, y, pageIndex, bWord)
{
var i;
var drawing;
var drawing, ret;
for(i = drawingArr.length-1; i > -1; --i)
{
drawing = drawingArr[i];
switch(drawing.getObjectType())
{
case historyitem_type_Shape:
case historyitem_type_ImageShape:
case historyitem_type_ChartSpace:
case historyitem_type_GroupShape:
case historyitem_type_ChartSpace://TODO
{
var _hit = drawing.hit && drawing.hit(x, y);
var _hit_to_path = drawing.hitToPath && drawing.hitToPath(x, y);
var b_hit_to_text = drawing.hitToTextRect && drawing.hitToTextRect(x, y);
if((_hit && !b_hit_to_text) || _hit_to_path)
{
return handleInlineHitNoText(drawing, drawingObjectsController, e, x, y, pageIndex);
ret = handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, pageIndex);
if(ret)
return ret;
break;
}
else if(b_hit_to_text)
case historyitem_type_GroupShape:
{
return false;
}
ret = handleGroup(drawing, drawingObjectsController, e, x, y, null, pageIndex, bWord);
if(ret)
return ret;
break;
}
// case historyitem_type_ChartSpace:
// {
//
// break;
// }
// case historyitem_type_GroupShape:
// {
// break;
// }
}
}
return false;
......@@ -314,22 +284,3 @@ function handleMouseUpPreMoveState(drawingObjects, e, x, y, pageIndex, bWord)
}
}
}
\ No newline at end of file
function handleInlineShapeImage(drawingObjectsController, drawing, e, x, y, pageIndex, bWord)
{
var selected_objects = drawingObjectsController.selectedObjects;
var hit = drawing.hit(x, y);
var hit_to_path = drawing.hitToPath(x, y);
var b_hit_to_text = drawing.hitToTextRect(x, y);
if((hit && !b_hit_to_text) || hit_to_path)
{
handleInlineHitNoText(drawing, drawingObjectsController, e, x, y, pageIndex, handleState);
return true;
}
else if(b_hit_to_text)
{
return true;
}
return false;
}
\ No newline at end of file
"use strict";
// COLOR -----------------------
/*
var map_color_scheme = {};
......@@ -27,6 +25,13 @@ var historyitem_ChangeColorScheme = 0;
var historyitem_ChangeFontScheme = 1;
var historyitem_ChangeFmtScheme = 2;
var g_oThemeFontsName = {};
g_oThemeFontsName["+mj-cs"] = true;
g_oThemeFontsName["+mj-ea"] = true;
g_oThemeFontsName["+mj-lt"] = true;
g_oThemeFontsName["+mn-cs"] = true;
g_oThemeFontsName["+mn-ea"] = true;
g_oThemeFontsName["+mn-lt"] = true;
function isRealObject(o)
{
return o !== null && typeof o === "object";
......@@ -9250,11 +9255,18 @@ FontScheme.prototype =
checkFont: function(font)
{
if(font)
if(g_oThemeFontsName[font])
{
if(this.fontMap[font])
{
return this.fontMap[font] ? this.fontMap[font] : font;
return this.fontMap[font];
}
else
{
return "Arial";
}
}
return font;
},
getObjectType: function()
......
......@@ -283,10 +283,12 @@ PreChangeAdjState.prototype =
}
};
function PreMoveInlineObject(drawingObjects, majorObject)
function PreMoveInlineObject(drawingObjects, majorObject, isSelected, bInside)
{
this.drawingObjects = drawingObjects;
this.majorObject = majorObject;
this.isSelected = isSelected;
this.bInside = bInside;
}
PreMoveInlineObject.prototype =
......@@ -310,7 +312,7 @@ PreMoveInlineObject.prototype =
onMouseUp: function(e, x,y,pageIndex)
{
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
return handleMouseUpPreMoveState(this.drawingObjects, e, x, y,pageIndex, true);
}
};
......@@ -1327,7 +1329,6 @@ SplineBezierState.prototype =
onMouseUp: function(e, X, Y, pageIndex)
{
this.drawingObjects.changeCurrentState(new NullState(this.drawingObjects));
this.drawingObjects.curState.updateAnchorPos();
}
};
......
......@@ -799,6 +799,8 @@ CShape.prototype.getRecalcObject = function()
CShape.prototype.setRecalcObject = function(object)
{
if(!object)
return;
var content = this.getDocContent && this.getDocContent();
if(content)
{
......
......@@ -2638,7 +2638,7 @@ ZIndexManager.prototype =
if(arrInd[0] > 0)
{
item = this.removeItem(arrInd[0]);
this.addItem(--arrInd[0]);
this.addItem(--arrInd[0], item);
}
for(i = 1; i < arrInd.length; ++i)
{
......
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