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

Bug 28056 - Undo после изменение параметра "First Line" проходит только с третьего раза

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60273 954022d7-b5bf-4e40-9824-e11837661b57
parent 3714355d
...@@ -1835,102 +1835,79 @@ asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){ ...@@ -1835,102 +1835,79 @@ asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){
asc_docs_api.prototype.paraApply = function(Props) asc_docs_api.prototype.paraApply = function(Props)
{ {
var Additional = undefined; var _presentation = editor.WordControl.m_oLogicDocument;
if(_presentation.Slides[_presentation.CurPage])
{
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Text_Props, Additional) ) var graphicObjects = _presentation.Slides[_presentation.CurPage].graphicObjects;
{ graphicObjects.checkSelectedObjectsAndCallback(function(){
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
// TODO: Сделать так, чтобы пересчет был всего 1 здесь
if ( "undefined" != typeof(Props.ContextualSpacing) && null != Props.ContextualSpacing )
this.WordControl.m_oLogicDocument.Set_ParagraphContextualSpacing( Props.ContextualSpacing );
if ( "undefined" != typeof(Props.Ind) && null != Props.Ind )
this.WordControl.m_oLogicDocument.Set_ParagraphIndent( Props.Ind );
if ( "undefined" != typeof(Props.Jc) && null != Props.Jc )
this.WordControl.m_oLogicDocument.Set_ParagraphAlign( Props.Jc );
if ( "undefined" != typeof(Props.KeepLines) && null != Props.KeepLines )
this.WordControl.m_oLogicDocument.Set_ParagraphKeepLines( Props.KeepLines );
if ( undefined != Props.KeepNext && null != Props.KeepNext )
this.WordControl.m_oLogicDocument.Set_ParagraphKeepNext( Props.KeepNext );
if ( undefined != Props.WidowControl && null != Props.WidowControl ) if ( "undefined" != typeof(Props.Ind) && null != Props.Ind )
this.WordControl.m_oLogicDocument.Set_ParagraphWidowControl( Props.WidowControl ); graphicObjects.setParagraphIndent( Props.Ind );
if ( "undefined" != typeof(Props.PageBreakBefore) && null != Props.PageBreakBefore ) if ( "undefined" != typeof(Props.Jc) && null != Props.Jc )
this.WordControl.m_oLogicDocument.Set_ParagraphPageBreakBefore( Props.PageBreakBefore ); graphicObjects.setParagraphAlign( Props.Jc );
if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing )
this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( Props.Spacing );
if ( "undefined" != typeof(Props.Shd) && null != Props.Shd ) if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing )
this.WordControl.m_oLogicDocument.Set_ParagraphShd( Props.Shd ); graphicObjects.setParagraphSpacing( Props.Spacing );
if ( "undefined" != typeof(Props.Brd) && null != Props.Brd )
this.WordControl.m_oLogicDocument.Set_ParagraphBorders( Props.Brd );
if ( undefined != Props.Tabs ) if ( undefined != Props.Tabs )
{ {
var Tabs = new CParaTabs(); var Tabs = new CParaTabs();
Tabs.Set_FromObject( Props.Tabs.Tabs ); Tabs.Set_FromObject( Props.Tabs.Tabs );
this.WordControl.m_oLogicDocument.Set_ParagraphTabs( Tabs ); graphicObjects.setParagraphTabs( Tabs );
} }
if ( undefined != Props.DefaultTab ) if ( undefined != Props.DefaultTab )
{ {
this.WordControl.m_oLogicDocument.Set_DocumentDefaultTab( Props.DefaultTab ); _presentation.Set_DocumentDefaultTab( Props.DefaultTab );
} }
var TextPr = new CTextPr();
if ( true === Props.Subscript )
TextPr.VertAlign = vertalign_SubScript;
else if ( true === Props.Superscript )
TextPr.VertAlign = vertalign_SuperScript;
else if ( false === Props.Superscript || false === Props.Subscript )
TextPr.VertAlign = vertalign_Baseline;
// TODO: как только разъединят настройки параграфа и текста переделать тут if ( undefined != Props.Strikeout )
var TextPr = new CTextPr(); {
TextPr.Strikeout = Props.Strikeout;
TextPr.DStrikeout = false;
}
if ( true === Props.Subscript ) if ( undefined != Props.DStrikeout )
TextPr.VertAlign = vertalign_SubScript; {
else if ( true === Props.Superscript ) TextPr.DStrikeout = Props.DStrikeout;
TextPr.VertAlign = vertalign_SuperScript; if ( true === TextPr.DStrikeout )
else if ( false === Props.Superscript || false === Props.Subscript ) TextPr.Strikeout = false;
TextPr.VertAlign = vertalign_Baseline; }
if ( undefined != Props.Strikeout ) if ( undefined != Props.SmallCaps )
{ {
TextPr.Strikeout = Props.Strikeout; TextPr.SmallCaps = Props.SmallCaps;
TextPr.DStrikeout = false; TextPr.AllCaps = false;
} }
if ( undefined != Props.DStrikeout ) if ( undefined != Props.AllCaps )
{ {
TextPr.DStrikeout = Props.DStrikeout; TextPr.Caps = Props.AllCaps;
if ( true === TextPr.DStrikeout ) if ( true === TextPr.AllCaps )
TextPr.Strikeout = false; TextPr.SmallCaps = false;
} }
if ( undefined != Props.SmallCaps ) if ( undefined != Props.TextSpacing )
{ TextPr.Spacing = Props.TextSpacing;
TextPr.SmallCaps = Props.SmallCaps;
TextPr.AllCaps = false;
}
if ( undefined != Props.AllCaps ) if ( undefined != Props.Position )
{ TextPr.Position = Props.Position;
TextPr.Caps = Props.AllCaps; graphicObjects.paragraphAdd( new ParaTextPr(TextPr) );
if ( true === TextPr.AllCaps ) _presentation.Recalculate();
TextPr.SmallCaps = false; _presentation.Document_UpdateInterfaceState();
}, []);
} }
if ( undefined != Props.TextSpacing )
TextPr.Spacing = Props.TextSpacing;
if ( undefined != Props.Position )
TextPr.Position = Props.Position;
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr(TextPr) );
this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
}
} }
asc_docs_api.prototype.put_PrAlign = function(value) asc_docs_api.prototype.put_PrAlign = function(value)
...@@ -2082,12 +2059,8 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2082,12 +2059,8 @@ asc_docs_api.prototype.ShapeApply = function(prop)
if (null != _image) if (null != _image)
{ {
var doc = this.WordControl.m_oLogicDocument; var doc = this.WordControl.m_oLogicDocument;
if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) this.WordControl.m_oLogicDocument.ShapeApply(prop);
{ this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.ShapeApply(prop);
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
}
} }
else else
{ {
...@@ -3017,7 +2990,7 @@ asc_docs_api.prototype.AddImageUrlAction = function(url){ ...@@ -3017,7 +2990,7 @@ asc_docs_api.prototype.AddImageUrlAction = function(url){
_w = Math.max(5, Math.min(_w, __w)); _w = Math.max(5, Math.min(_w, __w));
_h = Math.max(5, Math.min((_w * __h / __w) >> 0)); _h = Math.max(5, Math.min((_w * __h / __w) >> 0));
} }
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); // this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
var src = _image.src; var src = _image.src;
//this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src); //this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
...@@ -4490,11 +4463,7 @@ asc_docs_api.prototype.can_AddHyperlink = function() ...@@ -4490,11 +4463,7 @@ asc_docs_api.prototype.can_AddHyperlink = function()
} }
asc_docs_api.prototype.add_Hyperlink = function(HyperProps) asc_docs_api.prototype.add_Hyperlink = function(HyperProps)
{ {
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Hyperlink_Add( HyperProps ); this.WordControl.m_oLogicDocument.Hyperlink_Add( HyperProps );
}
} }
asc_docs_api.prototype.sync_HyperlinkClickCallback = function(Url) asc_docs_api.prototype.sync_HyperlinkClickCallback = function(Url)
{ {
......
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