Commit f18d64a1 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Переделан сбор статистики, набора всех используем шрифтов и текущих шрифтов в...

Переделан сбор статистики, набора всех используем шрифтов и текущих шрифтов в новом варианте параграфа.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54873 954022d7-b5bf-4e40-9824-e11837661b57
parent fecc1d16
......@@ -956,6 +956,18 @@ ParaComment.prototype =
Get_PrevRunElements : function(RunElements, UseContentPos, Depth)
{
},
Collect_DocumentStatistics : function(ParaStats)
{
},
Create_FontMap : function(Map)
{
},
Get_AllFontNames : function(AllFonts)
{
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......
......@@ -643,6 +643,27 @@ ParaHyperlink.prototype =
CurPos--;
}
},
Collect_DocumentStatistics : function(ParaStats)
{
var Count = this.Content.length;
for (var Index = 0; Index < Count; Index++)
this.Content[Index].Collect_DocumentStatistics( ParaStats );
},
Create_FontMap : function(Map)
{
var Count = this.Content.length;
for (var Index = 0; Index < Count; Index++)
this.Content[Index].Create_FontMap( Map );
},
Get_AllFontNames : function(AllFonts)
{
var Count = this.Content.length;
for (var Index = 0; Index < Count; Index++)
this.Content[Index].Get_AllFontNames( AllFonts );
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......
......@@ -16597,49 +16597,73 @@ Paragraph.prototype =
DocumentStatistics : function(Stats)
{
var bEmptyParagraph = true;
var bWord = false;
for ( var Index = 0; Index < this.Content.length; Index++ )
if ( true !== Debug_ParaRunMode )
{
var Item = this.Content[Index];
var bEmptyParagraph = true;
var bWord = false;
for ( var Index = 0; Index < this.Content.length; Index++ )
{
var Item = this.Content[Index];
var bSymbol = false;
var bSpace = false;
var bNewWord = false;
var bSymbol = false;
var bSpace = false;
var bNewWord = false;
if ( (para_Text === Item.Type && false === Item.Is_NBSP()) || (para_PageNum === Item.Type) )
{
if ( false === bWord )
bNewWord = true;
if ( (para_Text === Item.Type && false === Item.Is_NBSP()) || (para_PageNum === Item.Type) )
{
if ( false === bWord )
bNewWord = true;
bWord = true;
bSymbol = true;
bSpace = false;
bEmptyParagraph = false;
bWord = true;
bSymbol = true;
bSpace = false;
bEmptyParagraph = false;
}
else if ( ( para_Text === Item.Type && true === Item.Is_NBSP() ) || para_Space === Item.Type || para_Tab === Item.Type )
{
bWord = false;
bSymbol = true;
bSpace = true;
}
if ( true === bSymbol )
Stats.Add_Symbol( bSpace );
if ( true === bNewWord )
Stats.Add_Word();
}
else if ( ( para_Text === Item.Type && true === Item.Is_NBSP() ) || para_Space === Item.Type || para_Tab === Item.Type )
var NumPr = this.Numbering_Get();
if ( undefined != NumPr )
{
bWord = false;
bSymbol = true;
bSpace = true;
bEmptyParagraph = false;
this.Parent.Get_Numbering().Get_AbstractNum( NumPr.NumId).DocumentStatistics( NumPr.Lvl, Stats );
}
if ( true === bSymbol )
Stats.Add_Symbol( bSpace );
if ( true === bNewWord )
Stats.Add_Word();
if ( false === bEmptyParagraph )
Stats.Add_Paragraph();
}
var NumPr = this.Numbering_Get();
if ( undefined != NumPr )
else
{
bEmptyParagraph = false;
this.Parent.Get_Numbering().Get_AbstractNum( NumPr.NumId).DocumentStatistics( NumPr.Lvl, Stats );
}
var ParaStats = new CParagraphStatistics(Stats);
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Item = this.Content[Index];
Item.Collect_DocumentStatistics( ParaStats );
}
if ( false === bEmptyParagraph )
Stats.Add_Paragraph();
var NumPr = this.Numbering_Get();
if ( undefined != NumPr )
{
bEmptyParagraph = false;
this.Parent.Get_Numbering().Get_AbstractNum( NumPr.NumId).DocumentStatistics( NumPr.Lvl, Stats );
}
if ( false === ParaStats.EmptyParagraph )
Stats.Add_Paragraph();
}
},
TurnOff_RecalcEvent : function()
......@@ -16739,30 +16763,43 @@ Paragraph.prototype =
CurTextPr.Merge( this.TextPr.Value );
CurTextPr.Document_CreateFontMap( this.FontMap.Map );
for ( var Index = 0; Index < this.Content.length; Index++ )
if ( true !== Debug_ParaRunMode )
{
var Item = this.Content[Index];
if ( para_TextPr === Item.Type )
for ( var Index = 0; Index < this.Content.length; Index++ )
{
// Выствляем начальные настройки текста у данного параграфа
CurTextPr = this.CompiledPr.Pr.TextPr.Copy();
var _CurTextPr = Item.Value;
var Item = this.Content[Index];
// Копируем настройки из символьного стиля
if ( undefined != _CurTextPr.RStyle )
if ( para_TextPr === Item.Type )
{
var Styles = this.Parent.Get_Styles();
var StyleTextPr = Styles.Get_Pr( _CurTextPr.RStyle, styletype_Character).TextPr;
CurTextPr.Merge( StyleTextPr );
}
// Выствляем начальные настройки текста у данного параграфа
CurTextPr = this.CompiledPr.Pr.TextPr.Copy();
var _CurTextPr = Item.Value;
// Копируем прямые настройки
CurTextPr.Merge( _CurTextPr );
CurTextPr.Document_CreateFontMap( this.FontMap.Map );
// Копируем настройки из символьного стиля
if ( undefined != _CurTextPr.RStyle )
{
var Styles = this.Parent.Get_Styles();
var StyleTextPr = Styles.Get_Pr( _CurTextPr.RStyle, styletype_Character).TextPr;
CurTextPr.Merge( StyleTextPr );
}
// Копируем прямые настройки
CurTextPr.Merge( _CurTextPr );
CurTextPr.Document_CreateFontMap( this.FontMap.Map );
}
}
}
else
{
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.Content[Index].Create_FontMap( this.FontMap.Map );
}
}
this.FontMap.NeedRecalc = false;
}
......@@ -16844,17 +16881,28 @@ Paragraph.prototype =
// Смотрим на знак конца параграфа
this.TextPr.Value.Document_Get_AllFontNames( AllFonts );
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
if ( true !== Debug_ParaRunMode )
{
var Item = this.Content[Index];
if ( para_TextPr === Item.Type )
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
Item.Value.Document_Get_AllFontNames( AllFonts );
var Item = this.Content[Index];
if ( para_TextPr === Item.Type )
{
Item.Value.Document_Get_AllFontNames( AllFonts );
}
else if ( para_Drawing === Item.Type )
{
Item.documentGetAllFontNames( AllFonts );
}
}
else if ( para_Drawing === Item.Type )
}
else
{
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
Item.documentGetAllFontNames( AllFonts );
this.Content[Index].Get_AllFontNames( AllFonts );
}
}
},
......@@ -17080,7 +17128,7 @@ Paragraph.prototype =
for ( var Index = 0; Index < this.Content.length; Index++ )
{
var Item = this.Content[Index];
if ( para_CommentEnd === Item.Type || para_CommentStart === Item.Type )
if ( para_CommentEnd === Item.Type || para_CommentStart === Item.Type || para_Comment === Item.Type )
{
editor.WordControl.m_oLogicDocument.Remove_Comment( Item.Id, true );
}
......@@ -21930,4 +21978,15 @@ function CParagraphRunElements(ContentPos, Count)
this.ContentPos = ContentPos;
this.Elements = new Array();
this.Count = Count;
}
function CParagraphStatistics(Stats)
{
this.Stats = Stats;
this.EmptyParagraph = true;
this.Word = false;
this.Symbol = false;
this.Space = false;
this.NewWord = false;
}
\ No newline at end of file
......@@ -968,6 +968,64 @@ ParaRun.prototype =
}
}
},
Collect_DocumentStatistics : function(ParaStats)
{
var Count = this.Content.length;
for ( var Index = 0; Index < Count; Index++ )
{
var Item = this.Content[Index];
var bSymbol = false;
var bSpace = false;
var bNewWord = false;
if ( (para_Text === Item.Type && false === Item.Is_NBSP()) || (para_PageNum === Item.Type) )
{
if ( false === ParaStats.Word )
bNewWord = true;
bSymbol = true;
bSpace = false;
ParaStats.Word = true;
ParaStats.EmptyParagraph = false;
}
else if ( ( para_Text === Item.Type && true === Item.Is_NBSP() ) || para_Space === Item.Type || para_Tab === Item.Type )
{
bSymbol = true;
bSpace = true;
ParaStats.Word = false;
}
if ( true === bSymbol )
ParaStats.Stats.Add_Symbol( bSpace );
if ( true === bNewWord )
ParaStats.Stats.Add_Word();
}
},
Create_FontMap : function(Map)
{
var TextPr = this.Get_CompiledPr(false);
TextPr.Document_CreateFontMap( Map );
},
Get_AllFontNames : function(AllFonts)
{
this.Pr.Document_Get_AllFontNames( AllFonts );
var Count = this.Content.length;
for (var Index = 0; Index < Count; Index++)
{
var Item = this.Content[Index];
if ( para_Drawing === Item.Type )
Item.documentGetAllFontNames( AllFonts );
}
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......@@ -4132,7 +4190,7 @@ ParaRun.prototype =
Set_Lang_Bidi : function(Value)
{
if ( Value !== this.Pr.Land.Bidi )
if ( Value !== this.Pr.Lang.Bidi )
{
var OldValue = this.Pr.Lang.Bidi;
this.Pr.Lang.Bidi = Value;
......
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