Commit 5b1016b8 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 26121 - Курсор устанавливается внутри заголовка диаграммы, если он выходит за границы диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58523 954022d7-b5bf-4e40-9824-e11837661b57
parent de667c7d
...@@ -205,67 +205,70 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -205,67 +205,70 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
case historyitem_type_ChartSpace: case historyitem_type_ChartSpace:
{ {
var ret, i, title; var ret, i, title;
var chart_titles = cur_grouped_object.getAllTitles(); if(cur_grouped_object.hit(x, y))
for(i = 0; i < chart_titles.length; ++i)
{ {
title = chart_titles[i]; var chart_titles = cur_grouped_object.getAllTitles();
var hit_in_inner_area = title.hitInInnerArea(x, y); for(i = 0; i < chart_titles.length; ++i)
var hit_in_path = title.hitInPath(x, y);
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE) title = chart_titles[i];
var hit_in_inner_area = title.hitInInnerArea(x, y);
var hit_in_path = title.hitInPath(x, y);
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
drawingObjectsController.checkChartTextSelection(); if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.groupSelection = drawing;
drawing.selectObject(cur_grouped_object, pageIndex);
drawing.chartSelection = cur_grouped_object;
drawing.selection.title = title;
cur_grouped_object.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
}
}
else if(hit_in_text_rect)
{
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
drawingObjectsController.checkChartTextSelection();
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.groupSelection = drawing;
drawing.selectObject(cur_grouped_object, pageIndex);
drawing.selection.chartSelection = cur_grouped_object;
cur_grouped_object.selectTitle(title, pageIndex);
cur_grouped_object.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{ {
drawingObjectsController.checkChartTextSelection();
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.groupSelection = drawing;
drawing.selectObject(cur_grouped_object, pageIndex);
drawing.chartSelection = cur_grouped_object;
drawing.selection.title = title;
cur_grouped_object.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
} }
return true;
} }
else else if(hit_in_text_rect)
{ {
if(drawingObjectsController.document) if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{ {
var content = title.getDocContent(); drawingObjectsController.checkChartTextSelection();
var invert_transform_text = title.invertTransformText, tx, ty; drawingObjectsController.resetSelection();
if(content && invert_transform_text) drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.groupSelection = drawing;
drawing.selectObject(cur_grouped_object, pageIndex);
drawing.selection.chartSelection = cur_grouped_object;
cur_grouped_object.selectTitle(title, pageIndex);
cur_grouped_object.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{ {
tx = invert_transform_text.TransformPointX(x, y); drawingObjectsController.updateSelectionState();
ty = invert_transform_text.TransformPointY(x, y);
content.Update_CursorType(tx, ty, pageIndex);
} }
return true;
}
else
{
if(drawingObjectsController.document)
{
var content = title.getDocContent();
var invert_transform_text = title.invertTransformText, tx, ty;
if(content && invert_transform_text)
{
tx = invert_transform_text.TransformPointX(x, y);
ty = invert_transform_text.TransformPointY(x, y);
content.Update_CursorType(tx, ty, pageIndex);
}
}
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
} }
} }
...@@ -282,66 +285,70 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde ...@@ -282,66 +285,70 @@ function handleGroup(drawing, drawingObjectsController, e, x, y, group, pageInde
function handleChart(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord) function handleChart(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord)
{ {
var ret, i, title; var ret, i, title;
var chart_titles = drawing.getAllTitles(); if(drawing.hit(x, y))
var selector = group ? group : drawingObjectsController;
for(i = 0; i < chart_titles.length; ++i)
{ {
title = chart_titles[i]; var chart_titles = drawing.getAllTitles();
var hit_in_inner_area = title.hitInInnerArea(x, y); var selector = group ? group : drawingObjectsController;
var hit_in_path = title.hitInPath(x, y); for(i = 0; i < chart_titles.length; ++i)
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
var is_selected = drawing.selected;
drawingObjectsController.checkChartTextSelection();
selector.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
}
}
else if(hit_in_text_rect)
{ {
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE) title = chart_titles[i];
var hit_in_inner_area = title.hitInInnerArea(x, y);
var hit_in_path = title.hitInPath(x, y);
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
drawingObjectsController.checkChartTextSelection(); if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
selector.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{ {
var is_selected = drawing.selected;
drawingObjectsController.checkChartTextSelection();
selector.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
} }
return true;
} }
else else if(hit_in_text_rect)
{ {
if(drawingObjectsController.document) if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
drawingObjectsController.checkChartTextSelection();
selector.resetSelection();
selector.selectObject(drawing, pageIndex);
selector.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{
drawingObjectsController.updateSelectionState();
}
return true;
}
else
{ {
var content = title.getDocContent(); if(drawingObjectsController.document)
var invert_transform_text = title.invertTransformText, tx, ty;
if(content && invert_transform_text)
{ {
tx = invert_transform_text.TransformPointX(x, y); var content = title.getDocContent();
ty = invert_transform_text.TransformPointY(x, y); var invert_transform_text = title.invertTransformText, tx, ty;
content.Update_CursorType(tx, ty, pageIndex); if(content && invert_transform_text)
{
tx = invert_transform_text.TransformPointX(x, y);
ty = invert_transform_text.TransformPointY(x, y);
content.Update_CursorType(tx, ty, pageIndex);
}
} }
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
} }
} }
ret = handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord); ret = handleShapeImage(drawing, drawingObjectsController, e, x, y, group, pageIndex, bWord);
...@@ -377,64 +384,67 @@ function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, page ...@@ -377,64 +384,67 @@ function handleInlineShapeImage(drawing, drawingObjectsController, e, x, y, page
function handleInlineChart(drawing, drawingObjectsController, e, x, y, pageIndex) function handleInlineChart(drawing, drawingObjectsController, e, x, y, pageIndex)
{ {
var ret, i, title; if(drawing.hit(x, y))
var chart_titles = drawing.getAllTitles();
for(i = 0; i < chart_titles.length; ++i)
{ {
title = chart_titles[i]; var ret, i, title;
var hit_in_inner_area = title.hitInInnerArea(x, y); var chart_titles = drawing.getAllTitles();
var hit_in_path = title.hitInPath(x, y); for(i = 0; i < chart_titles.length; ++i)
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
var is_selected = drawing.selected;
drawingObjectsController.checkChartTextSelection();
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
}
}
else if(hit_in_text_rect)
{ {
if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE) title = chart_titles[i];
var hit_in_inner_area = title.hitInInnerArea(x, y);
var hit_in_path = title.hitInPath(x, y);
var hit_in_text_rect = title.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
drawingObjectsController.checkChartTextSelection(); if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{ {
var is_selected = drawing.selected;
drawingObjectsController.checkChartTextSelection();
drawingObjectsController.resetSelection();
drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawingObjectsController.updateSelectionState(); drawingObjectsController.updateSelectionState();
return true;
}
else
{
return {objectId: drawing.Get_Id(), cursorType: "move", bMarker: false};
} }
return true;
} }
else else if(hit_in_text_rect)
{ {
if(drawingObjectsController.document) if(drawingObjectsController.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{ {
var content = title.getDocContent(); drawingObjectsController.checkChartTextSelection();
var invert_transform_text = title.invertTransformText, tx, ty; drawingObjectsController.resetSelection();
if(content && invert_transform_text) drawingObjectsController.selectObject(drawing, pageIndex);
drawingObjectsController.selection.chartSelection = drawing;
drawing.selectTitle(title, pageIndex);
drawing.selection.textSelection = title;
title.selectionSetStart(e, x, y, pageIndex);
drawingObjectsController.changeCurrentState(new TextAddState(drawingObjectsController, title));
if(e.ClickCount <= 1)
{ {
tx = invert_transform_text.TransformPointX(x, y); drawingObjectsController.updateSelectionState();
ty = invert_transform_text.TransformPointY(x, y); }
content.Update_CursorType(tx, ty, pageIndex); return true;
}
else
{
if(drawingObjectsController.document)
{
var content = title.getDocContent();
var invert_transform_text = title.invertTransformText, tx, ty;
if(content && invert_transform_text)
{
tx = invert_transform_text.TransformPointX(x, y);
ty = invert_transform_text.TransformPointY(x, y);
content.Update_CursorType(tx, ty, pageIndex);
}
} }
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
return {objectId: drawing.Get_Id(), cursorType: "text"};
} }
} }
} }
......
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