Commit 0a040c36 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

правка бага 22182 - [Charts] Ошибка в консоли при вынесении элемента "chart...

правка бага  22182 - [Charts] Ошибка в консоли при вынесении элемента "chart title" за границы уменьшенной flow диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52020 954022d7-b5bf-4e40-9824-e11837661b57
parent 787b041f
......@@ -4337,17 +4337,42 @@ function ChartState(graphicObjects, chart)
this.updateCursorType = function(pageIndex, x, y, e, bTextFlag)
{
this.id = STATES_ID_CHART;
this.graphicObjects = graphicObjects;
this.chart = chart;//ParaDrawing
this.graphicObjects.setStartTrackPos(x, y, pageIndex);
if(this.graphicObjects.document.CurPos.Type === docpostype_HdrFtr)
{
var hdr_ftr_state = new NullStateHeaderFooter(this.graphicObjects);
return hdr_ftr_state.updateCursorType(pageIndex, x, y, e, bTextFlag);
}
var _graphic_pages = this.graphicObjects.graphicPages;
var _common_selection_array = this.graphicObjects.selectionInfo.selectionArray;
var _translated_point;
if(_common_selection_array.length > 0)
{
if(_common_selection_array.length === 1)
{
var _selected_gr_object = _common_selection_array[0];
var _translated_x;
var _translated_y;
var _cur_selected_gr_object = _common_selection_array[0];
if(_selected_gr_object.pageIndex !== pageIndex)
{
var _translated_point = this.graphicObjects.drawingDocument.ConvertCoordsToAnotherPage(x, y, pageIndex, _selected_gr_object.pageIndex);
_translated_x = _translated_point.X;
_translated_y = _translated_point.Y;
}
else
{
_translated_x = x;
_translated_y = y;
}
var _hit_to_adj = _selected_gr_object.hitToAdj(_translated_x, _translated_y);
if(_hit_to_adj.hit === true)
{
this.graphicObjects.drawingDocument.SetCursorType("crosshair");
return true;
}
}
for(var _index = _common_selection_array.length -1; _index > -1; --_index)
{
var _cur_selected_gr_object = _common_selection_array[_index];
if(_cur_selected_gr_object.pageIndex !== pageIndex)
{
_translated_point = this.graphicObjects.drawingDocument.ConvertCoordsToAnotherPage(x, y, pageIndex, _cur_selected_gr_object.pageIndex);
......@@ -4364,31 +4389,41 @@ function ChartState(graphicObjects, chart)
{
this.graphicObjects.majorGraphicObject = _cur_selected_gr_object;
this.graphicObjects.arrPreTrackObjects.length = 0;
var chart = _cur_selected_gr_object.GraphicObj;
if(chart.chartTitle)
chart.chartTitle.deselect();
if(chart.hAxisTitle)
chart.hAxisTitle.deselect();
if(chart.vAxisTitle)
chart.vAxisTitle.deselect();
var _card_direction = _cur_selected_gr_object.numberToCardDirection(_hit_to_handle.handleNum);
for(var _selected_index = 0; _selected_index < _common_selection_array.length; ++_selected_index)
if(_hit_to_handle.handleRotate === false)
{
this.graphicObjects.arrPreTrackObjects.push(new CTrackHandleObject(_common_selection_array[_selected_index], _card_direction, _common_selection_array[_selected_index].pageIndex));
this.graphicObjects.drawingDocument.SetCursorType(_cur_selected_gr_object.getCursorTypeByNum(_hit_to_handle.handleNum));
}
else
{
this.graphicObjects.drawingDocument.SetCursorType("crosshair");
}
return true;
}
}
this.graphicObjects.changeCurrentState(new PreResizeState(this.graphicObjects, _hit_to_handle.handleNum));
return;
}
var graphic_arrays;
if(this.graphicObjects.document.CurPos.Type !== docpostype_HdrFtr)
{
var page = this.graphicObjects.graphicPages[pageIndex];
graphic_arrays = [page.beforeTextObjects, page.inlineObjects, page.wrappingObjects, page.behindDocObjects];
}
else
{
var hdr_ftr_objects = this.graphicObjects.getHdrFtrObjectsByPageIndex(pageIndex);
if(isRealObject(hdr_ftr_objects))
{
graphic_arrays = [hdr_ftr_objects.beforeTextArray, hdr_ftr_objects.inlineArray, hdr_ftr_objects.wrappingArray, hdr_ftr_objects.behindDocArray];
}
}
if(isRealObject(graphic_arrays))
{
var _cur_page = _graphic_pages[pageIndex];
var beforeTextArray = _cur_page.beforeTextObjects;
var beforeTextArray = graphic_arrays[0];
for(var _object_index = beforeTextArray.length - 1; _object_index > -1; --_object_index)
{
var _current_graphic_object = beforeTextArray[_object_index];
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
{
var _hit = _current_graphic_object.hit(x, y);
var _hit_to_path = _current_graphic_object.hitToPath(x, y);
var _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
......@@ -4398,108 +4433,19 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(_current_graphic_object.selected === false)
{
for(var _sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push( _current_graphic_object);
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
_common_selection_array.sort(ComparisonByZIndex);
this.graphicObjects.arrPreTrackObjects.length = 0;
this.graphicObjects.arrPreTrackObjects[0] = new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x , _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex);
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, false));
return;
}
else
{
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
if(_common_selection_array[_sel_index].pageIndex === pageIndex)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
}
if(_common_selection_array.length === 1)
{
var pre_track =_common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
}
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, true));
return;
}
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
return;
if(_current_graphic_object.selected === false)
{
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
_common_selection_array.sort(ComparisonByZIndex);
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
}
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
if(_common_selection_array[_sel_index].pageIndex === pageIndex)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
}
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, true, false));
return;
this.graphicObjects.drawingDocument.SetCursorType("default");
else
this.graphicObjects.drawingDocument.SetCursorType("move");
}
return true;
}
else if(b_hit_to_text)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_common_selection_array[_sel_index].deselect();
}
_common_selection_array.length = 0;
_common_selection_array.push(_current_graphic_object);
_current_graphic_object.select(pageIndex);
if(!_current_graphic_object.isGroup())
{
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
......@@ -4512,130 +4458,69 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
_current_graphic_object.selectionSetStart(x, y, e);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
var Xt = tmp2.TransformPointX(x, y);
var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
else
{
var sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function")
var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof obj.getArrContentDrawingObjects === "function")
{
arr_inline_objects = sp.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
arr_inline_objects = obj.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
}
sp.selectionSetStart(x, y, e);
sp.select(pageIndex);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(sp);
this.graphicObjects.changeCurrentState(new TextAddInGroup(this.graphicObjects, sp, _current_graphic_object.GraphicObj));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
}
return;
}
}
else
{
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true)
{
return;
tmp2 = global_MatrixTransformer.Invert(obj.transformText);
Xt = tmp2.TransformPointX(x, y);
Yt = tmp2.TransformPointY(x, y);
obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
return true;
}
}
var inline_objects = _cur_page.inlineObjects;
var inline_objects = graphic_arrays[1];
for(_object_index = inline_objects.length - 1; _object_index > -1; --_object_index)
{
_current_graphic_object = inline_objects[_object_index];
if(!_current_graphic_object.isShapeChild())
{
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
{
_hit = _current_graphic_object.hit(x, y);
_hit_to_path = _current_graphic_object.hitToPath(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
......@@ -4645,648 +4530,285 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey))
{
var b_sel = _current_graphic_object.selected;
if(_current_graphic_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, _current_graphic_object.Get_Id(), false, b_sel));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === _current_graphic_object)
{
b_sel = _current_graphic_object.selected;
if(_current_graphic_object.selected === false)
{
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
this.graphicObjects.drawingDocument.SetCursorType("move");
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, _current_graphic_object.Get_Id(), false, b_sel));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
else
{
this.graphicObjects.drawingDocument.SetCursorType("default");
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
return true;
}
else if(b_hit_to_text)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_common_selection_array[_sel_index].deselect();
}
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
if(!_current_graphic_object.isGroup())
{
arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
_current_graphic_object.selectionSetStart(x, y, e);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object));
var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
var Xt = tmp2.TransformPointX(x, y);
var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
else
{
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function")
var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof obj.getArrContentDrawingObjects === "function")
{
arr_inline_objects = sp.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
arr_inline_objects = obj.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
return true;
}
sp.selectionSetStart(x, y, e);
sp.select(pageIndex);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(sp);
this.graphicObjects.changeCurrentState(new TextAddInGroup(this.graphicObjects, sp, _current_graphic_object.GraphicObj));
}
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
tmp2 = global_MatrixTransformer.Invert(obj.transformText);
Xt = tmp2.TransformPointX(x, y);
Yt = tmp2.TransformPointY(x, y);
obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
else
{
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true)
return;
return true;
}
}
}
var wrapping_array = _cur_page.wrappingObjects;
for(_object_index = wrapping_array.length - 1; _object_index > -1; --_object_index)
if(!bTextFlag)
{
_current_graphic_object = wrapping_array[_object_index];
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
var wrapping_array = graphic_arrays[2];
for(var _object_index = wrapping_array.length - 1; _object_index > -1; --_object_index)
{
_hit = _current_graphic_object.hit(x, y);
_hit_to_path = _current_graphic_object.hitToPath(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect;
var _current_graphic_object = wrapping_array[_object_index];
var _hit = _current_graphic_object.hit(x, y);
var _hit_to_path = _current_graphic_object.hitToPath(x, y);
var _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
var b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect;
if((_hit && !b_hit_to_text) || _hit_to_path)
{
this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(_current_graphic_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
this.graphicObjects.arrPreTrackObjects.length = 0;
this.graphicObjects.arrPreTrackObjects[0] = new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x , _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex);
if(_common_selection_array.length === 1)
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
this.graphicObjects.drawingDocument.SetCursorType("default");
else
this.graphicObjects.drawingDocument.SetCursorType("move");
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, false));
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
else
else if(b_hit_to_text)
{
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
if(!_current_graphic_object.isGroup())
{
if(_common_selection_array[_sel_index].pageIndex === pageIndex)
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
}
if(_common_selection_array.length === 1)
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, true));
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
return;
if(_current_graphic_object.selected === false)
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
_common_selection_array.sort(ComparisonByZIndex);
}
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, true, false));
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
}
else if(b_hit_to_text)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_common_selection_array[_sel_index].deselect();
}
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
if(!_current_graphic_object.isGroup())
{
arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
_current_graphic_object.selectionSetStart(x, y, e);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
var Xt = tmp2.TransformPointX(x, y);
var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
else
{
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function")
var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof obj.getArrContentDrawingObjects === "function")
{
arr_inline_objects = sp.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
arr_inline_objects = obj.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
sp.selectionSetStart(x, y, e);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(sp);
sp.select(pageIndex);
this.graphicObjects.changeCurrentState(new TextAddInGroup(this.graphicObjects, sp, _current_graphic_object.GraphicObj));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
return true;
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
}
else
{
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true)
{
return;
tmp2 = global_MatrixTransformer.Invert(obj.transformText);
Xt = tmp2.TransformPointX(x, y);
Yt = tmp2.TransformPointY(x, y);
obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
return true;
}
}
var behind_array = _cur_page.behindDocObjects;
for(_object_index = behind_array.length - 1; _object_index > -1; --_object_index)
{
_current_graphic_object = behind_array[_object_index];
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
var behind_array = graphic_arrays[3];
for(var _object_index = behind_array.length - 1; _object_index > -1; --_object_index)
{
_hit = _current_graphic_object.hit(x, y);
_hit_to_path = _current_graphic_object.hitToPath(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect;
var _current_graphic_object = behind_array[_object_index];
var _hit = _current_graphic_object.hit(x, y);
var _hit_to_path = _current_graphic_object.hitToPath(x, y);
var _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
var b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect;
if((_hit && !b_hit_to_text) || _hit_to_path)
{
this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(_current_graphic_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
this.graphicObjects.arrPreTrackObjects.length = 0;
this.graphicObjects.arrPreTrackObjects[0] = new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x , _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex);
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, false));
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
}
else
{
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
if(_common_selection_array[_sel_index].pageIndex === pageIndex)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
}
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, false, true));
return;
}
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
return;
if(_current_graphic_object.selected === false)
{
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
_common_selection_array.sort(ComparisonByZIndex);
}
this.graphicObjects.arrPreTrackObjects.length = 0;
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_current_graphic_object = _common_selection_array[_sel_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex));
}
if(_common_selection_array.length === 1)
{
var pre_track = _common_selection_array[0];
pre_track.calculateOffset();
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ;
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ;
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
}
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.changeCurrentState(new PreMoveState(this.graphicObjects, true, false));
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
this.graphicObjects.drawingDocument.SetCursorType("default");
else
this.graphicObjects.drawingDocument.SetCursorType("move");
}
return true;
}
else if(b_hit_to_text)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{
_common_selection_array[_sel_index].deselect();
}
_common_selection_array.length = 0;
_current_graphic_object.select(pageIndex);
_common_selection_array.push(_current_graphic_object);
if(!_current_graphic_object.isGroup())
{
arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
_current_graphic_object.selectionSetStart(x, y, e);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
var Xt = tmp2.TransformPointX(x, y);
var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
else
{
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function")
var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof obj.getArrContentDrawingObjects === "function")
{
arr_inline_objects = sp.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
arr_inline_objects = obj.getArrContentDrawingObjects();
for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
{
cur_inline_object = arr_inline_objects[inline_index];
var cur_inline_object = arr_inline_objects[inline_index];
_hit = cur_inline_object.hit(x, y);
if(_hit)
{
this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey))
{
if(cur_inline_object.selected === false)
{
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
else
{
if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{
if(cur_inline_object.selected === false)
{
cur_inline_object.select(pageIndex);
_common_selection_array.push(cur_inline_object);
}
this.graphicObjects.changeCurrentState(new PreMoveInlineObject(this.graphicObjects, cur_inline_object.Get_Id(), false, false));
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
this.graphicObjects.drawingDocument.SetCursorType("move");
}
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
return true;
}
}
}
_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num].selectionSetStart(x, y, e);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]);
_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num].select(pageIndex);
this.graphicObjects.changeCurrentState(new TextAddInGroup(this.graphicObjects, _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num], _current_graphic_object.GraphicObj));
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
}
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
tmp2 = global_MatrixTransformer.Invert(obj.transformText);
Xt = tmp2.TransformPointX(x, y);
Yt = tmp2.TransformPointY(x, y);
obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
}
return true;
}
else
{
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true)
{
return;
}
}
}
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
_common_selection_array[_sel_index].deselect();
_common_selection_array.length = 0;
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay();
return false;
};
}
......
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