Commit cb119576 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с передвижением и добавлением автофигур в ячейку таблицы (баг...

Исправлен баг с передвижением и добавлением автофигур в ячейку таблицы (баг 28024). Исправлен баг с передвижением автофигуры по странице (баг 28015).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60255 954022d7-b5bf-4e40-9824-e11837661b57
parent 2de7d7e3
...@@ -571,7 +571,10 @@ RotateState.prototype = ...@@ -571,7 +571,10 @@ RotateState.prototype =
var original = this.drawingObjects.arrTrackObjects[i].originalObject; var original = this.drawingObjects.arrTrackObjects[i].originalObject;
original.parent.Update_Size(bounds.extX, bounds.extY); original.parent.Update_Size(bounds.extX, bounds.extY);
arr_nearest_pos[i].Paragraph.Check_NearestPos(arr_nearest_pos[i]); arr_nearest_pos[i].Paragraph.Check_NearestPos(arr_nearest_pos[i]);
original.parent.Remove_FromDocument(false);
// На удалении включаем пересчет из-за бага (28015), чтобы во время добавления автофигуры на эту же страницу
// расположение всех элементов было рассчитано с уже удаленной автофигурой.
original.parent.Remove_FromDocument(true);
original.parent.Set_XYForAdd(bounds.posX, bounds.posY, arr_nearest_pos[i], original.selectStartPage); original.parent.Set_XYForAdd(bounds.posX, bounds.posY, arr_nearest_pos[i], original.selectStartPage);
} }
......
...@@ -3126,11 +3126,13 @@ function CAnchorPosition() ...@@ -3126,11 +3126,13 @@ function CAnchorPosition()
this.Margin_V = 0; this.Margin_V = 0;
this.LineTop = 0; this.LineTop = 0;
this.ParagraphTop = 0; this.ParagraphTop = 0;
this.Page_X = 0;
this.Page_Y = 0;
} }
CAnchorPosition.prototype = CAnchorPosition.prototype =
{ {
Set : function(W, H, YOffset, ParaLayout) Set : function(W, H, YOffset, ParaLayout, PageLimits)
{ {
this.W = W; this.W = W;
this.H = H; this.H = H;
...@@ -3153,9 +3155,11 @@ CAnchorPosition.prototype = ...@@ -3153,9 +3155,11 @@ CAnchorPosition.prototype =
this.Margin_V = ParaLayout.Margin_V; this.Margin_V = ParaLayout.Margin_V;
this.LineTop = ParaLayout.LineTop; this.LineTop = ParaLayout.LineTop;
this.ParagraphTop = ParaLayout.ParagraphTop; this.ParagraphTop = ParaLayout.ParagraphTop;
this.Page_X = PageLimits.X;
this.Page_Y = PageLimits.Y;
}, },
Calculate_X : function(bInline, RelativeFrom, bAlign, Value, PageLimits) Calculate_X : function(bInline, RelativeFrom, bAlign, Value)
{ {
if ( true === bInline ) if ( true === bInline )
{ {
...@@ -3337,7 +3341,7 @@ CAnchorPosition.prototype = ...@@ -3337,7 +3341,7 @@ CAnchorPosition.prototype =
} }
} }
else else
this.CalcX = Value + PageLimits.X; this.CalcX = Value + this.Page_X;
break; break;
} }
...@@ -3383,7 +3387,7 @@ CAnchorPosition.prototype = ...@@ -3383,7 +3387,7 @@ CAnchorPosition.prototype =
return this.CalcX; return this.CalcX;
}, },
Calculate_Y : function(bInline, RelativeFrom, bAlign, Value, PageLimits) Calculate_Y : function(bInline, RelativeFrom, bAlign, Value)
{ {
if ( true === bInline ) if ( true === bInline )
{ {
...@@ -3526,7 +3530,7 @@ CAnchorPosition.prototype = ...@@ -3526,7 +3530,7 @@ CAnchorPosition.prototype =
} }
} }
else else
this.CalcY = Value + PageLimits.Y; this.CalcY = Value + this.Page_Y;
break; break;
} }
...@@ -3688,7 +3692,7 @@ CAnchorPosition.prototype = ...@@ -3688,7 +3692,7 @@ CAnchorPosition.prototype =
case c_oAscRelativeFromH.Page: case c_oAscRelativeFromH.Page:
{ {
Value = this.CalcX; Value = this.CalcX - this.Page_X;
break; break;
} }
...@@ -3736,7 +3740,7 @@ CAnchorPosition.prototype = ...@@ -3736,7 +3740,7 @@ CAnchorPosition.prototype =
case c_oAscRelativeFromV.Page: case c_oAscRelativeFromV.Page:
{ {
Value = this.CalcY; Value = this.CalcY - this.Page_Y;
break; break;
} }
...@@ -4411,9 +4415,9 @@ ParaDrawing.prototype = ...@@ -4411,9 +4415,9 @@ ParaDrawing.prototype =
else else
H = this.getXfrmExtY(); H = this.getXfrmExtY();
} }
this.Internal_Position.Set( W, H, this.YOffset, ParaLayout); this.Internal_Position.Set( W, H, this.YOffset, ParaLayout, PageLimitsOrigin);
this.Internal_Position.Calculate_X(bInline, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value, PageLimitsOrigin); this.Internal_Position.Calculate_X(bInline, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value);
this.Internal_Position.Calculate_Y(bInline, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value, PageLimitsOrigin); this.Internal_Position.Calculate_Y(bInline, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value);
this.Internal_Position.Correct_Values(bInline, PageLimits, this.AllowOverlap, this.Use_TextWrap(), OtherFlowObjects); this.Internal_Position.Correct_Values(bInline, PageLimits, this.AllowOverlap, this.Use_TextWrap(), OtherFlowObjects);
var OldPageNum = this.PageNum; var OldPageNum = this.PageNum;
...@@ -4432,7 +4436,7 @@ ParaDrawing.prototype = ...@@ -4432,7 +4436,7 @@ ParaDrawing.prototype =
var Value = this.Internal_Position.Calculate_X_Value(this.PositionH_Old.RelativeFrom); var Value = this.Internal_Position.Calculate_X_Value(this.PositionH_Old.RelativeFrom);
this.Set_PositionH( this.PositionH_Old.RelativeFrom, false, Value ); this.Set_PositionH( this.PositionH_Old.RelativeFrom, false, Value );
// На всякий случай пересчитаем заново координату // На всякий случай пересчитаем заново координату
this.X = this.Internal_Position.Calculate_X(bInline, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value, PageLimitsOrigin); this.X = this.Internal_Position.Calculate_X(bInline, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value);
} }
if ( undefined != this.PositionV_Old ) if ( undefined != this.PositionV_Old )
...@@ -4670,9 +4674,9 @@ ParaDrawing.prototype = ...@@ -4670,9 +4674,9 @@ ParaDrawing.prototype =
var _W = (this.PositionH.Align ? this.W : this.getXfrmExtX() ); var _W = (this.PositionH.Align ? this.W : this.getXfrmExtX() );
var _H = (this.PositionV.Align ? this.H : this.getXfrmExtY() ); var _H = (this.PositionV.Align ? this.H : this.getXfrmExtY() );
this.Internal_Position.Set( _W, _H, this.YOffset, Layout.ParagraphLayout ); this.Internal_Position.Set(_W, _H, this.YOffset, Layout.ParagraphLayout, Layout.PageLimits);
this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X, Layout.PageLimits); this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X - Layout.PageLimits.X);
this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y, Layout.PageLimits); this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y - Layout.PageLimits.Y);
this.Internal_Position.Correct_Values(false, Layout.PageLimits, this.AllowOverlap, this.Use_TextWrap(), []); this.Internal_Position.Correct_Values(false, Layout.PageLimits, this.AllowOverlap, this.Use_TextWrap(), []);
this.PageNum = PageNum; this.PageNum = PageNum;
...@@ -4684,14 +4688,14 @@ ParaDrawing.prototype = ...@@ -4684,14 +4688,14 @@ ParaDrawing.prototype =
this.Set_PositionH( this.PositionH.RelativeFrom, false, ValueX ); this.Set_PositionH( this.PositionH.RelativeFrom, false, ValueX );
// На всякий случай пересчитаем заново координату // На всякий случай пересчитаем заново координату
this.X = this.Internal_Position.Calculate_X(false, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value, Layout.PageLimits); this.X = this.Internal_Position.Calculate_X(false, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value);
// Рассчитаем сдвиг с учетом старой привязки // Рассчитаем сдвиг с учетом старой привязки
var ValueY = this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom); var ValueY = this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom);
this.Set_PositionV( this.PositionV.RelativeFrom, false, ValueY ); this.Set_PositionV( this.PositionV.RelativeFrom, false, ValueY );
// На всякий случай пересчитаем заново координату // На всякий случай пересчитаем заново координату
this.Y = this.Internal_Position.Calculate_Y(false, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value, Layout.PageLimits); this.Y = this.Internal_Position.Calculate_Y(false, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value);
} }
/* /*
...@@ -4788,9 +4792,9 @@ ParaDrawing.prototype = ...@@ -4788,9 +4792,9 @@ ParaDrawing.prototype =
var _W = this.W; var _W = this.W;
var _H = this.H; var _H = this.H;
this.Internal_Position.Set( _W, _H, this.YOffset, Layout.ParagraphLayout ); this.Internal_Position.Set( _W, _H, this.YOffset, Layout.ParagraphLayout, Layout.PageLimits);
this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X, Layout.PageLimits); this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X - Layout.PageLimits.X);
this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y, Layout.PageLimits); this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y - Layout.PageLimits.X);
this.Internal_Position.Correct_Values(false, Layout.PageLimits, this.AllowOverlap, this.Use_TextWrap(), []); this.Internal_Position.Correct_Values(false, Layout.PageLimits, this.AllowOverlap, this.Use_TextWrap(), []);
this.PageNum = PageNum; this.PageNum = PageNum;
...@@ -4802,14 +4806,14 @@ ParaDrawing.prototype = ...@@ -4802,14 +4806,14 @@ ParaDrawing.prototype =
this.Set_PositionH( this.PositionH.RelativeFrom, false, ValueX ); this.Set_PositionH( this.PositionH.RelativeFrom, false, ValueX );
// На всякий случай пересчитаем заново координату // На всякий случай пересчитаем заново координату
this.X = this.Internal_Position.Calculate_X(false, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value, Layout.PageLimits); this.X = this.Internal_Position.Calculate_X(false, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value);
// Рассчитаем сдвиг с учетом старой привязки // Рассчитаем сдвиг с учетом старой привязки
var ValueY = this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom); var ValueY = this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom);
this.Set_PositionV( this.PositionV.RelativeFrom, false, ValueY ); this.Set_PositionV( this.PositionV.RelativeFrom, false, ValueY );
// На всякий случай пересчитаем заново координату // На всякий случай пересчитаем заново координату
this.Y = this.Internal_Position.Calculate_Y(false, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value, Layout.PageLimits); this.Y = this.Internal_Position.Calculate_Y(false, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value);
NearPos.Paragraph.Check_NearestPos( NearPos ); NearPos.Paragraph.Check_NearestPos( NearPos );
......
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