Commit 43b31370 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@49585 954022d7-b5bf-4e40-9824-e11837661b57
parent 459c7174
......@@ -108,6 +108,8 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit)
NeedRecalc : true
};
this.SearchResults = new Object();
this.SpellChecker = new CParaSpellChecker();
......@@ -9249,9 +9251,13 @@ Paragraph.prototype =
// Считываем свойства для текущего стиля
var Pr = Styles.Get_Pr( StyleId, styles_Paragraph, TableStyle );
// Копируем прямые настройки параграфа.
// Копируем прямые настройки параграфа.
Pr.ParaPr.Merge( this.Pr );
Pr.TextPr.Merge( this.rPr );
Pr.ParaPr.StyleTabs = ( undefined != Pr.ParaPr.Tabs ? Pr.ParaPr.Tabs.Copy() : new CParaTabs() );
return Pr;
},
......
......@@ -575,7 +575,7 @@ CPresentation.prototype =
{
}
this.RecalculateCurPos();
this.DrawingDocument.OnRecalculatePage( this.CurPage, this.Slides[this.CurPage] );
this.DrawingDocument.OnEndRecalculate();
},
......
......@@ -536,8 +536,8 @@ CShape.prototype =
if(this.recalcInfo.recalculateTransparent)
{
this.compiledTransparent = null;
if(isRealObject(this.spPr) && isRealObject(this.spPr.Fill) && isRealNumber(this.spPr.transparent))
this.compiledTransparent = this.spPr.transparent;
if(isRealObject(this.spPr) && isRealObject(this.spPr.Fill) && isRealNumber(this.spPr.Fill.transparent))
this.compiledTransparent = this.spPr.Fill.transparent;
else if(isRealObject(this.group))
{
var group_transparent = this.group.getCompiledTransparent();
......@@ -550,9 +550,9 @@ CShape.prototype =
var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i)
{
if(isRealObject(hierarchy[i]) && isRealObject(hierarchy[i].spPr) && isRealObject(hierarchy[i].spPr.Fill) && isRealNumber(hierarchy[i].spPr.transparent))
if(isRealObject(hierarchy[i]) && isRealObject(hierarchy[i].spPr) && isRealObject(hierarchy[i].spPr.Fill) && isRealNumber(hierarchy[i].spPr.Fill.transparent))
{
this.compiledTransparent = this.spPr.transparent;
this.compiledTransparent = this.spPr.Fill.transparent;
break;
}
......@@ -564,9 +564,9 @@ CShape.prototype =
var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i)
{
if(isRealObject(hierarchy[i]) && isRealObject(hierarchy[i].spPr) && isRealObject(hierarchy[i].spPr.Fill) && isRealNumber(hierarchy[i].spPr.transparent))
if(isRealObject(hierarchy[i]) && isRealObject(hierarchy[i].spPr) && isRealObject(hierarchy[i].spPr.Fill) && isRealNumber(hierarchy[i].spPr.Fill.transparent))
{
this.compiledTransparent = this.spPr.transparent;
this.compiledTransparent = this.spPr.Fill.transparent;
break;
}
......@@ -2105,6 +2105,18 @@ CShape.prototype =
}
},
setParagraphTabs: function(val)
{
if(isRealObject(this.txBody))
{
this.txBody.content.Set_ParagraphTabs(val);
this.txBody.content.RecalculateCurPos();
this.recalcInfo.recalculateContent = true;
this.recalcInfo.recalculateTransformText = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}
},
applyAllSpacing: function(val)
{
if(isRealObject(this.txBody))
......@@ -2683,6 +2695,7 @@ CShape.prototype =
this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
......
......@@ -331,6 +331,40 @@ CGraphicObjects.prototype = {
}
},
setParagraphTabs: function(val)
{
switch (this.State.id)
{
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
{
this.State.textObject.setParagraphTabs(val);
//this.State.textObject.recalculate();
//this.updateSelectionState();
}
break;
}
case STATES_ID_NULL:
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Text_Props) === false)
{
for(var i = 0; i < this.selectedObjects.length; ++i)
{
if(typeof this.selectedObjects[i].applyAllSpacing === "function")
{
this.selectedObjects[i].applyAllSpacing(val);
}
}
}
break;
}
}
},
setParagraphSpacing: function(val)
{
switch (this.State.id)
......
......@@ -5774,9 +5774,59 @@ function CParaTabs()
CParaTabs.prototype =
{
Add : function(Tab)
Add : function(_Tab)
{
this.Tabs.push( Tab );
var Index = 0;
for (Index = 0; Index < this.Tabs.length; Index++ )
{
var Tab = this.Tabs[Index];
if ( Math.abs( Tab.Pos - _Tab.Pos ) < 0.001 )
{
this.Tabs.splice( Index, 1, _Tab );
break;
}
if ( Tab.Pos > _Tab.Pos )
break;
}
if ( -1 != Index )
this.Tabs.splice( Index, 0, _Tab );
},
Merge : function(Tabs)
{
var _Tabs = Tabs.Tabs;
for ( var Index = 0; Index < _Tabs.length; Index++ )
{
var _Tab = _Tabs[Index];
var Index2 = 0;
for (Index2 = 0; Index2 < this.Tabs.length; Index2++ )
{
var Tab = this.Tabs[Index2];
if ( Math.abs( Tab.Pos - _Tab.Pos ) < 0.001 )
{
if ( tab_Clear === _Tab.Value )
Index2 = -2; // таб нужно удалить
else
Index2 = -1; // табы совпали, не надо новый добавлять
break;
}
if ( Tab.Pos > _Tab.Pos )
break;
}
if ( -2 === Index2 )
this.Tabs.splice( Index2, 1 );
else if ( -1 != Index2 )
this.Tabs.splice( Index2, 0, _Tab );
}
},
Copy : function()
......@@ -5810,6 +5860,19 @@ CParaTabs.prototype =
return this.Tabs[Index];
},
Get_Value : function(Pos)
{
var Count = this.Tabs.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Tab = this.Tabs[Index];
if ( Math.abs(Tab.Pos - Pos) < 0.001 )
return Tab.Value;
}
return -1;
},
Write_ToBinary : function(Writer)
{
// Long : количество (если 0, удаляем элемент)
......@@ -5835,7 +5898,7 @@ CParaTabs.prototype =
// Double : Pos
var Count = Reader.GetLong();
this.Tabs = new Array( Count );
this.Tabs = new Array();
for ( var Index = 0; Index < Count; Index++ )
{
......@@ -5846,6 +5909,7 @@ CParaTabs.prototype =
}
}
function CParaInd()
{
this.Left = undefined; // Левый отступ
......
......@@ -73,6 +73,7 @@ function asc_docs_api(name)
// ASC_DOCS_API_USE_EMBEDDED_FONTS, кроме "true"(написание от регистра не зависит).
this.isUseEmbeddedCutFonts = ("true" == ASC_DOCS_API_USE_EMBEDDED_FONTS.toLowerCase());
this.noCreatePoint = false;
this.pasteCallback = null;
this.pasteImageMap = null;
this.EndActionLoadImages = 0;
......@@ -1614,35 +1615,102 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
asc_docs_api.prototype.paraApply = function(Props)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
var Additional = undefined;
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Text_Props, Additional) )
{
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 )
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 )
this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( 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 )
{
var Tabs = new CParaTabs();
Tabs.Set_FromObject( Props.Tabs.Tabs );
this.WordControl.m_oLogicDocument.Set_ParagraphTabs( Tabs );
}
if ( undefined != Props.DefaultTab )
{
this.WordControl.m_oLogicDocument.Set_DocumentDefaultTab( Props.DefaultTab );
}
// TODO: Сделать так, чтобы пересчет был всего 1 здесь
if ( "undefined" != typeof(Props.ContextualSpacing) && null != Props.ContextualSpacing )
this.WordControl.m_oLogicDocument.Set_ParagraphContextualSpacing( Props.ContextualSpacing );
// TODO: как только разъединят настройки параграфа и текста переделать тут
var TextPr = new CTextPr();
if ( "undefined" != typeof(Props.Ind) && null != Props.Ind )
this.WordControl.m_oLogicDocument.Set_ParagraphIndent( Props.Ind );
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;
if ( "undefined" != typeof(Props.Jc) && null != Props.Jc )
this.WordControl.m_oLogicDocument.Set_ParagraphAlign( Props.Jc );
if ( undefined != Props.Strikeout )
{
TextPr.Strikeout = Props.Strikeout;
TextPr.DStrikeout = false;
}
if ( "undefined" != typeof(Props.KeepLines) && null != Props.KeepLines )
this.WordControl.m_oLogicDocument.Set_ParagraphKeepLines( Props.KeepLines );
if ( undefined != Props.DStrikeout )
{
TextPr.DStrikeout = Props.DStrikeout;
if ( true === TextPr.DStrikeout )
TextPr.Strikeout = false;
}
//if ( "undefined" != typeof(Props.KeepNext) && null != Props.KeepNext )
// this.WordControl.m_oLogicDocument.Set_ParagraphKeepNext( Props.KeepNext );
if ( undefined != Props.SmallCaps )
{
TextPr.SmallCaps = Props.SmallCaps;
TextPr.AllCaps = false;
}
if ( "undefined" != typeof(Props.PageBreakBefore) && null != Props.PageBreakBefore )
this.WordControl.m_oLogicDocument.Set_ParagraphPageBreakBefore( Props.PageBreakBefore );
if ( undefined != Props.AllCaps )
{
TextPr.Caps = Props.AllCaps;
if ( true === TextPr.AllCaps )
TextPr.SmallCaps = false;
}
if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing )
this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( Props.Spacing );
if ( undefined != Props.TextSpacing )
TextPr.Spacing = Props.TextSpacing;
if ( "undefined" != typeof(Props.Shd) && null != Props.Shd )
this.WordControl.m_oLogicDocument.Set_ParagraphShd( Props.Shd );
if ( undefined != Props.Position )
TextPr.Position = Props.Position;
if ( "undefined" != typeof(Props.Brd) && null != Props.Brd )
this.WordControl.m_oLogicDocument.Set_ParagraphBorders( Props.Brd );
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr(TextPr) );
this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
}
}
asc_docs_api.prototype.put_PrAlign = function(value)
......@@ -1793,7 +1861,8 @@ asc_docs_api.prototype.ShapeApply = function(prop)
var oProp = prop;
this.asyncImageEndLoaded2 = function(_image)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
if(!(this.noCreatePoint === true))
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.ShapeApply(oProp);
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
......@@ -1810,6 +1879,8 @@ asc_docs_api.prototype.ShapeApply = function(prop)
}
}
asc_docs_api.prototype.setStartPointHistory = function(){this.noCreatePoint = true; History.Create_NewPoint();};
asc_docs_api.prototype.setEndPointHistory = function(){this.noCreatePoint = false;};
asc_docs_api.prototype.SetSlideProps = function(prop)
{
if (null == prop)
......
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