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,58 +1835,34 @@ asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){ ...@@ -1835,58 +1835,34 @@ 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) )
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); var graphicObjects = _presentation.Slides[_presentation.CurPage].graphicObjects;
graphicObjects.checkSelectedObjectsAndCallback(function(){
// 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 ) if ( "undefined" != typeof(Props.Ind) && null != Props.Ind )
this.WordControl.m_oLogicDocument.Set_ParagraphIndent( Props.Ind ); graphicObjects.setParagraphIndent( Props.Ind );
if ( "undefined" != typeof(Props.Jc) && null != Props.Jc ) if ( "undefined" != typeof(Props.Jc) && null != Props.Jc )
this.WordControl.m_oLogicDocument.Set_ParagraphAlign( Props.Jc ); graphicObjects.setParagraphAlign( 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 )
this.WordControl.m_oLogicDocument.Set_ParagraphWidowControl( Props.WidowControl );
if ( "undefined" != typeof(Props.PageBreakBefore) && null != Props.PageBreakBefore )
this.WordControl.m_oLogicDocument.Set_ParagraphPageBreakBefore( Props.PageBreakBefore );
if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing ) if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing )
this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( Props.Spacing ); graphicObjects.setParagraphSpacing( Props.Spacing );
if ( "undefined" != typeof(Props.Shd) && null != Props.Shd )
this.WordControl.m_oLogicDocument.Set_ParagraphShd( Props.Shd );
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 );
} }
// TODO: как только разъединят настройки параграфа и текста переделать тут
var TextPr = new CTextPr(); var TextPr = new CTextPr();
if ( true === Props.Subscript ) if ( true === Props.Subscript )
...@@ -1927,9 +1903,10 @@ asc_docs_api.prototype.paraApply = function(Props) ...@@ -1927,9 +1903,10 @@ asc_docs_api.prototype.paraApply = function(Props)
if ( undefined != Props.Position ) if ( undefined != Props.Position )
TextPr.Position = Props.Position; TextPr.Position = Props.Position;
graphicObjects.paragraphAdd( new ParaTextPr(TextPr) );
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr(TextPr) ); _presentation.Recalculate();
this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState(); _presentation.Document_UpdateInterfaceState();
}, []);
} }
} }
...@@ -2082,13 +2059,9 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -2082,13 +2059,9 @@ 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.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.ShapeApply(prop); this.WordControl.m_oLogicDocument.ShapeApply(prop);
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url); this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
} }
}
else else
{ {
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage); this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
...@@ -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