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) ...@@ -108,6 +108,8 @@ function Paragraph(DrawingDocument, Parent, PageNum, X, Y, XLimit, YLimit)
NeedRecalc : true NeedRecalc : true
}; };
this.SearchResults = new Object(); this.SearchResults = new Object();
this.SpellChecker = new CParaSpellChecker(); this.SpellChecker = new CParaSpellChecker();
...@@ -9249,9 +9251,13 @@ Paragraph.prototype = ...@@ -9249,9 +9251,13 @@ Paragraph.prototype =
// Считываем свойства для текущего стиля // Считываем свойства для текущего стиля
var Pr = Styles.Get_Pr( StyleId, styles_Paragraph, TableStyle ); var Pr = Styles.Get_Pr( StyleId, styles_Paragraph, TableStyle );
// Копируем прямые настройки параграфа.
// Копируем прямые настройки параграфа. // Копируем прямые настройки параграфа.
Pr.ParaPr.Merge( this.Pr ); Pr.ParaPr.Merge( this.Pr );
Pr.TextPr.Merge( this.rPr ); Pr.TextPr.Merge( this.rPr );
Pr.ParaPr.StyleTabs = ( undefined != Pr.ParaPr.Tabs ? Pr.ParaPr.Tabs.Copy() : new CParaTabs() );
return Pr; return Pr;
}, },
......
...@@ -575,7 +575,7 @@ CPresentation.prototype = ...@@ -575,7 +575,7 @@ CPresentation.prototype =
{ {
} }
this.RecalculateCurPos();
this.DrawingDocument.OnRecalculatePage( this.CurPage, this.Slides[this.CurPage] ); this.DrawingDocument.OnRecalculatePage( this.CurPage, this.Slides[this.CurPage] );
this.DrawingDocument.OnEndRecalculate(); this.DrawingDocument.OnEndRecalculate();
}, },
......
...@@ -536,8 +536,8 @@ CShape.prototype = ...@@ -536,8 +536,8 @@ CShape.prototype =
if(this.recalcInfo.recalculateTransparent) if(this.recalcInfo.recalculateTransparent)
{ {
this.compiledTransparent = null; this.compiledTransparent = null;
if(isRealObject(this.spPr) && isRealObject(this.spPr.Fill) && isRealNumber(this.spPr.transparent)) if(isRealObject(this.spPr) && isRealObject(this.spPr.Fill) && isRealNumber(this.spPr.Fill.transparent))
this.compiledTransparent = this.spPr.transparent; this.compiledTransparent = this.spPr.Fill.transparent;
else if(isRealObject(this.group)) else if(isRealObject(this.group))
{ {
var group_transparent = this.group.getCompiledTransparent(); var group_transparent = this.group.getCompiledTransparent();
...@@ -550,9 +550,9 @@ CShape.prototype = ...@@ -550,9 +550,9 @@ CShape.prototype =
var hierarchy = this.getHierarchy(); var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i) 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; break;
} }
...@@ -564,9 +564,9 @@ CShape.prototype = ...@@ -564,9 +564,9 @@ CShape.prototype =
var hierarchy = this.getHierarchy(); var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i) 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; break;
} }
...@@ -2105,6 +2105,18 @@ CShape.prototype = ...@@ -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) applyAllSpacing: function(val)
{ {
if(isRealObject(this.txBody)) if(isRealObject(this.txBody))
...@@ -2683,6 +2695,7 @@ CShape.prototype = ...@@ -2683,6 +2695,7 @@ CShape.prototype =
this.recalcInfo.recalculateFill = true; this.recalcInfo.recalculateFill = true;
this.recalcInfo.recalculateBrush = true; this.recalcInfo.recalculateBrush = true;
this.recalcInfo.recalculateTransparent = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
......
...@@ -331,6 +331,40 @@ CGraphicObjects.prototype = { ...@@ -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) setParagraphSpacing: function(val)
{ {
switch (this.State.id) switch (this.State.id)
......
...@@ -5774,9 +5774,59 @@ function CParaTabs() ...@@ -5774,9 +5774,59 @@ function CParaTabs()
CParaTabs.prototype = 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() Copy : function()
...@@ -5810,6 +5860,19 @@ CParaTabs.prototype = ...@@ -5810,6 +5860,19 @@ CParaTabs.prototype =
return this.Tabs[Index]; 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) Write_ToBinary : function(Writer)
{ {
// Long : количество (если 0, удаляем элемент) // Long : количество (если 0, удаляем элемент)
...@@ -5835,7 +5898,7 @@ CParaTabs.prototype = ...@@ -5835,7 +5898,7 @@ CParaTabs.prototype =
// Double : Pos // Double : Pos
var Count = Reader.GetLong(); var Count = Reader.GetLong();
this.Tabs = new Array( Count ); this.Tabs = new Array();
for ( var Index = 0; Index < Count; Index++ ) for ( var Index = 0; Index < Count; Index++ )
{ {
...@@ -5846,6 +5909,7 @@ CParaTabs.prototype = ...@@ -5846,6 +5909,7 @@ CParaTabs.prototype =
} }
} }
function CParaInd() function CParaInd()
{ {
this.Left = undefined; // Левый отступ this.Left = undefined; // Левый отступ
......
...@@ -73,6 +73,7 @@ function asc_docs_api(name) ...@@ -73,6 +73,7 @@ function asc_docs_api(name)
// ASC_DOCS_API_USE_EMBEDDED_FONTS, кроме "true"(написание от регистра не зависит). // ASC_DOCS_API_USE_EMBEDDED_FONTS, кроме "true"(написание от регистра не зависит).
this.isUseEmbeddedCutFonts = ("true" == ASC_DOCS_API_USE_EMBEDDED_FONTS.toLowerCase()); this.isUseEmbeddedCutFonts = ("true" == ASC_DOCS_API_USE_EMBEDDED_FONTS.toLowerCase());
this.noCreatePoint = false;
this.pasteCallback = null; this.pasteCallback = null;
this.pasteImageMap = null; this.pasteImageMap = null;
this.EndActionLoadImages = 0; this.EndActionLoadImages = 0;
...@@ -1614,6 +1615,11 @@ asc_docs_api.prototype.onSaveCallback = function (e) { ...@@ -1614,6 +1615,11 @@ asc_docs_api.prototype.onSaveCallback = function (e) {
asc_docs_api.prototype.paraApply = function(Props) asc_docs_api.prototype.paraApply = function(Props)
{ {
var Additional = undefined;
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Text_Props, Additional) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
// TODO: Сделать так, чтобы пересчет был всего 1 здесь // TODO: Сделать так, чтобы пересчет был всего 1 здесь
...@@ -1629,8 +1635,11 @@ asc_docs_api.prototype.paraApply = function(Props) ...@@ -1629,8 +1635,11 @@ asc_docs_api.prototype.paraApply = function(Props)
if ( "undefined" != typeof(Props.KeepLines) && null != Props.KeepLines ) if ( "undefined" != typeof(Props.KeepLines) && null != Props.KeepLines )
this.WordControl.m_oLogicDocument.Set_ParagraphKeepLines( Props.KeepLines ); this.WordControl.m_oLogicDocument.Set_ParagraphKeepLines( Props.KeepLines );
//if ( "undefined" != typeof(Props.KeepNext) && null != Props.KeepNext ) if ( undefined != Props.KeepNext && null != Props.KeepNext )
// this.WordControl.m_oLogicDocument.Set_ParagraphKeepNext( 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 ) if ( "undefined" != typeof(Props.PageBreakBefore) && null != Props.PageBreakBefore )
this.WordControl.m_oLogicDocument.Set_ParagraphPageBreakBefore( Props.PageBreakBefore ); this.WordControl.m_oLogicDocument.Set_ParagraphPageBreakBefore( Props.PageBreakBefore );
...@@ -1643,6 +1652,65 @@ asc_docs_api.prototype.paraApply = function(Props) ...@@ -1643,6 +1652,65 @@ asc_docs_api.prototype.paraApply = function(Props)
if ( "undefined" != typeof(Props.Brd) && null != Props.Brd ) if ( "undefined" != typeof(Props.Brd) && null != Props.Brd )
this.WordControl.m_oLogicDocument.Set_ParagraphBorders( 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: как только разъединят настройки параграфа и текста переделать тут
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;
if ( undefined != Props.Strikeout )
{
TextPr.Strikeout = Props.Strikeout;
TextPr.DStrikeout = false;
}
if ( undefined != Props.DStrikeout )
{
TextPr.DStrikeout = Props.DStrikeout;
if ( true === TextPr.DStrikeout )
TextPr.Strikeout = false;
}
if ( undefined != Props.SmallCaps )
{
TextPr.SmallCaps = Props.SmallCaps;
TextPr.AllCaps = false;
}
if ( undefined != Props.AllCaps )
{
TextPr.Caps = Props.AllCaps;
if ( true === TextPr.AllCaps )
TextPr.SmallCaps = false;
}
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)
...@@ -1793,6 +1861,7 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -1793,6 +1861,7 @@ asc_docs_api.prototype.ShapeApply = function(prop)
var oProp = prop; var oProp = prop;
this.asyncImageEndLoaded2 = function(_image) this.asyncImageEndLoaded2 = function(_image)
{ {
if(!(this.noCreatePoint === true))
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.ShapeApply(oProp); this.WordControl.m_oLogicDocument.ShapeApply(oProp);
...@@ -1810,6 +1879,8 @@ asc_docs_api.prototype.ShapeApply = function(prop) ...@@ -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) asc_docs_api.prototype.SetSlideProps = function(prop)
{ {
if (null == 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