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) ...@@ -4337,17 +4337,42 @@ function ChartState(graphicObjects, chart)
this.updateCursorType = function(pageIndex, x, y, e, bTextFlag) this.updateCursorType = function(pageIndex, x, y, e, bTextFlag)
{ {
this.id = STATES_ID_CHART; if(this.graphicObjects.document.CurPos.Type === docpostype_HdrFtr)
this.graphicObjects = graphicObjects; {
this.chart = chart;//ParaDrawing var hdr_ftr_state = new NullStateHeaderFooter(this.graphicObjects);
this.graphicObjects.setStartTrackPos(x, y, pageIndex); return hdr_ftr_state.updateCursorType(pageIndex, x, y, e, bTextFlag);
}
var _graphic_pages = this.graphicObjects.graphicPages; var _graphic_pages = this.graphicObjects.graphicPages;
var _common_selection_array = this.graphicObjects.selectionInfo.selectionArray; var _common_selection_array = this.graphicObjects.selectionInfo.selectionArray;
if(_common_selection_array.length > 0)
var _translated_point; {
if(_common_selection_array.length === 1)
{
var _selected_gr_object = _common_selection_array[0];
var _translated_x; var _translated_x;
var _translated_y; 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) if(_cur_selected_gr_object.pageIndex !== pageIndex)
{ {
_translated_point = this.graphicObjects.drawingDocument.ConvertCoordsToAnotherPage(x, y, pageIndex, _cur_selected_gr_object.pageIndex); _translated_point = this.graphicObjects.drawingDocument.ConvertCoordsToAnotherPage(x, y, pageIndex, _cur_selected_gr_object.pageIndex);
...@@ -4364,31 +4389,41 @@ function ChartState(graphicObjects, chart) ...@@ -4364,31 +4389,41 @@ function ChartState(graphicObjects, chart)
{ {
this.graphicObjects.majorGraphicObject = _cur_selected_gr_object; this.graphicObjects.majorGraphicObject = _cur_selected_gr_object;
this.graphicObjects.arrPreTrackObjects.length = 0; this.graphicObjects.arrPreTrackObjects.length = 0;
var chart = _cur_selected_gr_object.GraphicObj; if(_hit_to_handle.handleRotate === false)
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)
{ {
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 _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) for(var _object_index = beforeTextArray.length - 1; _object_index > -1; --_object_index)
{ {
var _current_graphic_object = beforeTextArray[_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 = _current_graphic_object.hit(x, y);
var _hit_to_path = _current_graphic_object.hitToPath(x, y); var _hit_to_path = _current_graphic_object.hitToPath(x, y);
var _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y); var _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
...@@ -4398,108 +4433,19 @@ function ChartState(graphicObjects, chart) ...@@ -4398,108 +4433,19 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = _current_graphic_object; this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(_current_graphic_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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;
}
} }
else else
{ {
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline())) if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
return; this.graphicObjects.drawingDocument.SetCursorType("default");
if(_current_graphic_object.selected === false) else
{ this.graphicObjects.drawingDocument.SetCursorType("move");
_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;
} }
return true;
} }
else if(b_hit_to_text) 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()) if(!_current_graphic_object.isGroup())
{ {
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects(); var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
...@@ -4512,130 +4458,69 @@ function ChartState(graphicObjects, chart) ...@@ -4512,130 +4458,69 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
_current_graphic_object.selectionSetStart(x, y, e); var Xt = tmp2.TransformPointX(x, y);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object)); var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
if(e.ClickCount <= 1)
this.graphicObjects.updateSelectionState();
} }
else else
{ {
var sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]; var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function") if(typeof obj.getArrContentDrawingObjects === "function")
{ {
arr_inline_objects = sp.getArrContentDrawingObjects(); arr_inline_objects = obj.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index) 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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
} }
tmp2 = global_MatrixTransformer.Invert(obj.transformText);
sp.selectionSetStart(x, y, e); Xt = tmp2.TransformPointX(x, y);
sp.select(pageIndex); Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(sp); obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
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;
} }
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) for(_object_index = inline_objects.length - 1; _object_index > -1; --_object_index)
{ {
_current_graphic_object = inline_objects[_object_index]; _current_graphic_object = inline_objects[_object_index];
if(!_current_graphic_object.isShapeChild()) if(!_current_graphic_object.isShapeChild())
{ {
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
{
_hit = _current_graphic_object.hit(x, y); _hit = _current_graphic_object.hit(x, y);
_hit_to_path = _current_graphic_object.hitToPath(x, y); _hit_to_path = _current_graphic_object.hitToPath(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y); _hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y);
...@@ -4645,648 +4530,285 @@ function ChartState(graphicObjects, chart) ...@@ -4645,648 +4530,285 @@ function ChartState(graphicObjects, chart)
this.graphicObjects.majorGraphicObject = _current_graphic_object; this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
var b_sel = _current_graphic_object.selected; this.graphicObjects.drawingDocument.SetCursorType("move");
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;
} }
else else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === _current_graphic_object) _common_selection_array.length === 1 && _common_selection_array[0] === _current_graphic_object)
{ {
b_sel = _current_graphic_object.selected; this.graphicObjects.drawingDocument.SetCursorType("move");
if(_current_graphic_object.selected === false)
{
_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)); else
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay(); {
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) 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()) if(!_current_graphic_object.isGroup())
{ {
var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects(); for(var inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index)
for(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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
_current_graphic_object.selectionSetStart(x, y, e); var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object)); var Xt = tmp2.TransformPointX(x, y);
var Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
} }
else else
{ {
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]; var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function") if(typeof obj.getArrContentDrawingObjects === "function")
{ {
arr_inline_objects = sp.getArrContentDrawingObjects(); arr_inline_objects = obj.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index) 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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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;
} }
} }
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 return true;
{
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true)
return;
} }
} }
} }
var wrapping_array = _cur_page.wrappingObjects; if(!bTextFlag)
for(_object_index = wrapping_array.length - 1; _object_index > -1; --_object_index)
{ {
_current_graphic_object = wrapping_array[_object_index]; var wrapping_array = graphic_arrays[2];
for(var _object_index = wrapping_array.length - 1; _object_index > -1; --_object_index)
if(!(_current_graphic_object.GraphicObj instanceof CChartAsGroup))
{ {
_hit = _current_graphic_object.hit(x, y); var _current_graphic_object = wrapping_array[_object_index];
_hit_to_path = _current_graphic_object.hitToPath(x, y); var _hit = _current_graphic_object.hit(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y); var _hit_to_path = _current_graphic_object.hitToPath(x, y);
b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect; 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) if((_hit && !b_hit_to_text) || _hit_to_path)
{ {
this.graphicObjects.majorGraphicObject = _current_graphic_object; this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(_current_graphic_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{ }
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index) else
_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]; if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
pre_track.calculateOffset(); this.graphicObjects.drawingDocument.SetCursorType("default");
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ; else
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ; this.graphicObjects.drawingDocument.SetCursorType("move");
this.anchorPos = pre_track.Get_AnchorPos();
this.anchorPos.Page = pageIndex;
} }
this.graphicObjects.drawingDocument.m_oWordControl.OnUpdateOverlay(); return true;
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 else if(b_hit_to_text)
{ {
this.graphicObjects.arrPreTrackObjects.length = 0; if(!_current_graphic_object.isGroup())
for(_sel_index = 0; _sel_index < _common_selection_array.length; ++_sel_index)
{ {
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]; var cur_inline_object = arr_inline_objects[inline_index];
this.graphicObjects.arrPreTrackObjects.push(new CTrackMoveObject(_current_graphic_object, _current_graphic_object.absOffsetX - x, _current_graphic_object.absOffsetY - y, this.graphicObjects, pageIndex)); _hit = cur_inline_object.hit(x, y);
} if(_hit)
}
if(_common_selection_array.length === 1)
{ {
var pre_track = _common_selection_array[0]; this.graphicObjects.majorGraphicObject = cur_inline_object;
pre_track.calculateOffset(); if(!(e.CtrlKey || e.ShiftKey))
var boundsOffX = pre_track.absOffsetX - pre_track.boundsOffsetX ; {
var boundsOffY = pre_track.absOffsetY - pre_track.boundsOffsetY ; this.graphicObjects.drawingDocument.SetCursorType("move");
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;
}
} }
else else
{ {
if(_common_selection_array.length === 0 ||
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline())) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
return;
if(_current_graphic_object.selected === false)
{ {
_current_graphic_object.select(pageIndex); this.graphicObjects.drawingDocument.SetCursorType("move");
_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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
_current_graphic_object.selectionSetStart(x, y, e); var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object)); var Xt = tmp2.TransformPointX(x, y);
if(e.ClickCount <= 1) var Yt = tmp2.TransformPointY(x, y);
this.graphicObjects.updateSelectionState(); _current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
} }
else else
{ {
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]; var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function") if(typeof obj.getArrContentDrawingObjects === "function")
{ {
arr_inline_objects = sp.getArrContentDrawingObjects(); arr_inline_objects = obj.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index) 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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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;
}
} }
} }
sp.selectionSetStart(x, y, e); return true;
_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();
} }
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
else tmp2 = global_MatrixTransformer.Invert(obj.transformText);
{ Xt = tmp2.TransformPointX(x, y);
if(handleChart(_current_graphic_object, this.graphicObjects, x, y, e, pageIndex) === true) Yt = tmp2.TransformPointY(x, y);
{ obj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
return;
} }
return true;
} }
} }
var behind_array = _cur_page.behindDocObjects; var behind_array = graphic_arrays[3];
for(_object_index = behind_array.length - 1; _object_index > -1; --_object_index) for(var _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))
{ {
_hit = _current_graphic_object.hit(x, y); var _current_graphic_object = behind_array[_object_index];
_hit_to_path = _current_graphic_object.hitToPath(x, y); var _hit = _current_graphic_object.hit(x, y);
_hit_to_text_rect = _current_graphic_object.hitToTextRect(x, y); var _hit_to_path = _current_graphic_object.hitToPath(x, y);
b_hit_to_text = _current_graphic_object.isGroup() ? _hit_to_text_rect.hit : _hit_to_text_rect; 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) if((_hit && !b_hit_to_text) || _hit_to_path)
{ {
this.graphicObjects.majorGraphicObject = _current_graphic_object; this.graphicObjects.majorGraphicObject = _current_graphic_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(_current_graphic_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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;
}
} }
else else
{ {
if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline())) if((_common_selection_array.length > 0 && _common_selection_array[0].Is_Inline()))
return; this.graphicObjects.drawingDocument.SetCursorType("default");
if(_current_graphic_object.selected === false) else
{ this.graphicObjects.drawingDocument.SetCursorType("move");
_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;
} }
return true;
} }
else if(b_hit_to_text) 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()) if(!_current_graphic_object.isGroup())
{ {
arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects(); var arr_inline_objects = _current_graphic_object.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index) 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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
_current_graphic_object.selectionSetStart(x, y, e); var tmp2 = global_MatrixTransformer.Invert(_current_graphic_object.GraphicObj.transformText);
this.graphicObjects.changeCurrentState(new TextAddState(this.graphicObjects, _current_graphic_object)); var Xt = tmp2.TransformPointX(x, y);
if(e.ClickCount <= 1) var Yt = tmp2.TransformPointY(x, y);
this.graphicObjects.updateSelectionState(); _current_graphic_object.GraphicObj.textBoxContent.Update_CursorType(Xt, Yt, pageIndex);
} }
else else
{ {
sp = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]; var obj = _current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num];
if(typeof sp.getArrContentDrawingObjects === "function") if(typeof obj.getArrContentDrawingObjects === "function")
{ {
arr_inline_objects = sp.getArrContentDrawingObjects(); arr_inline_objects = obj.getArrContentDrawingObjects();
for(inline_index = 0; inline_index < arr_inline_objects.length; ++inline_index) 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); _hit = cur_inline_object.hit(x, y);
if(_hit) if(_hit)
{ {
this.graphicObjects.majorGraphicObject = cur_inline_object; this.graphicObjects.majorGraphicObject = cur_inline_object;
if(!(e.CtrlKey || e.ShiftKey)) if(!(e.CtrlKey || e.ShiftKey))
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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 else
{ {
if(_common_selection_array.length === 0 || if(_common_selection_array.length === 0 ||
_common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object) _common_selection_array.length === 1 && _common_selection_array[0] === cur_inline_object)
{ {
if(cur_inline_object.selected === false) this.graphicObjects.drawingDocument.SetCursorType("move");
{
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();
} }
} }
return true;
editor.asc_fireCallback("asc_canGroup", this.graphicObjects.canGroup());
editor.asc_fireCallback("asc_canUnGroup", this.graphicObjects.canUnGroup());
return;
} }
} }
} }
_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num].selectionSetStart(x, y, e); tmp2 = global_MatrixTransformer.Invert(obj.transformText);
Xt = tmp2.TransformPointX(x, y);
_current_graphic_object.GraphicObj.selectionInfo.selectionArray.push(_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num]); Yt = tmp2.TransformPointY(x, y);
_current_graphic_object.GraphicObj.spTree[_hit_to_text_rect.num].select(pageIndex); obj.textBoxContent.Update_CursorType(Xt, Yt, 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;
} }
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; 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