Commit 3dba7939 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51889 954022d7-b5bf-4e40-9824-e11837661b57
parent fcb0b034
...@@ -1436,7 +1436,7 @@ function BinaryPPTYLoader() ...@@ -1436,7 +1436,7 @@ function BinaryPPTYLoader()
_mod.name = s.GetString2(); _mod.name = s.GetString2();
var _find = _mod.name.indexOf(":"); var _find = _mod.name.indexOf(":");
if (_find >= 0 && _find < (_mod.name.length - 1)) if (_find >= 0 && _find < (_mod.name.length - 1))
_mod.name = _mod.name.substring(_find + 1); _mod.name = _mod.name.substring(_find + 1);
} }
else if (1 == _type) else if (1 == _type)
_mod.val = s.GetLong(); _mod.val = s.GetLong();
...@@ -4306,7 +4306,7 @@ function BinaryPPTYLoader() ...@@ -4306,7 +4306,7 @@ function BinaryPPTYLoader()
this.ReadGraphicObject = function() this.ReadGraphicObject = function()
{ {
var s = this.stream; var s = this.stream;
var _type = s.GetUChar(); var _type = s.GetUChar();
var _object = null; var _object = null;
...@@ -4737,10 +4737,10 @@ function BinaryPPTYLoader() ...@@ -4737,10 +4737,10 @@ function BinaryPPTYLoader()
var _end_rec = _rec_start + s.GetULong() + 4; var _end_rec = _rec_start + s.GetULong() + 4;
var _graphic_frame = new CGraphicFrame(this.TempMainObject); var _graphic_frame = new CGraphicFrame(this.TempMainObject);
/* if (null != this.TempGroupObject) /* if (null != this.TempGroupObject)
_graphic_frame.Container = this.TempGroupObject; _graphic_frame.Container = this.TempGroupObject;
else else
_graphic_frame.Container = _graphic_frame.parent.elementsManipulator; */ _graphic_frame.Container = _graphic_frame.parent.elementsManipulator; */
this.TempGroupObject = _graphic_frame; this.TempGroupObject = _graphic_frame;
...@@ -5063,7 +5063,7 @@ function BinaryPPTYLoader() ...@@ -5063,7 +5063,7 @@ function BinaryPPTYLoader()
this.ReadCell = function(cell) this.ReadCell = function(cell)
{ {
// cell.Content.Content.splice(0, cell.Content.Content.length); // cell.Content.Content.splice(0, cell.Content.Content.length);
cell.Content.Internal_Content_RemoveAll(); cell.Content.Internal_Content_RemoveAll();
var s = this.stream; var s = this.stream;
...@@ -5157,7 +5157,7 @@ function BinaryPPTYLoader() ...@@ -5157,7 +5157,7 @@ function BinaryPPTYLoader()
var _end_rec = _rec_start + s.GetULong() + 4; var _end_rec = _rec_start + s.GetULong() + 4;
props.TableCellMar = new Object(); props.TableCellMar = new Object();
props.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, 1.27); props.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, 1.27);
props.TableCellMar.Left = new CTableMeasurement(tblwidth_Mm, 2.54); props.TableCellMar.Left = new CTableMeasurement(tblwidth_Mm, 2.54);
props.TableCellMar.Bottom = new CTableMeasurement(tblwidth_Mm, 1.27); props.TableCellMar.Bottom = new CTableMeasurement(tblwidth_Mm, 1.27);
props.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, 2.54); props.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, 2.54);
...@@ -5186,7 +5186,7 @@ function BinaryPPTYLoader() ...@@ -5186,7 +5186,7 @@ function BinaryPPTYLoader()
props.TableCellMar = {} props.TableCellMar = {}
props.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, s.GetULong() / 36000); props.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, s.GetULong() / 36000);
// props.TableCellMar.Top.W = s.GetULong() / 36000; // props.TableCellMar.Top.W = s.GetULong() / 36000;
break; break;
} }
case 2: case 2:
...@@ -5194,7 +5194,7 @@ function BinaryPPTYLoader() ...@@ -5194,7 +5194,7 @@ function BinaryPPTYLoader()
if(props.TableCellMar == null) if(props.TableCellMar == null)
props.TableCellMar = {} props.TableCellMar = {}
props.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, s.GetULong() / 36000); props.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, s.GetULong() / 36000);
// props.TableCellMar.Right.W = s.GetULong() / 36000; // props.TableCellMar.Right.W = s.GetULong() / 36000;
break; break;
} }
case 3: case 3:
...@@ -6513,9 +6513,9 @@ function BinaryPPTYLoader() ...@@ -6513,9 +6513,9 @@ function BinaryPPTYLoader()
s.Skip2(4); s.Skip2(4);
var _c = s.GetULong(); var _c = s.GetULong();
/*if(History != null) /*if(History != null)
{ {
History.TurnOff(); History.TurnOff();
}*/ }*/
if(!txbody.content) if(!txbody.content)
txbody.content = new CDocumentContent(shape, this.presentation ? this.presentation.DrawingDocument : null, 0, 0, 0, 0, 0, 0); txbody.content = new CDocumentContent(shape, this.presentation ? this.presentation.DrawingDocument : null, 0, 0, 0, 0, 0, 0);
if(_c>0) if(_c>0)
...@@ -6541,9 +6541,9 @@ function BinaryPPTYLoader() ...@@ -6541,9 +6541,9 @@ function BinaryPPTYLoader()
txbody.textFieldFlag = true; txbody.textFieldFlag = true;
} }
/*if(History != null) /*if(History != null)
{ {
History.TurnOn(); History.TurnOn();
}*/ }*/
break; break;
} }
default: default:
...@@ -6665,9 +6665,9 @@ function BinaryPPTYLoader() ...@@ -6665,9 +6665,9 @@ function BinaryPPTYLoader()
var _c = s.GetULong(); var _c = s.GetULong();
/*if(History != null) /*if(History != null)
{ {
History.TurnOff(); History.TurnOff();
}*/ }*/
for (var i = 0; i < _c; i++) for (var i = 0; i < _c; i++)
...@@ -6678,9 +6678,9 @@ function BinaryPPTYLoader() ...@@ -6678,9 +6678,9 @@ function BinaryPPTYLoader()
} }
/*if(History != null) /*if(History != null)
{ {
History.TurnOn(); History.TurnOn();
}*/ }*/
break; break;
} }
default: default:
...@@ -6704,6 +6704,22 @@ function BinaryPPTYLoader() ...@@ -6704,6 +6704,22 @@ function BinaryPPTYLoader()
var _rec_start = s.cur; var _rec_start = s.cur;
var _end_rec = _rec_start + s.GetULong() + 4; var _end_rec = _rec_start + s.GetULong() + 4;
var textPropsForRecalc;
if(DocumentContent.Parent instanceof CTextBody)
{
textPropsForRecalc = DocumentContent.Parent.textPropsForRecalc;
}
else
{
if(DocumentContent.Parent instanceof CTableCell
&& DocumentContent.Parent.Row
&& DocumentContent.Parent.Row.Table
&& DocumentContent.Parent.Row.Table.Parent
&& DocumentContent.Parent.Row.Table.Parent.textPropsForRecalc)
{
textPropsForRecalc = DocumentContent.Parent.textPropsForRecalc;
}
}
while (s.cur < _end_rec) while (s.cur < _end_rec)
{ {
var _at = s.GetUChar(); var _at = s.GetUChar();
...@@ -6812,9 +6828,11 @@ function BinaryPPTYLoader() ...@@ -6812,9 +6828,11 @@ function BinaryPPTYLoader()
_run.unifill = unifill; _run.unifill = unifill;
_run.Underline = true; _run.Underline = true;
var tx_pr = new ParaTextPr(_run); var tx_pr = new ParaTextPr(_run);
if(DocumentContent.Parent && DocumentContent.Parent.textPropsForRecalc)
if(textPropsForRecalc)
{ {
DocumentContent.Parent.textPropsForRecalc.push(tx_pr) textPropsForRecalc.push(tx_pr)
} }
par.Internal_Content_Add( EndPos++, tx_pr); par.Internal_Content_Add( EndPos++, tx_pr);
...@@ -6827,9 +6845,9 @@ function BinaryPPTYLoader() ...@@ -6827,9 +6845,9 @@ function BinaryPPTYLoader()
{ {
var tx_pr = new ParaTextPr(_run); var tx_pr = new ParaTextPr(_run);
if(DocumentContent.Parent && DocumentContent.Parent.textPropsForRecalc) if(textPropsForRecalc)
{ {
DocumentContent.Parent.textPropsForRecalc.push(tx_pr) textPropsForRecalc.push(tx_pr)
} }
par.Internal_Content_Add( EndPos++, tx_pr); par.Internal_Content_Add( EndPos++, tx_pr);
} }
...@@ -6841,12 +6859,12 @@ function BinaryPPTYLoader() ...@@ -6841,12 +6859,12 @@ function BinaryPPTYLoader()
{ {
par.Internal_Content_Add( EndPos++, new ParaTab()); par.Internal_Content_Add( EndPos++, new ParaTab());
} }
else if (_text[j] == '\n') else if (_text[j] == '\n')
{ {
par.Internal_Content_Add( EndPos++, new ParaNewLine( break_Line )); par.Internal_Content_Add( EndPos++, new ParaNewLine( break_Line ));
} }
else if (_text[j] == '\r') else if (_text[j] == '\r')
; ;
else if (_text[j] != ' ') else if (_text[j] != ' ')
{ {
par.Internal_Content_Add( EndPos++, new ParaText(_text[j])); par.Internal_Content_Add( EndPos++, new ParaText(_text[j]));
...@@ -6877,7 +6895,7 @@ function BinaryPPTYLoader() ...@@ -6877,7 +6895,7 @@ function BinaryPPTYLoader()
break; break;
if (0 == _at) if (0 == _at)
var f_id = s.GetString2(); var f_id = s.GetString2();
else if (1 == _at) else if (1 == _at)
var f_type = s.GetString2(); var f_type = s.GetString2();
else else
...@@ -6924,9 +6942,9 @@ function BinaryPPTYLoader() ...@@ -6924,9 +6942,9 @@ function BinaryPPTYLoader()
_run.unifill = unifill; _run.unifill = unifill;
_run.Underline = true; _run.Underline = true;
var tx_pr = new ParaTextPr(_run); var tx_pr = new ParaTextPr(_run);
if(DocumentContent.Parent && DocumentContent.Parent.textPropsForRecalc) if(textPropsForRecalc)
{ {
DocumentContent.Parent.textPropsForRecalc.push(tx_pr) textPropsForRecalc.push(tx_pr)
} }
par.Internal_Content_Add( EndPos++, tx_pr); par.Internal_Content_Add( EndPos++, tx_pr);
...@@ -6938,9 +6956,9 @@ function BinaryPPTYLoader() ...@@ -6938,9 +6956,9 @@ function BinaryPPTYLoader()
else else
{ {
var tx_pr = new ParaTextPr(_run); var tx_pr = new ParaTextPr(_run);
if(DocumentContent.Parent && DocumentContent.Parent.textPropsForRecalc) if(textPropsForRecalc)
{ {
DocumentContent.Parent.textPropsForRecalc.push(tx_pr) textPropsForRecalc.push(tx_pr)
} }
par.Internal_Content_Add( EndPos++, tx_pr); par.Internal_Content_Add( EndPos++, tx_pr);
} }
...@@ -6971,12 +6989,16 @@ function BinaryPPTYLoader() ...@@ -6971,12 +6989,16 @@ function BinaryPPTYLoader()
if(par.IsEmpty() && endRunPr) if(par.IsEmpty() && endRunPr)
{ {
var tx_pr = new ParaTextPr(endRunPr); var tx_pr = new ParaTextPr(endRunPr);
if(DocumentContent.Parent && DocumentContent.Parent.textPropsForRecalc) if(textPropsForRecalc)
{ {
DocumentContent.Parent.textPropsForRecalc.push(tx_pr) textPropsForRecalc.push(tx_pr)
} }
par.Internal_Content_Add( EndPos++, tx_pr); par.Internal_Content_Add( EndPos++, tx_pr);
} }
if(textPropsForRecalc)
{
textPropsForRecalc.push({Value:{unifill:par.folHlinkColor}});
}
return par; return par;
} }
......
...@@ -220,8 +220,8 @@ CChartAsGroup.prototype = ...@@ -220,8 +220,8 @@ CChartAsGroup.prototype =
var bin = w.pos + ";" + w.GetBase64Memory(); var bin = w.pos + ";" + w.GetBase64Memory();
var new_chart_data = new asc_CChart(this.chart); var new_chart_data = new asc_CChart(this.chart);
/* var r = CreateBinaryReader(bin, 0, bin.length); /* var r = CreateBinaryReader(bin, 0, bin.length);
new_chart_data.Read_FromBinary2(r); */ new_chart_data.Read_FromBinary2(r); */
if(chart.styleId != null) if(chart.styleId != null)
new_chart_data.asc_setStyleId(chart.styleId); new_chart_data.asc_setStyleId(chart.styleId);
...@@ -1107,7 +1107,7 @@ CChartAsGroup.prototype = ...@@ -1107,7 +1107,7 @@ CChartAsGroup.prototype =
t_y = invert_transform.TransformPointY(x, y); t_y = invert_transform.TransformPointY(x, y);
var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y; var sqr_x = t_x*t_x, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius) if(Math.sqrt(sqr_x + sqr_y) < radius)
return 0; return 0;
...@@ -1490,7 +1490,7 @@ CChartAsGroup.prototype = ...@@ -1490,7 +1490,7 @@ CChartAsGroup.prototype =
if(is_on) if(is_on)
History.TurnOn(); History.TurnOn();
// this.recalculate(); // this.recalculate();
}, },
......
...@@ -78,7 +78,7 @@ function CDocumentContent(Parent, DrawingDocument, X, Y, XLimit, YLimit, Split, ...@@ -78,7 +78,7 @@ function CDocumentContent(Parent, DrawingDocument, X, Y, XLimit, YLimit, Split,
}; };
this.ApplyToAll = false; // Специальный параметр, используемый в ячейках таблицы. this.ApplyToAll = false; // Специальный параметр, используемый в ячейках таблицы.
// True, если ячейка попадает в выделение по ячейкам. // True, если ячейка попадает в выделение по ячейкам.
this.TurnOffRecalc = false; this.TurnOffRecalc = false;
...@@ -159,12 +159,12 @@ CDocumentContent.prototype = ...@@ -159,12 +159,12 @@ CDocumentContent.prototype =
Get_PageFields : function(PageIndex) Get_PageFields : function(PageIndex)
{ {
var Y = this.Pages[PageIndex].Y ; var Y = this.Pages[PageIndex].Y ;
var YLimit = this.Pages[PageIndex].YLimit; var YLimit = this.Pages[PageIndex].YLimit;
var X = this.Pages[PageIndex].X; var X = this.Pages[PageIndex].X;
var XLimit = this.Pages[PageIndex].XLimit; var XLimit = this.Pages[PageIndex].XLimit;
return { X : X, XLimit : XLimit, Y : Y, YLimit : YLimit }; return { X : X, XLimit : XLimit, Y : Y, YLimit : YLimit };
}, },
Get_EmptyHeight : function() Get_EmptyHeight : function()
...@@ -267,18 +267,35 @@ CDocumentContent.prototype = ...@@ -267,18 +267,35 @@ CDocumentContent.prototype =
recalcColors: function() recalcColors: function()
{ {
if(this.Parent instanceof CTextBody) var textPropsForRecalc;
if(this.Parent instanceof CTextBody)
{
textPropsForRecalc = this.Parent.textPropsForRecalc;
}
else
{
if(this.Parent instanceof CTableCell
&& this.Parent.Row
&& this.Parent.Row.Table
&& this.Parent.Row.Table.Parent
&& this.Parent.Row.Table.Parent.textPropsForRecalc)
{
textPropsForRecalc = this.Parent.textPropsForRecalc;
}
}
if(Array.isArray(textPropsForRecalc))
{ {
for(var i = 0; i < this.Content.length; ++i) for(var i = 0; i < this.Content.length; ++i)
{ {
var p = this.Content[i]; var p = this.Content[i];
if(p.CompiledPr.Pr.TextPr) if(p.CompiledPr.Pr.TextPr)
this.Parent.textPropsForRecalc.push({Value:p.CompiledPr.Pr.TextPr}); textPropsForRecalc.push({Value:p.CompiledPr.Pr.TextPr});
textPropsForRecalc.push({Value:{unifill:p.folHlinkColor}});
for(var j = 0; j < p.Content.length; ++j) for(var j = 0; j < p.Content.length; ++j)
{ {
if(p.Content[j].Type === para_TextPr && p.Content[j].Value.unifill) if(p.Content[j].Type === para_TextPr && p.Content[j].Value.unifill)
{ {
this.Parent.textPropsForRecalc.push(p.Content[j]); textPropsForRecalc.push(p.Content[j]);
} }
} }
} }
...@@ -573,6 +590,7 @@ CDocumentContent.prototype = ...@@ -573,6 +590,7 @@ CDocumentContent.prototype =
if(paragraph !== undefined) if(paragraph !== undefined)
{ {
_cur_paragraph = paragraph; _cur_paragraph = paragraph;
_cur_paragraph.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
_cur_paragraph.Remove_PresentationNumbering(); _cur_paragraph.Remove_PresentationNumbering();
if(_cur_paragraph.GetType() != type_Paragraph) if(_cur_paragraph.GetType() != type_Paragraph)
{ {
...@@ -981,6 +999,7 @@ CDocumentContent.prototype = ...@@ -981,6 +999,7 @@ CDocumentContent.prototype =
for(_par_index = 0; _par_index < _content_length; ++_par_index) for(_par_index = 0; _par_index < _content_length; ++_par_index)
{ {
_cur_paragraph = this.Content[_par_index]; _cur_paragraph = this.Content[_par_index];
_cur_paragraph.RecalcInfo.Recalc_0_Type = pararecalc_0_All;
if(_cur_paragraph.GetType() != type_Paragraph) if(_cur_paragraph.GetType() != type_Paragraph)
{ {
continue; continue;
...@@ -1301,6 +1320,16 @@ CDocumentContent.prototype = ...@@ -1301,6 +1320,16 @@ CDocumentContent.prototype =
} }
}, },
recalc0AllContent: function()
{
for(var i = 0; i < this.Content.length; ++i)
{
this.Content[i].RecalcInfo.Recalc_0_Type = pararecalc_0_All;
this.Content[i].Recalc_CompiledPr();
}
},
Recalculate_ : function(bForceRecalc, LastChangeIndex) Recalculate_ : function(bForceRecalc, LastChangeIndex)
{ {
if ( true === this.TurnOffRecalc || true === editor.WordControl.m_oLogicDocument.TurnOffRecalc ) if ( true === this.TurnOffRecalc || true === editor.WordControl.m_oLogicDocument.TurnOffRecalc )
...@@ -1315,7 +1344,7 @@ CDocumentContent.prototype = ...@@ -1315,7 +1344,7 @@ CDocumentContent.prototype =
var OldPages = this.Pages.length; var OldPages = this.Pages.length;
var OldBottom = new Array(); var OldBottom = new Array();
for ( var Index = 0; Index < OldPages; Index++ ) for ( var Index = 0; Index < OldPages; Index++ )
OldBottom[Index] = this.Pages[Index].Bounds.Bottom; OldBottom[Index] = this.Pages[Index].Bounds.Bottom;
var Old_FlowObjects = new Array(); var Old_FlowObjects = new Array();
for ( var Index = 0; Index < this.Pages.length; Index++ ) for ( var Index = 0; Index < this.Pages.length; Index++ )
...@@ -1354,7 +1383,7 @@ CDocumentContent.prototype = ...@@ -1354,7 +1383,7 @@ CDocumentContent.prototype =
// Пересчитываем элемент // Пересчитываем элемент
var Element = this.Content[Index]; var Element = this.Content[Index];
Element.Set_DocumentIndex( Index ); Element.Set_DocumentIndex( Index );
if ( Index >= LastChangeIndex ) if ( Index >= LastChangeIndex )
{ {
Element.TurnOff_RecalcEvent(); Element.TurnOff_RecalcEvent();
...@@ -2584,7 +2613,7 @@ CDocumentContent.prototype = ...@@ -2584,7 +2613,7 @@ CDocumentContent.prototype =
} }
} }
}, },
Paragraph_Add : function( ParaItem, bRecalculate ) Paragraph_Add : function( ParaItem, bRecalculate )
{ {
if ( true === this.ApplyToAll ) if ( true === this.ApplyToAll )
...@@ -4034,7 +4063,7 @@ CDocumentContent.prototype = ...@@ -4034,7 +4063,7 @@ CDocumentContent.prototype =
return false; return false;
else if ( false != this.Selection.Use || 0 != this.CurPos.ContentPos ) else if ( false != this.Selection.Use || 0 != this.CurPos.ContentPos )
return false; return false;
var Item = this.Content[0]; var Item = this.Content[0];
return Item.Cursor_IsStart( bOnlyPara ); return Item.Cursor_IsStart( bOnlyPara );
}, },
...@@ -4907,7 +4936,7 @@ CDocumentContent.prototype = ...@@ -4907,7 +4936,7 @@ CDocumentContent.prototype =
{ {
var Styles = this.Parent.Get_Styles(); var Styles = this.Parent.Get_Styles();
var StyleId = Styles.Get_StyleIdByName( Name ); var StyleId = Styles.Get_StyleIdByName( Name );
if ( true === this.ApplyToAll ) if ( true === this.ApplyToAll )
{ {
for ( var Index = 0; Index < this.Content.length; Index++ ) for ( var Index = 0; Index < this.Content.length; Index++ )
...@@ -5823,136 +5852,136 @@ CDocumentContent.prototype = ...@@ -5823,136 +5852,136 @@ CDocumentContent.prototype =
Get_Paragraph_ParaPr : function() Get_Paragraph_ParaPr : function()
{ {
/* var Result_ParaPr = new CParaPr(); /* var Result_ParaPr = new CParaPr();
if ( true === this.ApplyToAll ) if ( true === this.ApplyToAll )
{ {
var StartPr, Pr; var StartPr, Pr;
if ( type_Paragraph == this.Content[0].GetType() ) if ( type_Paragraph == this.Content[0].GetType() )
{ {
StartPr = this.Content[0].Get_CompiledPr2().ParaPr; StartPr = this.Content[0].Get_CompiledPr2().ParaPr;
Pr = StartPr.Copy(); Pr = StartPr.Copy();
Pr.Locked = this.Content[0].Lock.Is_Locked(); Pr.Locked = this.Content[0].Lock.Is_Locked();
} }
else if ( type_Table == this.Content[0].GetType() ) else if ( type_Table == this.Content[0].GetType() )
{ {
StartPr = this.Content[0].Get_Paragraph_ParaPr(); StartPr = this.Content[0].Get_Paragraph_ParaPr();
Pr = StartPr.Copy(); Pr = StartPr.Copy();
Pr.Locked = StartPr.Locked; Pr.Locked = StartPr.Locked;
} }
for ( var Index = 1; Index < this.Content.length; Index++ ) for ( var Index = 1; Index < this.Content.length; Index++ )
{ {
var Item = this.Content[Index]; var Item = this.Content[Index];
var TempPr; var TempPr;
if ( type_Paragraph == Item.GetType() ) if ( type_Paragraph == Item.GetType() )
{ {
TempPr = Item.Get_CompiledPr2(false).ParaPr.Copy(); TempPr = Item.Get_CompiledPr2(false).ParaPr.Copy();
TempPr.Locked = Item.Lock.Is_Locked(); TempPr.Locked = Item.Lock.Is_Locked();
} }
else if ( type_Table == Item.GetType() ) else if ( type_Table == Item.GetType() )
{ {
TempPr = Item.Get_Paragraph_ParaPr(); TempPr = Item.Get_Paragraph_ParaPr();
} }
Pr = Pr.Compare(TempPr); Pr = Pr.Compare(TempPr);
} }
if ( Pr.Ind.Left == UnknownValue ) if ( Pr.Ind.Left == UnknownValue )
Pr.Ind.Left = StartPr.Ind.Left; Pr.Ind.Left = StartPr.Ind.Left;
if ( Pr.Ind.Right == UnknownValue ) if ( Pr.Ind.Right == UnknownValue )
Pr.Ind.Right = StartPr.Ind.Right; Pr.Ind.Right = StartPr.Ind.Right;
if ( Pr.Ind.FirstLine == UnknownValue ) if ( Pr.Ind.FirstLine == UnknownValue )
Pr.Ind.FirstLine = StartPr.Ind.FirstLine; Pr.Ind.FirstLine = StartPr.Ind.FirstLine;
Result_ParaPr = Pr; Result_ParaPr = Pr;
Result_ParaPr.CanAddTable = ( true === Pr.Locked ? false : true ); Result_ParaPr.CanAddTable = ( true === Pr.Locked ? false : true );
return Result_ParaPr; return Result_ParaPr;
} }
if ( docpostype_DrawingObjects === this.CurPos.Type ) if ( docpostype_DrawingObjects === this.CurPos.Type )
return this.LogicDocument.DrawingObjects.getParagraphParaPr(); return this.LogicDocument.DrawingObjects.getParagraphParaPr();
else //if ( docpostype_Content === this.CurPos.Type ) else //if ( docpostype_Content === this.CurPos.Type )
{ {
if ( true === this.Selection.Use && selectionflag_Common === this.Selection.Flag ) if ( true === this.Selection.Use && selectionflag_Common === this.Selection.Flag )
{ {
var StartPos = this.Selection.StartPos; var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos; var EndPos = this.Selection.EndPos;
if ( EndPos < StartPos ) if ( EndPos < StartPos )
{ {
var Temp = StartPos; var Temp = StartPos;
StartPos = EndPos; StartPos = EndPos;
EndPos = Temp; EndPos = Temp;
} }
var StartPr, Pr; var StartPr, Pr;
if ( type_Paragraph == this.Content[StartPos].GetType() ) if ( type_Paragraph == this.Content[StartPos].GetType() )
{ {
StartPr = this.Content[StartPos].Get_CompiledPr2(false).ParaPr; StartPr = this.Content[StartPos].Get_CompiledPr2(false).ParaPr;
Pr = StartPr.Copy(); Pr = StartPr.Copy();
Pr.Locked = this.Content[StartPos].Lock.Is_Locked(); Pr.Locked = this.Content[StartPos].Lock.Is_Locked();
} }
else if ( type_Table == this.Content[StartPos].GetType() ) else if ( type_Table == this.Content[StartPos].GetType() )
{ {
StartPr = this.Content[StartPos].Get_Paragraph_ParaPr(); StartPr = this.Content[StartPos].Get_Paragraph_ParaPr();
Pr = StartPr.Copy(); Pr = StartPr.Copy();
Pr.Locked = StartPr.Locked; Pr.Locked = StartPr.Locked;
} }
for ( var Index = StartPos + 1; Index <= EndPos; Index++ ) for ( var Index = StartPos + 1; Index <= EndPos; Index++ )
{ {
var Item = this.Content[Index]; var Item = this.Content[Index];
var TempPr; var TempPr;
if ( type_Paragraph == Item.GetType() ) if ( type_Paragraph == Item.GetType() )
{ {
TempPr = Item.Get_CompiledPr2(false).ParaPr; TempPr = Item.Get_CompiledPr2(false).ParaPr;
TempPr.Locked = Item.Lock.Is_Locked(); TempPr.Locked = Item.Lock.Is_Locked();
} }
else if ( type_Table == Item.GetType() ) else if ( type_Table == Item.GetType() )
{ {
TempPr = Item.Get_Paragraph_ParaPr(); TempPr = Item.Get_Paragraph_ParaPr();
} }
Pr = Pr.Compare(TempPr); Pr = Pr.Compare(TempPr);
} }
if ( undefined === Pr.Ind.Left ) if ( undefined === Pr.Ind.Left )
Pr.Ind.Left = StartPr.Ind.Left; Pr.Ind.Left = StartPr.Ind.Left;
if ( undefined === Pr.Ind.Right ) if ( undefined === Pr.Ind.Right )
Pr.Ind.Right = StartPr.Ind.Right; Pr.Ind.Right = StartPr.Ind.Right;
if ( undefined === Pr.Ind.FirstLine ) if ( undefined === Pr.Ind.FirstLine )
Pr.Ind.FirstLine = StartPr.Ind.FirstLine; Pr.Ind.FirstLine = StartPr.Ind.FirstLine;
Result_ParaPr = Pr; Result_ParaPr = Pr;
Result_ParaPr.CanAddTable = ( true === Locked ? false : true ); Result_ParaPr.CanAddTable = ( true === Locked ? false : true );
} }
else else
{ {
var Item = this.Content[this.CurPos.ContentPos]; var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() ) if ( type_Paragraph == Item.GetType() )
{ {
var ParaPr = Item.Get_CompiledPr2(false).ParaPr; var ParaPr = Item.Get_CompiledPr2(false).ParaPr;
var Locked = Item.Lock.Is_Locked(); var Locked = Item.Lock.Is_Locked();
Result_ParaPr = ParaPr.Copy(); Result_ParaPr = ParaPr.Copy();
Result_ParaPr.Locked = Locked; Result_ParaPr.Locked = Locked;
Result_ParaPr.CanAddTable = ( ( true === Locked ) ? ( ( true === Item.Cursor_IsEnd() ) ? true : false ) : true ); Result_ParaPr.CanAddTable = ( ( true === Locked ) ? ( ( true === Item.Cursor_IsEnd() ) ? true : false ) : true );
} }
else if ( type_Table == Item.GetType() ) else if ( type_Table == Item.GetType() )
{ {
Result_ParaPr = Item.Get_Paragraph_ParaPr(); Result_ParaPr = Item.Get_Paragraph_ParaPr();
} }
} }
return Result_ParaPr; return Result_ParaPr;
} */ } */
var Result_ParaPr = new CParaPr(); var Result_ParaPr = new CParaPr();
if ( true === this.ApplyToAll ) if ( true === this.ApplyToAll )
...@@ -7433,7 +7462,7 @@ CDocumentContent.prototype = ...@@ -7433,7 +7462,7 @@ CDocumentContent.prototype =
Item.Internal_Selection_UpdateCells(); Item.Internal_Selection_UpdateCells();
} }
break; break;
} }
} }
...@@ -8070,7 +8099,7 @@ CDocumentContent.prototype = ...@@ -8070,7 +8099,7 @@ CDocumentContent.prototype =
if ( "undefined" == typeof(NextObj) ) if ( "undefined" == typeof(NextObj) )
NextObj = null; NextObj = null;
for ( var Index = 0; Index < Count; Index++ ) for ( var Index = 0; Index < Count; Index++ )
this.Content[Position + Index].PreDelete(); this.Content[Position + Index].PreDelete();
......
...@@ -1453,7 +1453,7 @@ CGroupShape.prototype = ...@@ -1453,7 +1453,7 @@ CGroupShape.prototype =
t_y = invert_transform.TransformPointY(x, y); t_y = invert_transform.TransformPointY(x, y);
var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y; var sqr_x = t_x*t_x, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius) if(Math.sqrt(sqr_x + sqr_y) < radius)
return 0; return 0;
......
...@@ -1003,7 +1003,7 @@ CImageShape.prototype = ...@@ -1003,7 +1003,7 @@ CImageShape.prototype =
t_y = invert_transform.TransformPointY(x, y); t_y = invert_transform.TransformPointY(x, y);
var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
var sqr_x = t_x*t_y, sqr_y = t_y*t_y; var sqr_x = t_x*t_x, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius) if(Math.sqrt(sqr_x + sqr_y) < radius)
return 0; return 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -236,24 +236,24 @@ CShape.prototype = ...@@ -236,24 +236,24 @@ CShape.prototype =
if (arrowsCount === 1 || arrowsCount === 2) { if (arrowsCount === 1 || arrowsCount === 2) {
switch (arrowsCount) { switch (arrowsCount) {
case 1: case 1:
{ {
var ln = new CLn(); var ln = new CLn();
ln.tailEnd = new EndArrow(); ln.tailEnd = new EndArrow();
ln.tailEnd.type = LineEndType.Arrow; ln.tailEnd.type = LineEndType.Arrow;
ln.tailEnd.len = LineEndSize.Mid; ln.tailEnd.len = LineEndSize.Mid;
break; break;
} }
case 2: case 2:
{ {
var ln = new CLn(); var ln = new CLn();
ln.tailEnd = new EndArrow(); ln.tailEnd = new EndArrow();
ln.tailEnd.type = LineEndType.Arrow; ln.tailEnd.type = LineEndType.Arrow;
ln.tailEnd.len = LineEndSize.Mid; ln.tailEnd.len = LineEndSize.Mid;
ln.headEnd = new EndArrow(); ln.headEnd = new EndArrow();
ln.headEnd.type = LineEndType.Arrow; ln.headEnd.type = LineEndType.Arrow;
ln.headEnd.len = LineEndSize.Mid; ln.headEnd.len = LineEndSize.Mid;
break; break;
} }
} }
this.setLine(ln); this.setLine(ln);
} }
...@@ -419,19 +419,19 @@ CShape.prototype = ...@@ -419,19 +419,19 @@ CShape.prototype =
var ph_index = this.getPlaceholderIndex(); var ph_index = this.getPlaceholderIndex();
switch (this.parent.kind) { switch (this.parent.kind) {
case SLIDE_KIND: case SLIDE_KIND:
{ {
var placeholder = this.parent.Layout.getMatchingShape(ph_type, ph_index); var placeholder = this.parent.Layout.getMatchingShape(ph_type, ph_index);
if (placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull()) if (placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull())
return true; return true;
placeholder = this.parent.Layout.Master.getMatchingShape(ph_type, ph_index); placeholder = this.parent.Layout.Master.getMatchingShape(ph_type, ph_index);
return placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull(); return placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull();
} }
case LAYOUT_KIND: case LAYOUT_KIND:
{ {
var placeholder = this.parent.Master.getMatchingShape(ph_type, ph_index); var placeholder = this.parent.Master.getMatchingShape(ph_type, ph_index);
return placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull(); return placeholder && placeholder.spPr && placeholder.spPr.xfrm && placeholder.spPr.xfrm.isNotNull();
} }
} }
} }
return false; return false;
...@@ -446,17 +446,17 @@ CShape.prototype = ...@@ -446,17 +446,17 @@ CShape.prototype =
var ph_index = this.getPlaceholderIndex(); var ph_index = this.getPlaceholderIndex();
switch (this.parent.kind) { switch (this.parent.kind) {
case SLIDE_KIND: case SLIDE_KIND:
{ {
hierarchy.push(this.parent.Layout.getMatchingShape(ph_type, ph_index)); hierarchy.push(this.parent.Layout.getMatchingShape(ph_type, ph_index));
hierarchy.push(this.parent.Layout.Master.getMatchingShape(ph_type, ph_index)); hierarchy.push(this.parent.Layout.Master.getMatchingShape(ph_type, ph_index));
break; break;
} }
case LAYOUT_KIND: case LAYOUT_KIND:
{ {
hierarchy.push(this.parent.Master.getMatchingShape(ph_type, ph_index)); hierarchy.push(this.parent.Master.getMatchingShape(ph_type, ph_index));
break; break;
} }
} }
} }
this.recalcInfo.recalculateShapeHierarchy = true; this.recalcInfo.recalculateShapeHierarchy = true;
...@@ -538,29 +538,29 @@ CShape.prototype = ...@@ -538,29 +538,29 @@ CShape.prototype =
var parents = { slide: null, layout: null, master: null, theme: null }; var parents = { slide: null, layout: null, master: null, theme: null };
switch (this.parent.kind) { switch (this.parent.kind) {
case SLIDE_KIND: case SLIDE_KIND:
{ {
parents.slide = this.parent; parents.slide = this.parent;
parents.layout = this.parent.Layout; parents.layout = this.parent.Layout;
parents.master = this.parent.Layout.Master; parents.master = this.parent.Layout.Master;
parents.theme = this.parent.Layout.Master.Theme; parents.theme = this.parent.Layout.Master.Theme;
parents.presentation = this.parent.Layout.Master.presentation; parents.presentation = this.parent.Layout.Master.presentation;
break; break;
} }
case LAYOUT_KIND: case LAYOUT_KIND:
{ {
parents.layout = this.parent; parents.layout = this.parent;
parents.master = this.parent.Master; parents.master = this.parent.Master;
parents.theme = this.parent.Master.Theme; parents.theme = this.parent.Master.Theme;
parents.presentation = this.parent.Master.presentation; parents.presentation = this.parent.Master.presentation;
break; break;
} }
case MASTER_KIND: case MASTER_KIND:
{ {
parents.master = this.parent; parents.master = this.parent;
parents.theme = this.parent.Theme; parents.theme = this.parent.Theme;
parents.presentation = this.parent.presentation; parents.presentation = this.parent.presentation;
break; break;
} }
} }
return parents; return parents;
}, },
...@@ -900,30 +900,30 @@ CShape.prototype = ...@@ -900,30 +900,30 @@ CShape.prototype =
if (/*_content_height < _text_rect_height*/true) { if (/*_content_height < _text_rect_height*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = _text_rect_height - _content_height; _vertical_shift = _text_rect_height - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) TODO: пока выравнивание по центру. Переделать! {// (Text Anchor Enum ( Distributed )) TODO: пока выравнивание по центру. Переделать!
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) TODO: пока выравнивание по центру. Переделать! {// (Text Anchor Enum ( Justified )) TODO: пока выравнивание по центру. Переделать!
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
...@@ -932,13 +932,13 @@ CShape.prototype = ...@@ -932,13 +932,13 @@ CShape.prototype =
//_vertical_shift = _text_rect_height - _content_height; //_vertical_shift = _text_rect_height - _content_height;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = _text_rect_height - _content_height; _vertical_shift = _text_rect_height - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift); global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) { if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
...@@ -956,42 +956,42 @@ CShape.prototype = ...@@ -956,42 +956,42 @@ CShape.prototype =
if (/*_content_height < _text_rect_width*/true) { if (/*_content_height < _text_rect_width*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = _text_rect_width - _content_height; _vertical_shift = _text_rect_width - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) {// (Text Anchor Enum ( Distributed ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) {// (Text Anchor Enum ( Justified ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
else { else {
_vertical_shift = 0; _vertical_shift = 0;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = _text_rect_width - _content_height; _vertical_shift = _text_rect_width - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift); global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
var _alpha; var _alpha;
...@@ -1056,42 +1056,42 @@ CShape.prototype = ...@@ -1056,42 +1056,42 @@ CShape.prototype =
if (/*_content_height < content_height2*/true) { if (/*_content_height < content_height2*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = content_height2 - _content_height; _vertical_shift = content_height2 - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) {// (Text Anchor Enum ( Distributed ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) {// (Text Anchor Enum ( Justified ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
else { else {
_vertical_shift = 0; _vertical_shift = 0;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = content_height2 - _content_height; _vertical_shift = content_height2 - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
var _text_rect_xc = _l + (_r - _l) * 0.5; var _text_rect_xc = _l + (_r - _l) * 0.5;
...@@ -1212,30 +1212,30 @@ CShape.prototype = ...@@ -1212,30 +1212,30 @@ CShape.prototype =
if (/*_content_height < _text_rect_height*/true) { if (/*_content_height < _text_rect_height*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = _text_rect_height - _content_height; _vertical_shift = _text_rect_height - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) TODO: пока выравнивание по центру. Переделать! {// (Text Anchor Enum ( Distributed )) TODO: пока выравнивание по центру. Переделать!
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) TODO: пока выравнивание по центру. Переделать! {// (Text Anchor Enum ( Justified )) TODO: пока выравнивание по центру. Переделать!
_vertical_shift = (_text_rect_height - _content_height) * 0.5; _vertical_shift = (_text_rect_height - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
...@@ -1244,13 +1244,13 @@ CShape.prototype = ...@@ -1244,13 +1244,13 @@ CShape.prototype =
//_vertical_shift = _text_rect_height - _content_height; //_vertical_shift = _text_rect_height - _content_height;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = _text_rect_height - _content_height; _vertical_shift = _text_rect_height - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift); global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) { if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
...@@ -1268,42 +1268,42 @@ CShape.prototype = ...@@ -1268,42 +1268,42 @@ CShape.prototype =
if (/*_content_height < _text_rect_width*/true) { if (/*_content_height < _text_rect_width*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = _text_rect_width - _content_height; _vertical_shift = _text_rect_width - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) {// (Text Anchor Enum ( Distributed ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) {// (Text Anchor Enum ( Justified ))
_vertical_shift = (_text_rect_width - _content_height) * 0.5; _vertical_shift = (_text_rect_width - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
else { else {
_vertical_shift = 0; _vertical_shift = 0;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = _text_rect_width - _content_height; _vertical_shift = _text_rect_width - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift); global_MatrixTransformer.TranslateAppend(_text_transform, 0, _vertical_shift);
var _alpha; var _alpha;
...@@ -1375,42 +1375,42 @@ CShape.prototype = ...@@ -1375,42 +1375,42 @@ CShape.prototype =
if (/*_content_height < content_height2*/true) { if (/*_content_height < content_height2*/true) {
switch (_body_pr.anchor) { switch (_body_pr.anchor) {
case 0: //b case 0: //b
{ // (Text Anchor Enum ( Bottom )) { // (Text Anchor Enum ( Bottom ))
_vertical_shift = content_height2 - _content_height; _vertical_shift = content_height2 - _content_height;
break; break;
} }
case 1: //ctr case 1: //ctr
{// (Text Anchor Enum ( Center )) {// (Text Anchor Enum ( Center ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 2: //dist case 2: //dist
{// (Text Anchor Enum ( Distributed )) {// (Text Anchor Enum ( Distributed ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 3: //just case 3: //just
{// (Text Anchor Enum ( Justified )) {// (Text Anchor Enum ( Justified ))
_vertical_shift = (content_height2 - _content_height) * 0.5; _vertical_shift = (content_height2 - _content_height) * 0.5;
break; break;
} }
case 4: //t case 4: //t
{//Top {//Top
_vertical_shift = 0; _vertical_shift = 0;
break; break;
} }
} }
} }
else { else {
_vertical_shift = 0; _vertical_shift = 0;
/*if(_body_pr.anchor === 0) /*if(_body_pr.anchor === 0)
{ {
_vertical_shift = content_height2 - _content_height; _vertical_shift = content_height2 - _content_height;
} }
else else
{ {
_vertical_shift = 0; _vertical_shift = 0;
} */ } */
} }
var _text_rect_xc = _l + (_r - _l) * 0.5; var _text_rect_xc = _l + (_r - _l) * 0.5;
...@@ -1523,23 +1523,23 @@ CShape.prototype = ...@@ -1523,23 +1523,23 @@ CShape.prototype =
switch (this.getPlaceholderType()) { switch (this.getPlaceholderType()) {
case phType_ctrTitle: case phType_ctrTitle:
case phType_title: case phType_title:
{ {
master_ppt_styles = parent_objects.master.txStyles.titleStyle; master_ppt_styles = parent_objects.master.txStyles.titleStyle;
break; break;
} }
case phType_body: case phType_body:
case phType_subTitle: case phType_subTitle:
case phType_obj: case phType_obj:
case null: case null:
{ {
master_ppt_styles = parent_objects.master.txStyles.bodyStyle; master_ppt_styles = parent_objects.master.txStyles.bodyStyle;
break; break;
} }
default: default:
{ {
master_ppt_styles = parent_objects.master.txStyles.otherStyle; master_ppt_styles = parent_objects.master.txStyles.otherStyle;
break; break;
} }
} }
} }
else { else {
...@@ -1582,19 +1582,19 @@ CShape.prototype = ...@@ -1582,19 +1582,19 @@ CShape.prototype =
shape_text_style = new CStyle("shapeTextStyle", null, null, null); shape_text_style = new CStyle("shapeTextStyle", null, null, null);
switch (this.style.fontRef.idx) { switch (this.style.fontRef.idx) {
case fntStyleInd_major: case fntStyleInd_major:
{ {
shape_text_style.TextPr.FontFamily = { Name: getFontInfo("+mj-lt")(parent_objects.theme.themeElements.fontScheme) }; shape_text_style.TextPr.FontFamily = { Name: getFontInfo("+mj-lt")(parent_objects.theme.themeElements.fontScheme) };
break; break;
} }
case fntStyleInd_minor: case fntStyleInd_minor:
{ {
shape_text_style.TextPr.FontFamily = { Name: getFontInfo("+mn-lt")(parent_objects.theme.themeElements.fontScheme) }; shape_text_style.TextPr.FontFamily = { Name: getFontInfo("+mn-lt")(parent_objects.theme.themeElements.fontScheme) };
break; break;
} }
default: default:
{ {
break; break;
} }
} }
if (this.style.fontRef.Color != null && this.style.fontRef.Color.color != null) { if (this.style.fontRef.Color != null && this.style.fontRef.Color.color != null) {
...@@ -2008,25 +2008,25 @@ CShape.prototype = ...@@ -2008,25 +2008,25 @@ CShape.prototype =
var full_flip_v = this.getFullFlipV(); var full_flip_v = this.getFullFlipV();
switch (Math.min(y1, y3, y5, y7)) { switch (Math.min(y1, y3, y5, y7)) {
case y1: case y1:
{ {
north_number = !full_flip_v ? 1 : 5; north_number = !full_flip_v ? 1 : 5;
break; break;
} }
case y3: case y3:
{ {
north_number = !full_flip_h ? 3 : 7; north_number = !full_flip_h ? 3 : 7;
break; break;
} }
case y5: case y5:
{ {
north_number = !full_flip_v ? 5 : 1; north_number = !full_flip_v ? 5 : 1;
break; break;
} }
default: default:
{ {
north_number = !full_flip_h ? 7 : 3; north_number = !full_flip_h ? 7 : 3;
break; break;
} }
} }
var same_flip = !full_flip_h && !full_flip_v || full_flip_h && full_flip_v; var same_flip = !full_flip_h && !full_flip_v || full_flip_h && full_flip_v;
...@@ -2650,24 +2650,24 @@ CShape.prototype = ...@@ -2650,24 +2650,24 @@ CShape.prototype =
draw: function (graphics) { draw: function (graphics) {
/*graphics.SetIntegerGrid(false); /*graphics.SetIntegerGrid(false);
graphics.transform3(this.transform, false); graphics.transform3(this.transform, false);
var shape_drawer = new CShapeDrawer(); var shape_drawer = new CShapeDrawer();
shape_drawer.fromShape(this, graphics); shape_drawer.fromShape(this, graphics);
shape_drawer.draw(this.spPr.geometry); shape_drawer.draw(this.spPr.geometry);
if(locktype_None != this.Lock.Get_Type()) if(locktype_None != this.Lock.Get_Type())
graphics.DrawLockObjectRect(this.Lock.Get_Type() , 0, 0, this.extX, this.extY); graphics.DrawLockObjectRect(this.Lock.Get_Type() , 0, 0, this.extX, this.extY);
graphics.reset(); graphics.reset();
graphics.SetIntegerGrid(true); graphics.SetIntegerGrid(true);
if (this.txBody /*&& /*!(graphics instanceof CSlideBoundsChecker))*/ if (this.txBody /*&& /*!(graphics instanceof CSlideBoundsChecker))*/
// { // {
/* graphics.SetIntegerGrid(false); /* graphics.SetIntegerGrid(false);
graphics.transform3(this.transformText); graphics.transform3(this.transformText);
this.txBody.draw(graphics); this.txBody.draw(graphics);
graphics.reset(); graphics.reset();
graphics.SetIntegerGrid(true); graphics.SetIntegerGrid(true);
} */ } */
if (graphics.IsSlideBoundsCheckerType === true) { if (graphics.IsSlideBoundsCheckerType === true) {
graphics.transform3(this.transform); graphics.transform3(this.transform);
if (null == this.geometry || !graphics.IsShapeNeedBounds(this.spPr.geometry.preset)) { if (null == this.geometry || !graphics.IsShapeNeedBounds(this.spPr.geometry.preset)) {
...@@ -2789,18 +2789,18 @@ CShape.prototype = ...@@ -2789,18 +2789,18 @@ CShape.prototype =
graphics.FreeFont(); graphics.FreeFont();
/*var _masrgins = this.getMargins(); /*var _masrgins = this.getMargins();
graphics.reset(); graphics.reset();
graphics.SetIntegerGrid(false); graphics.SetIntegerGrid(false);
graphics.p_width(70); graphics.p_width(70);
graphics.transform3(this.TransformTextMatrix); graphics.transform3(this.TransformTextMatrix);
graphics.p_color(0,0,0,255); graphics.p_color(0,0,0,255);
graphics._s(); graphics._s();
graphics._m(_masrgins.L*100, _masrgins.T*100); graphics._m(_masrgins.L*100, _masrgins.T*100);
graphics._l(_masrgins.R*100, _masrgins.T*100); graphics._l(_masrgins.R*100, _masrgins.T*100);
graphics._l(_masrgins.R*100, _masrgins.B*100); graphics._l(_masrgins.R*100, _masrgins.B*100);
graphics._l(_masrgins.L*100, _masrgins.B*100); graphics._l(_masrgins.L*100, _masrgins.B*100);
graphics._z(); graphics._z();
graphics.ds(); */ graphics.ds(); */
graphics.SetIntegerGrid(true); graphics.SetIntegerGrid(true);
} }
...@@ -3008,135 +3008,135 @@ CShape.prototype = ...@@ -3008,135 +3008,135 @@ CShape.prototype =
} }
switch (sPreset) { switch (sPreset) {
case "lineWithArrow": case "lineWithArrow":
{ {
_final_preset = "line"; _final_preset = "line";
_arrow_flag = true; _arrow_flag = true;
if (_old_line == null) { if (_old_line == null) {
_new_line = new CLn(); _new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
break;
} }
case "lineWithTwoArrows": else {
{ _new_line = this.spPr.ln.createDuplicate();
_final_preset = "line"; }
_arrow_flag = true; _new_line.tailEnd = new EndArrow();
if (_old_line == null) { _new_line.tailEnd.type = LineEndType.Arrow;
_new_line = new CLn(); _new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
} break;
else { }
_new_line = this.spPr.ln.createDuplicate(); case "lineWithTwoArrows":
} {
_new_line.tailEnd = new EndArrow(); _final_preset = "line";
_new_line.tailEnd.type = LineEndType.Arrow; _arrow_flag = true;
_new_line.tailEnd.len = LineEndSize.Mid; if (_old_line == null) {
_new_line.tailEnd.w = LineEndSize.Mid; _new_line = new CLn();
_new_line.headEnd = new EndArrow(); }
_new_line.headEnd.type = LineEndType.Arrow; else {
_new_line.headEnd.len = LineEndSize.Mid; _new_line = this.spPr.ln.createDuplicate();
_new_line.headEnd.w = LineEndSize.Mid;
break;
} }
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
_new_line.headEnd = new EndArrow();
_new_line.headEnd.type = LineEndType.Arrow;
_new_line.headEnd.len = LineEndSize.Mid;
_new_line.headEnd.w = LineEndSize.Mid;
break;
}
case "bentConnector5WithArrow": case "bentConnector5WithArrow":
{ {
_final_preset = "bentConnector5"; _final_preset = "bentConnector5";
_arrow_flag = true; _arrow_flag = true;
if (_old_line == null) { if (_old_line == null) {
_new_line = new CLn(); _new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
break;
} }
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
break;
}
case "bentConnector5WithTwoArrows": case "bentConnector5WithTwoArrows":
{ {
_final_preset = "bentConnector5"; _final_preset = "bentConnector5";
_arrow_flag = true; _arrow_flag = true;
if (_old_line == null) { if (_old_line == null) {
_new_line = new CLn(); _new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
_new_line.headEnd = new EndArrow();
_new_line.headEnd.type = LineEndType.Arrow;
_new_line.headEnd.len = LineEndSize.Mid;
_new_line.headEnd.w = LineEndSize.Mid;
break;
} }
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
_new_line.headEnd = new EndArrow();
_new_line.headEnd.type = LineEndType.Arrow;
_new_line.headEnd.len = LineEndSize.Mid;
_new_line.headEnd.w = LineEndSize.Mid;
break;
}
case "curvedConnector3WithArrow": case "curvedConnector3WithArrow":
{ {
_final_preset = "curvedConnector3"; _final_preset = "curvedConnector3";
_arrow_flag = true; _arrow_flag = true;
if (_old_line == null) { if (_old_line == null) {
_new_line = new CLn(); _new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
break;
} }
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
break;
}
case "curvedConnector3WithTwoArrows": case "curvedConnector3WithTwoArrows":
{ {
_final_preset = "curvedConnector3"; _final_preset = "curvedConnector3";
_arrow_flag = true; _arrow_flag = true;
if (_old_line == null) { if (_old_line == null) {
_new_line = new CLn(); _new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = new EndArrow();
_new_line.tailEnd.type = LineEndType.Arrow;
_new_line.tailEnd.len = LineEndSize.Mid;
_new_line.tailEnd.w = LineEndSize.Mid;
_new_line.headEnd = new EndArrow();
_new_line.headEnd.type = LineEndType.Arrow;
_new_line.headEnd.len = LineEndSize.Mid;
_new_line.headEnd.w = LineEndSize.Mid;
break;
} }
default: else {
{ _new_line = this.spPr.ln.createDuplicate();
_final_preset = sPreset; }
if (_old_line == null) { _new_line.tailEnd = new EndArrow();
_new_line = new CLn(); _new_line.tailEnd.type = LineEndType.Arrow;
} _new_line.tailEnd.len = LineEndSize.Mid;
else { _new_line.tailEnd.w = LineEndSize.Mid;
_new_line = this.spPr.ln.createDuplicate();
}
_new_line.tailEnd = null;
_new_line.headEnd = null; _new_line.headEnd = new EndArrow();
break; _new_line.headEnd.type = LineEndType.Arrow;
_new_line.headEnd.len = LineEndSize.Mid;
_new_line.headEnd.w = LineEndSize.Mid;
break;
}
default:
{
_final_preset = sPreset;
if (_old_line == null) {
_new_line = new CLn();
}
else {
_new_line = this.spPr.ln.createDuplicate();
} }
_new_line.tailEnd = null;
_new_line.headEnd = null;
break;
}
} }
var old_geometry = isRealObject(this.spPr.geometry) ? this.spPr.geometry : null; var old_geometry = isRealObject(this.spPr.geometry) ? this.spPr.geometry : null;
if (_final_preset != null) { if (_final_preset != null) {
...@@ -3272,7 +3272,7 @@ CShape.prototype = ...@@ -3272,7 +3272,7 @@ CShape.prototype =
var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
var check_line = CheckObjectLine(this); var check_line = CheckObjectLine(this);
var sqr_x = t_x * t_y, sqr_y = t_y * t_y; var sqr_x = t_x * t_x, sqr_y = t_y * t_y;
if (Math.sqrt(sqr_x + sqr_y) < radius) if (Math.sqrt(sqr_x + sqr_y) < radius)
return 0; return 0;
...@@ -3365,7 +3365,7 @@ CShape.prototype = ...@@ -3365,7 +3365,7 @@ CShape.prototype =
HitInLine(_hit_context, x_t, y_t, this.extX, 0, this.extX, this.extY) || HitInLine(_hit_context, x_t, y_t, this.extX, 0, this.extX, this.extY) ||
HitInLine(_hit_context, x_t, y_t, this.extX, this.extY, 0, this.extY) || HitInLine(_hit_context, x_t, y_t, this.extX, this.extY, 0, this.extY) ||
HitInLine(_hit_context, x_t, y_t, 0, this.extY, 0, 0) || HitInLine(_hit_context, x_t, y_t, 0, this.extY, 0, 0) ||
HitInLine(_hit_context, x_t, y_t, this.extX * 0.5, 0, this.extX * 0.5, -this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE))); HitInLine(_hit_context, x_t, y_t, this.extX * 0.5, 0, this.extX * 0.5, -this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE)));
}, },
canRotate: function () { canRotate: function () {
...@@ -3473,119 +3473,119 @@ CShape.prototype = ...@@ -3473,119 +3473,119 @@ CShape.prototype =
switch (data.Type) { switch (data.Type) {
case historyitem_SetShapeRot: case historyitem_SetShapeRot:
{ {
this.spPr.xfrm.rot = data.oldRot; this.spPr.xfrm.rot = data.oldRot;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeOffset: case historyitem_SetShapeOffset:
{ {
this.spPr.xfrm.offX = data.oldOffsetX; this.spPr.xfrm.offX = data.oldOffsetX;
this.spPr.xfrm.offY = data.oldOffsetY; this.spPr.xfrm.offY = data.oldOffsetY;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeExtents: case historyitem_SetShapeExtents:
{ {
this.spPr.xfrm.extX = data.oldExtentX; this.spPr.xfrm.extX = data.oldExtentX;
this.spPr.xfrm.extY = data.oldExtentY; this.spPr.xfrm.extY = data.oldExtentY;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateGeometry = true; this.recalcInfo.recalculateGeometry = true;
break; break;
} }
case historyitem_SetShapeFlips: case historyitem_SetShapeFlips:
{ {
this.spPr.xfrm.flipH = data.oldFlipH; this.spPr.xfrm.flipH = data.oldFlipH;
this.spPr.xfrm.flipV = data.oldFlipV; this.spPr.xfrm.flipV = data.oldFlipV;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break; break;
} }
case historyitem_SetShapeSetFill: case historyitem_SetShapeSetFill:
{ {
if (isRealObject(data.oldFill)) { if (isRealObject(data.oldFill)) {
this.spPr.Fill = data.oldFill.createDuplicate(); this.spPr.Fill = data.oldFill.createDuplicate();
} }
else { else {
this.spPr.Fill = null; this.spPr.Fill = null;
} }
this.recalcInfo.recalculateFill = true; this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true; this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true; this.recalcInfo.recalculateTransparent = true;
break; break;
} }
case historyitem_SetShapeSetLine: case historyitem_SetShapeSetLine:
{ {
if (isRealObject(data.oldLine)) { if (isRealObject(data.oldLine)) {
this.spPr.ln = data.oldLine.createDuplicate(); this.spPr.ln = data.oldLine.createDuplicate();
} }
else { else {
this.spPr.ln = null; this.spPr.ln = null;
}
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
break;
} }
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
break;
}
case historyitem_SetShapeSetGeometry: case historyitem_SetShapeSetGeometry:
{ {
if (isRealObject(data.oldGeometry)) { if (isRealObject(data.oldGeometry)) {
this.spPr.geometry = data.oldGeometry.createDuplicate(); this.spPr.geometry = data.oldGeometry.createDuplicate();
this.spPr.geometry.Init(5, 5); this.spPr.geometry.Init(5, 5);
}
else {
this.spPr.geometry = null;
}
this.recalcInfo.recalculateGeometry = true;
break;
} }
case historyitem_SetShapeBodyPr: else {
{ this.spPr.geometry = null;
this.txBody.bodyPr = data.oldBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
} }
this.recalcInfo.recalculateGeometry = true;
break;
}
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = data.oldBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
case historyitem_SetSetNvSpPr: case historyitem_SetSetNvSpPr:
{ {
this.nvSpPr = data.oldPr; this.nvSpPr = data.oldPr;
break; break;
} }
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
this.spPr = data.oldPr; this.spPr = data.oldPr;
break; break;
} }
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
this.style = data.oldPr; this.style = data.oldPr;
break; break;
} }
case historyitem_SetTextBody: case historyitem_SetTextBody:
{ {
this.txBody = data.oldPr; this.txBody = data.oldPr;
break; break;
} }
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
this.group = data.oldPr; this.group = data.oldPr;
break; break;
} }
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
{ {
this.parent = data.Old; this.parent = data.Old;
break; break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
if (!this.parent) { if (!this.parent) {
...@@ -3597,117 +3597,117 @@ CShape.prototype = ...@@ -3597,117 +3597,117 @@ CShape.prototype =
switch (data.Type) { switch (data.Type) {
case historyitem_SetShapeRot: case historyitem_SetShapeRot:
{ {
this.spPr.xfrm.rot = data.newRot; this.spPr.xfrm.rot = data.newRot;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeOffset: case historyitem_SetShapeOffset:
{ {
this.spPr.xfrm.offX = data.newOffsetX; this.spPr.xfrm.offX = data.newOffsetX;
this.spPr.xfrm.offY = data.newOffsetY; this.spPr.xfrm.offY = data.newOffsetY;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeExtents: case historyitem_SetShapeExtents:
{ {
this.spPr.xfrm.extX = data.newExtentX; this.spPr.xfrm.extX = data.newExtentX;
this.spPr.xfrm.extY = data.newExtentY; this.spPr.xfrm.extY = data.newExtentY;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateGeometry = true; this.recalcInfo.recalculateGeometry = true;
break; break;
} }
case historyitem_SetShapeFlips: case historyitem_SetShapeFlips:
{ {
this.spPr.xfrm.flipH = data.newFlipH; this.spPr.xfrm.flipH = data.newFlipH;
this.spPr.xfrm.flipV = data.newFlipV; this.spPr.xfrm.flipV = data.newFlipV;
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break; break;
} }
case historyitem_SetShapeSetFill: case historyitem_SetShapeSetFill:
{ {
if (isRealObject(data.newFill)) { if (isRealObject(data.newFill)) {
this.spPr.Fill = data.newFill.createDuplicate(); this.spPr.Fill = data.newFill.createDuplicate();
}
this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true;
break;
} }
case historyitem_SetShapeSetLine: this.recalcInfo.recalculateFill = true;
{ this.recalcInfo.recalculateBrush = true;
if (isRealObject(data.newLine)) { this.recalcInfo.recalculateTransparent = true;
this.spPr.ln = data.newLine.createDuplicate();
}
else {
this.spPr.ln = null;
}
this.recalcInfo.recalculateLine = true; break;
this.recalcInfo.recalculatePen = true; }
break; case historyitem_SetShapeSetLine:
{
if (isRealObject(data.newLine)) {
this.spPr.ln = data.newLine.createDuplicate();
} }
else {
this.spPr.ln = null;
}
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
break;
}
case historyitem_SetShapeSetGeometry: case historyitem_SetShapeSetGeometry:
{ {
if (isRealObject(data.newGeometry)) { if (isRealObject(data.newGeometry)) {
this.spPr.geometry = data.newGeometry.createDuplicate(); this.spPr.geometry = data.newGeometry.createDuplicate();
this.spPr.geometry.Init(5, 5); this.spPr.geometry.Init(5, 5);
}
else {
this.spPr.geometry = null;
}
this.recalcInfo.recalculateGeometry = true;
break;
} }
case historyitem_SetShapeBodyPr: else {
{ this.spPr.geometry = null;
this.txBody.bodyPr = data.newBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
} }
this.recalcInfo.recalculateGeometry = true;
break;
}
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = data.newBodyPr.createDuplicate();
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
case historyitem_SetSetNvSpPr: case historyitem_SetSetNvSpPr:
{ {
this.nvSpPr = data.newPr; this.nvSpPr = data.newPr;
break; break;
} }
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
this.spPr = data.newPr; this.spPr = data.newPr;
break; break;
} }
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
this.style = data.newPr; this.style = data.newPr;
break; break;
} }
case historyitem_SetTextBody: case historyitem_SetTextBody:
{ {
this.txBody = data.newPr; this.txBody = data.newPr;
break; break;
} }
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
this.group = data.newPr; this.group = data.newPr;
break; break;
} }
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
{ {
this.parent = data.New; this.parent = data.New;
break; break;
} }
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
if (!this.parent) { if (!this.parent) {
...@@ -3721,111 +3721,111 @@ CShape.prototype = ...@@ -3721,111 +3721,111 @@ CShape.prototype =
var bool; var bool;
switch (data.Type) { switch (data.Type) {
case historyitem_SetShapeRot: case historyitem_SetShapeRot:
{ {
w.WriteDouble(data.newRot); w.WriteDouble(data.newRot);
break; break;
} }
case historyitem_SetShapeOffset: case historyitem_SetShapeOffset:
{ {
w.WriteDouble(data.newOffsetX); w.WriteDouble(data.newOffsetX);
w.WriteDouble(data.newOffsetY); w.WriteDouble(data.newOffsetY);
break; break;
} }
case historyitem_SetShapeExtents: case historyitem_SetShapeExtents:
{ {
w.WriteDouble(data.newExtentX); w.WriteDouble(data.newExtentX);
w.WriteDouble(data.newExtentY); w.WriteDouble(data.newExtentY);
break; break;
} }
case historyitem_SetShapeFlips: case historyitem_SetShapeFlips:
{ {
w.WriteBool(data.newFlipH); w.WriteBool(data.newFlipH);
w.WriteBool(data.newFlipV); w.WriteBool(data.newFlipV);
break; break;
} }
case historyitem_SetShapeSetFill: case historyitem_SetShapeSetFill:
{ {
w.WriteBool(isRealObject(data.newFill)); w.WriteBool(isRealObject(data.newFill));
if (isRealObject(data.newFill)) { if (isRealObject(data.newFill)) {
data.newFill.Write_ToBinary2(w); data.newFill.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetShapeSetLine: case historyitem_SetShapeSetLine:
{ {
w.WriteBool(isRealObject(data.newLine)); w.WriteBool(isRealObject(data.newLine));
if (isRealObject(data.newLine)) { if (isRealObject(data.newLine)) {
data.newLine.Write_ToBinary2(w); data.newLine.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetShapeSetGeometry: case historyitem_SetShapeSetGeometry:
{ {
w.WriteBool(isRealObject(data.newGeometry)); w.WriteBool(isRealObject(data.newGeometry));
if (isRealObject(data.newGeometry)) { if (isRealObject(data.newGeometry)) {
data.newGeometry.Write_ToBinary2(w); data.newGeometry.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetShapeBodyPr: case historyitem_SetShapeBodyPr:
{ {
data.newBodyPr.Write_ToBinary2(w); data.newBodyPr.Write_ToBinary2(w);
break; break;
} }
case historyitem_SetSetNvSpPr: case historyitem_SetSetNvSpPr:
{ {
w.WriteBool(isRealObject(data.newPr)); w.WriteBool(isRealObject(data.newPr));
if (isRealObject(data.newPr)) { if (isRealObject(data.newPr)) {
data.newPr.Write_ToBinary2(w); data.newPr.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
w.WriteBool(isRealObject(data.newPr)); w.WriteBool(isRealObject(data.newPr));
if (isRealObject(data.newPr)) { if (isRealObject(data.newPr)) {
data.newPr.Write_ToBinary2(w); data.newPr.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
w.WriteBool(isRealObject(data.newPr)); w.WriteBool(isRealObject(data.newPr));
if (isRealObject(data.newPr)) { if (isRealObject(data.newPr)) {
data.newPr.Write_ToBinary2(w); data.newPr.Write_ToBinary2(w);
}
break;
} }
break;
}
case historyitem_SetTextBody: case historyitem_SetTextBody:
{ {
w.WriteBool(isRealObject(data.newPr)); w.WriteBool(isRealObject(data.newPr));
if (isRealObject(data.newPr)) { if (isRealObject(data.newPr)) {
w.WriteString2(data.newPr.Get_Id()); w.WriteString2(data.newPr.Get_Id());
}
break;
} }
break;
}
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
w.WriteBool(isRealObject(data.newPr)); w.WriteBool(isRealObject(data.newPr));
if (isRealObject(data.newPr)) { if (isRealObject(data.newPr)) {
w.WriteString2(data.newPr.Get_Id()); w.WriteString2(data.newPr.Get_Id());
}
break;
} }
break;
}
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
{ {
w.WriteBool(isRealObject(data.New)); w.WriteBool(isRealObject(data.New));
if (isRealObject(data.New)) { if (isRealObject(data.New)) {
w.WriteString2(data.New.Id); w.WriteString2(data.New.Id);
}
break;
} }
break;
}
} }
}, },
...@@ -3833,150 +3833,150 @@ CShape.prototype = ...@@ -3833,150 +3833,150 @@ CShape.prototype =
if (r.GetLong() === historyitem_type_Shape) { if (r.GetLong() === historyitem_type_Shape) {
switch (r.GetLong()) { switch (r.GetLong()) {
case historyitem_SetShapeRot: case historyitem_SetShapeRot:
{ {
this.spPr.xfrm.rot = r.GetDouble(); this.spPr.xfrm.rot = r.GetDouble();
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeOffset: case historyitem_SetShapeOffset:
{ {
this.spPr.xfrm.offX = r.GetDouble(); this.spPr.xfrm.offX = r.GetDouble();
this.spPr.xfrm.offY = r.GetDouble(); this.spPr.xfrm.offY = r.GetDouble();
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
break; break;
} }
case historyitem_SetShapeExtents: case historyitem_SetShapeExtents:
{ {
this.spPr.xfrm.extX = r.GetDouble(); this.spPr.xfrm.extX = r.GetDouble();
this.spPr.xfrm.extY = r.GetDouble(); this.spPr.xfrm.extY = r.GetDouble();
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateGeometry = true; this.recalcInfo.recalculateGeometry = true;
break; break;
} }
case historyitem_SetShapeFlips: case historyitem_SetShapeFlips:
{ {
this.spPr.xfrm.flipH = r.GetBool(); this.spPr.xfrm.flipH = r.GetBool();
this.spPr.xfrm.flipV = r.GetBool(); this.spPr.xfrm.flipV = r.GetBool();
this.recalcInfo.recalculateTransform = true; this.recalcInfo.recalculateTransform = true;
this.recalcInfo.recalculateTransformText = true; this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateContent = true; this.recalcInfo.recalculateContent = true;
break; break;
} }
case historyitem_SetShapeSetFill: case historyitem_SetShapeSetFill:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.spPr.Fill = new CUniFill(); this.spPr.Fill = new CUniFill();
this.spPr.Fill.Read_FromBinary2(r); this.spPr.Fill.Read_FromBinary2(r);
} }
if (this.spPr.Fill && this.spPr.Fill.fill instanceof CBlipFill if (this.spPr.Fill && this.spPr.Fill.fill instanceof CBlipFill
&& typeof this.spPr.Fill.fill.RasterImageId === "string") { && typeof this.spPr.Fill.fill.RasterImageId === "string") {
CollaborativeEditing.Add_NewImage(this.spPr.Fill.fill.RasterImageId); CollaborativeEditing.Add_NewImage(this.spPr.Fill.fill.RasterImageId);
}
this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true;
break;
} }
this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true;
break;
}
case historyitem_SetShapeSetLine: case historyitem_SetShapeSetLine:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.spPr.ln = new CLn(); this.spPr.ln = new CLn();
this.spPr.ln.Read_FromBinary2(r); this.spPr.ln.Read_FromBinary2(r);
}
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
break;
} }
this.recalcInfo.recalculateLine = true;
this.recalcInfo.recalculatePen = true;
break;
}
case historyitem_SetShapeSetGeometry: case historyitem_SetShapeSetGeometry:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.spPr.geometry = new Geometry(); this.spPr.geometry = new Geometry();
this.spPr.geometry.Read_FromBinary2(r); this.spPr.geometry.Read_FromBinary2(r);
this.spPr.geometry.Init(5, 5); this.spPr.geometry.Init(5, 5);
}
else {
this.spPr.geometry = null;
}
this.recalcInfo.recalculateGeometry = true;
break;
} }
case historyitem_SetShapeBodyPr: else {
{ this.spPr.geometry = null;
this.txBody.bodyPr = new CBodyPr();
this.txBody.bodyPr.Read_FromBinary2(r);
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
} }
this.recalcInfo.recalculateGeometry = true;
break;
}
case historyitem_SetShapeBodyPr:
{
this.txBody.bodyPr = new CBodyPr();
this.txBody.bodyPr.Read_FromBinary2(r);
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
break;
}
case historyitem_SetSetNvSpPr: case historyitem_SetSetNvSpPr:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.nvSpPr = new UniNvPr(); this.nvSpPr = new UniNvPr();
this.nvSpPr.Read_FromBinary2(r); this.nvSpPr.Read_FromBinary2(r);
} }
else { else {
this.nvSpPr = null; this.nvSpPr = null;
}
break;
} }
break;
}
case historyitem_SetSetSpPr: case historyitem_SetSetSpPr:
{ {
this.spPr = new CSpPr(); this.spPr = new CSpPr();
if (r.GetBool()) { if (r.GetBool()) {
this.spPr.Read_FromBinary2(r); this.spPr.Read_FromBinary2(r);
}
break;
} }
break;
}
case historyitem_SetSetStyle: case historyitem_SetSetStyle:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.style = new CShapeStyle(); this.style = new CShapeStyle();
this.style.Read_FromBinary2(r); this.style.Read_FromBinary2(r);
}
else {
this.style = null;
}
break;
} }
else {
this.style = null;
}
break;
}
case historyitem_SetTextBody: case historyitem_SetTextBody:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.txBody = g_oTableId.Get_ById(r.GetString2()); this.txBody = g_oTableId.Get_ById(r.GetString2());
} }
else { else {
this.txBody = null; this.txBody = null;
}
break;
} }
break;
}
case historyitem_SetSpGroup: case historyitem_SetSpGroup:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.group = g_oTableId.Get_ById(r.GetString2()); this.group = g_oTableId.Get_ById(r.GetString2());
} }
else { else {
this.group = null; this.group = null;
}
break;
} }
break;
}
case historyitem_SetShapeParent: case historyitem_SetShapeParent:
{ {
if (r.GetBool()) { if (r.GetBool()) {
this.parent = g_oTableId.Get_ById(r.GetString2()); this.parent = g_oTableId.Get_ById(r.GetString2());
}
break;
} }
break;
}
} }
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
......
...@@ -220,7 +220,7 @@ CTextBody.prototype = ...@@ -220,7 +220,7 @@ CTextBody.prototype =
var Doc = this.content; var Doc = this.content;
if ( true === Doc.Is_SelectionUse() && !Doc.Selection_IsEmpty()) if ( true === Doc.Is_SelectionUse() && !Doc.Selection_IsEmpty())
{ {
drawingDocument.UpdateTargetTransform(this.shape.transformText); drawingDocument.UpdateTargetTransform(this.shape.transformText);
drawingDocument.TargetEnd(); drawingDocument.TargetEnd();
drawingDocument.SelectEnabled(true); drawingDocument.SelectEnabled(true);
drawingDocument.SelectClear(); drawingDocument.SelectClear();
...@@ -636,9 +636,9 @@ CTextBody.prototype = ...@@ -636,9 +636,9 @@ CTextBody.prototype =
draw: function(graphics) draw: function(graphics)
{ {
/*if(this.content.Is_Empty() && isRealObject(this.phContent)) /*if(this.content.Is_Empty() && isRealObject(this.phContent))
this.content2.Draw(graphics); this.content2.Draw(graphics);
else else
this.content.Draw(0, graphics); */ this.content.Draw(0, graphics); */
if((!this.content || this.content.Is_Empty()) && this.content2!=null && !this.shape.addTextFlag && (this.shape.isEmptyPlaceholder ? this.shape.isEmptyPlaceholder() : false)) if((!this.content || this.content.Is_Empty()) && this.content2!=null && !this.shape.addTextFlag && (this.shape.isEmptyPlaceholder ? this.shape.isEmptyPlaceholder() : false))
{ {
...@@ -914,13 +914,13 @@ CTextBody.prototype = ...@@ -914,13 +914,13 @@ CTextBody.prototype =
var par = this.content.Content[i]; var par = this.content.Content[i];
for(var j = 0; j < par.Lines.length; ++j) for(var j = 0; j < par.Lines.length; ++j)
{ {
if(par.Lines[j].Ranges[0].W + 1> max_width) if(par.Lines[j].Ranges[0].W + 1 > max_width)
{ {
max_width = par.Lines[j].Ranges[0].W; max_width = par.Lines[j].Ranges[0].W + 1;
} }
} }
} }
return max_width + r_ins + l_ins; return max_width + 1 + r_ins + l_ins;
}, },
getRectHeight: function(maxHeight, width) getRectHeight: function(maxHeight, width)
......
...@@ -813,7 +813,7 @@ CGraphicObjects.prototype = { ...@@ -813,7 +813,7 @@ CGraphicObjects.prototype = {
case STATES_ID_TEXT_ADD: case STATES_ID_TEXT_ADD:
case STATES_ID_GROUP: case STATES_ID_GROUP:
case STATES_ID_TEXT_ADD_IN_GROUP: case STATES_ID_TEXT_ADD_IN_GROUP:
// case STATES_ID_TEXT_ADD_IN_GROUP: // case STATES_ID_TEXT_ADD_IN_GROUP:
{ {
if(this.State.id === STATES_ID_GROUP || this.State.id === STATES_ID_TEXT_ADD_IN_GROUP) if(this.State.id === STATES_ID_GROUP || this.State.id === STATES_ID_TEXT_ADD_IN_GROUP)
{ {
...@@ -1128,8 +1128,11 @@ CGraphicObjects.prototype = { ...@@ -1128,8 +1128,11 @@ CGraphicObjects.prototype = {
SubType: -1 SubType: -1
} }
}; };
editor.sync_PrLineSpacingCallBack(_empty_para_pr.Spacing); editor.sync_ParaSpacingLine( _empty_para_pr.Spacing );
editor.UpdateParagraphProp(_empty_para_pr); editor.Update_ParaInd(_empty_para_pr.Ind);
editor.sync_PrAlignCallBack(_empty_para_pr.Jc);
editor.sync_ParaStyleName(_empty_para_pr.StyleName);
editor.sync_ListType(_empty_para_pr.ListType);
} }
if(text_props != null) if(text_props != null)
...@@ -1195,7 +1198,7 @@ CGraphicObjects.prototype = { ...@@ -1195,7 +1198,7 @@ CGraphicObjects.prototype = {
switch(this.State.id) switch(this.State.id)
{ {
case STATES_ID_NULL: case STATES_ID_NULL:
//case STATES_ID_TEXT_ADD: //case STATES_ID_TEXT_ADD:
// case STATES_ID_TEXT_ADD_IN_GROUP: // case STATES_ID_TEXT_ADD_IN_GROUP:
{ {
var shapes = by_types.shapes; var shapes = by_types.shapes;
...@@ -2116,8 +2119,10 @@ CGraphicObjects.prototype = { ...@@ -2116,8 +2119,10 @@ CGraphicObjects.prototype = {
image.setGeometry( CreateGeometry("rect")); image.setGeometry( CreateGeometry("rect"));
image.spPr.geometry.Init(5, 5); image.spPr.geometry.Init(5, 5);
image.setXfrm((this.slide.presentation.Width - W)/2, (this.slide.presentation.Height - H)/2, W, H, null, null, null); image.setXfrm((this.slide.presentation.Width - W)/2, (this.slide.presentation.Height - H)/2, W, H, null, null, null);
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_AddShape, image) === false) if (editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_AddShape, image) === false)
{ {
this.resetSelectionState();
image.select(this);
this.slide.addToSpTreeToPos(this.slide.cSld.spTree.length, image); this.slide.addToSpTreeToPos(this.slide.cSld.spTree.length, image);
editor.WordControl.m_oLogicDocument.recalcMap[image.Id] = image; editor.WordControl.m_oLogicDocument.recalcMap[image.Id] = image;
} }
...@@ -2380,9 +2385,9 @@ CGraphicObjects.prototype = { ...@@ -2380,9 +2385,9 @@ CGraphicObjects.prototype = {
if(_tmp_sel_state.textSelectionState != undefined) if(_tmp_sel_state.textSelectionState != undefined)
{ {
/*if(_prev_sel_state != undefined && _tmp_sel_state.textObject != _prev_sel_state.textObject) /*if(_prev_sel_state != undefined && _tmp_sel_state.textObject != _prev_sel_state.textObject)
{ {
return _arr_sel_states[_pos_sel_state]; return _arr_sel_states[_pos_sel_state];
}*/ }*/
var _text_sel_state = _tmp_sel_state.textSelectionState; var _text_sel_state = _tmp_sel_state.textSelectionState;
if(b_table && isRealNumber(cur_row) && isRealNumber(cur_cell)) if(b_table && isRealNumber(cur_row) && isRealNumber(cur_cell))
{ {
...@@ -2573,7 +2578,7 @@ CGraphicObjects.prototype = { ...@@ -2573,7 +2578,7 @@ CGraphicObjects.prototype = {
} }
} }
} }
} }
_prev_sel_state = _tmp_sel_state; _prev_sel_state = _tmp_sel_state;
...@@ -3353,7 +3358,7 @@ CGraphicObjects.prototype = { ...@@ -3353,7 +3358,7 @@ CGraphicObjects.prototype = {
break; break;
} }
} }
// this.updateSelectionState() // this.updateSelectionState()
}, },
recalculateCurPos: function() recalculateCurPos: function()
...@@ -3392,16 +3397,16 @@ CGraphicObjects.prototype = { ...@@ -3392,16 +3397,16 @@ CGraphicObjects.prototype = {
{ {
this.State.onMouseUp(e, x, y); this.State.onMouseUp(e, x, y);
this.slide.presentation.Document_UpdateInterfaceState(); this.slide.presentation.Document_UpdateInterfaceState();
/* if(this.State.id === STATES_ID_NULL) /* if(this.State.id === STATES_ID_NULL)
{ */ { */
if(this.selectedObjects.length > 0) if(this.selectedObjects.length > 0)
{ {
var _data = new CContextMenuData(); var _data = new CContextMenuData();
_data.Type = c_oAscContextMenuTypes.Main; _data.Type = c_oAscContextMenuTypes.Main;
_data.X_abs = e.X; _data.X_abs = e.X;
_data.Y_abs = e.Y; _data.Y_abs = e.Y;
editor.sync_ContextMenuCallback(_data); editor.sync_ContextMenuCallback(_data);
} }
//} //}
}, },
......
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