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

Сделано, чтобы при выделении нумерации в контекстном меню не появлялись пункты...

Сделано, чтобы при выделении нумерации в контекстном меню не появлялись пункты относящиеся к орфографии, а также, чтобы дизейблились пункты копирования/вырезания. Сделано, чтобы все настройки параграфа применялись при выделении нумерации к текущему параграфу (тому в который попали курсором при выделении нумерации). Исправлен баг с неподстветкой нумерации после Undo/Redo. Сделано, чтобы в стандартных нумерациях (в нумерованных, но не в булетных) отсутствовал шрифт (раньше всегда был Times New Roman).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60140 954022d7-b5bf-4e40-9824-e11837661b57
parent cd4a0777
......@@ -5998,15 +5998,11 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
if (true === this.UseTextShd && StartPos === EndPos && type_Paragraph === this.Content[StartPos].GetType() && false === this.Content[StartPos].Selection_CheckParaEnd() )
if (true === this.UseTextShd && StartPos === EndPos && type_Paragraph === this.Content[StartPos].GetType() && false === this.Content[StartPos].Selection_CheckParaEnd() && selectionflag_Common === this.Selection.Flag)
{
this.Paragraph_Add( new ParaTextPr( { Shd : Shd } ) );
this.Recalculate();
......@@ -6057,14 +6053,6 @@ CDocument.prototype =
this.DrawingDocument.OnEndRecalculate(false, true);
}
break;
}
case selectionflag_Numbering:
{
break;
}
}
this.Document_UpdateSelectionState();
this.Document_UpdateInterfaceState();
......@@ -6134,11 +6122,8 @@ CDocument.prototype =
if ( true === this.Selection.Use )
{
if ( selectionflag_Numbering === this.Selection.Flag )
{
this.Document_UpdateInterfaceState();
return false;
}
if (selectionflag_Numbering === this.Selection.Flag)
this.Remove_NumberingSelection();
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6223,10 +6208,6 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6262,14 +6243,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6308,15 +6281,10 @@ CDocument.prototype =
}
else //if ( docpostype_Content === this.CurPos.Type )
{
if ( this.CurPos.ContentPos < 0 )
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6352,14 +6320,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6402,10 +6362,6 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6442,14 +6398,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6492,10 +6440,6 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6532,14 +6476,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6582,10 +6518,6 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6622,14 +6554,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6672,10 +6596,6 @@ CDocument.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6712,14 +6632,6 @@ CDocument.prototype =
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -6799,9 +6711,6 @@ CDocument.prototype =
{
if ( true === this.Selection.Use )
{
if ( selectionflag_Numbering === this.Selection.Flag )
return;
// Проверим, если у нас все выделенные элементы - параграфы, с одинаковыми настройками
// FramePr, тогда мы можем применить новую настройку FramePr
......@@ -12072,8 +11981,18 @@ CDocument.prototype =
bCanCopyCut = true;
}
if ( null !== LogicDocument )
bCanCopyCut = LogicDocument.Is_SelectionUse();
if (null !== LogicDocument)
{
if (true === LogicDocument.Is_SelectionUse())
{
if (selectionflag_Numbering === LogicDocument.Selection.Flag)
bCanCopyCut = false;
else if (LogicDocument.Selection.StartPos !== LogicDocument.Selection.EndPos || type_Paragraph === LogicDocument.Content[LogicDocument.Selection.StartPos].Get_Type())
bCanCopyCut = true;
else
bCanCopyCut = LogicDocument.Content[LogicDocument.Selection.StartPos].Can_CopyCut();
}
}
return bCanCopyCut;
},
......@@ -12270,9 +12189,18 @@ CDocument.prototype =
if ( true === this.Selection.Use )
{
// Выделение нумерации
if ( selectionflag_Numbering == this.Selection.Flag )
if (selectionflag_Numbering == this.Selection.Flag)
{
// Ничего не делаем
if (type_Paragraph === this.Content[this.Selection.StartPos].Get_Type())
{
var NumPr = this.Content[this.Selection.StartPos].Numbering_Get();
if (undefined !== NumPr)
this.Document_SelectNumbering(NumPr, this.Selection.StartPos);
else
this.Selection_Remove();
}
else
this.Selection_Remove();
}
else
{
......
......@@ -1751,6 +1751,43 @@ CDocumentContent.prototype =
}
},
Can_CopyCut : function()
{
var bCanCopyCut = false;
var LogicDocument = null;
var DrawingObjects = null;
// Работаем с колонтитулом
if (docpostype_DrawingObjects === this.CurPos.Type)
DrawingObjects = this.DrawingObjects;
else
LogicDocument = this;
if (null !== DrawingObjects)
{
if (true === DrawingObjects.isSelectedText())
LogicDocument = DrawingObjects.getTargetDocContent();
else
bCanCopyCut = true;
}
if (null !== LogicDocument)
{
if (true === LogicDocument.Is_SelectionUse())
{
if (selectionflag_Numbering === LogicDocument.Selection.Flag)
bCanCopyCut = false;
else if (LogicDocument.Selection.StartPos !== LogicDocument.Selection.EndPos || type_Paragraph === LogicDocument.Content[LogicDocument.Selection.StartPos].Get_Type())
bCanCopyCut = true;
else
bCanCopyCut = LogicDocument.Content[LogicDocument.Selection.StartPos].Can_CopyCut();
}
}
return bCanCopyCut;
},
Cursor_MoveToStartPos : function(AddToSelect)
{
if ( true === AddToSelect )
......@@ -5589,15 +5626,11 @@ CDocumentContent.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
if (undefined !== this.LogicDocument && true === this.LogicDocument.UseTextShd && StartPos === EndPos && type_Paragraph === this.Content[StartPos].GetType() && false === this.Content[StartPos].Selection_CheckParaEnd() )
if (undefined !== this.LogicDocument && true === this.LogicDocument.UseTextShd && StartPos === EndPos && type_Paragraph === this.Content[StartPos].GetType() && false === this.Content[StartPos].Selection_CheckParaEnd() && selectionflag_Common === this.Selection.Flag)
{
this.Paragraph_Add( new ParaTextPr( { Shd : Shd } ) );
this.Parent.OnContentRecalculate( false );
......@@ -5628,14 +5661,6 @@ CDocumentContent.prototype =
this.Parent.OnContentRecalculate( false );
}
break;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
......@@ -5689,12 +5714,6 @@ CDocumentContent.prototype =
if ( true === this.Selection.Use )
{
if ( selectionflag_Numbering === this.Selection.Flag )
{
this.Interface_Update_ParaPr();
return false;
}
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
if ( EndPos < StartPos )
......@@ -5704,6 +5723,9 @@ CDocumentContent.prototype =
EndPos = Temp;
}
if (selectionflag_Numbering === this.Selection.Flag)
this.Remove_NumberingSelection();
for ( var Index = StartPos; Index <= EndPos; Index++ )
{
var Item = this.Content[Index];
......@@ -5947,22 +5969,22 @@ CDocumentContent.prototype =
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
if ( EndPos < StartPos )
if (EndPos < StartPos)
{
var Temp = StartPos;
StartPos = EndPos;
EndPos = Temp;
}
for ( var Index = StartPos; Index <= EndPos; Index++ )
for (var Index = StartPos; Index <= EndPos; Index++)
{
var Item = this.Content[Index];
if ( type_Paragraph == Item.GetType() )
Item.Set_KeepLines( Value );
else if ( type_Table == Item.GetType() )
if (type_Paragraph == Item.GetType())
Item.Set_KeepLines(Value);
else if (type_Table == Item.GetType())
{
Item.TurnOff_RecalcEvent();
Item.Set_ParagraphKeepLines( Value );
Item.Set_ParagraphKeepLines(Value);
Item.TurnOn_RecalcEvent();
}
}
......@@ -6172,10 +6194,6 @@ CDocumentContent.prototype =
return false;
if ( true === this.Selection.Use )
{
switch ( this.Selection.Flag )
{
case selectionflag_Common:
{
var StartPos = this.Selection.StartPos;
var EndPos = this.Selection.EndPos;
......@@ -6204,14 +6222,6 @@ CDocumentContent.prototype =
this.Recalculate();
return;
}
case selectionflag_Numbering:
{
break;
}
}
return;
}
var Item = this.Content[this.CurPos.ContentPos];
if ( type_Paragraph == Item.GetType() )
......@@ -7783,7 +7793,7 @@ CDocumentContent.prototype =
// Если сейчас у нас заселекчена нумерация, тогда убираем селект
Remove_NumberingSelection : function()
{
if ( true === this.Selection.Use && selectionflag_Numbering == this.Selection.Flag )
if (true === this.Selection.Use && selectionflag_Numbering == this.Selection.Flag)
this.Selection_Remove();
},
//-----------------------------------------------------------------------------------
......@@ -8426,10 +8436,18 @@ CDocumentContent.prototype =
{
if ( true === this.Selection.Use )
{
// Выделение нумерации
if ( selectionflag_Numbering == this.Selection.Flag )
if (selectionflag_Numbering == this.Selection.Flag)
{
// Ничего не делаем
if (type_Paragraph === this.Content[this.Selection.StartPos].Get_Type())
{
var NumPr = this.Content[this.Selection.StartPos].Numbering_Get();
if (undefined !== NumPr)
this.Document_SelectNumbering(NumPr, this.Selection.StartPos);
else
this.LogicDocument.Selection_Remove();
}
else
this.LogicDocument.Selection_Remove();
}
else
{
......
......@@ -375,10 +375,7 @@ CAbstractNum.prototype =
Lvl.ParaPr.Ind.Left = Left;
Lvl.ParaPr.Ind.FirstLine = FirstLine;
var TextPr = new CTextPr();
TextPr.RFonts.Set_All( "Times New Roman", -1 );
Lvl.TextPr = TextPr;
Lvl.TextPr = new CTextPr();
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : Index, Old : Lvl_old, New : Lvl_new } );
......@@ -425,8 +422,6 @@ CAbstractNum.prototype =
Lvl.ParaPr.Ind.FirstLine = FirstLine;
var TextPr = new CTextPr();
TextPr.RFonts.Set_All( "Times New Roman", -1 );
Lvl.TextPr = TextPr;
var Lvl_new = this.Internal_CopyLvl( Lvl );
......@@ -505,8 +500,6 @@ CAbstractNum.prototype =
Lvl.ParaPr.Ind.FirstLine = FirstLine;
var TextPr = new CTextPr();
TextPr.RFonts.Set_All( "Times New Roman", -1 );
Lvl.TextPr = TextPr;
var Lvl_new = this.Internal_CopyLvl( Lvl );
......@@ -663,7 +656,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( ")" ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -684,7 +676,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -705,7 +696,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -726,7 +716,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( ")" ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -747,7 +736,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -768,7 +756,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -789,7 +776,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( ")" ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -810,7 +796,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -831,7 +816,6 @@ CAbstractNum.prototype =
Lvl.LvlText = [];
Lvl.LvlText.push( new CLvlText_Num( iLvl ) );
Lvl.LvlText.push( new CLvlText_Text( "." ) );
Lvl.TextPr.RFonts.Set_All( "Times New Roman", -1 );
var Lvl_new = this.Internal_CopyLvl( Lvl );
History.Add( this, { Type : historyitem_AbstractNum_LvlChange, Index : iLvl, Old : Lvl_old, New : Lvl_new } );
......@@ -1544,7 +1528,6 @@ CAbstractNum.prototype =
case changestype_Document_Content:
case changestype_Document_Content_Add:
case changestype_Image_Properties:
case changestype_Remove:
{
CollaborativeEditing.Add_CheckLock(true);
break;
......@@ -1843,7 +1826,6 @@ CNumbering.prototype =
AllFonts["Symbol"] = true;
AllFonts["Courier New"] = true;
AllFonts["Wingdings"] = true;
AllFonts["Times New Roman"] = true;
}
};
......
......@@ -8676,7 +8676,7 @@ Paragraph.prototype =
EndPos = CurPos;
}
if ( this.bFromDocument && this.LogicDocument && true === this.LogicDocument.Spelling.Use )
if (this.bFromDocument && this.LogicDocument && true === this.LogicDocument.Spelling.Use && selectionflag_Numbering !== this.Selection.Flag)
this.SpellChecker.Document_UpdateInterfaceState( StartPos, EndPos );
if ( true === this.Selection.Use )
......
......@@ -5195,6 +5195,14 @@ CTable.prototype =
this.Parent.Set_CurrentElement( this.Index, bUpdateStates );
},
Can_CopyCut : function()
{
if ( true === this.Selection.Use && table_Selection_Cell === this.Selection.Type )
return true;
else
return this.CurCell.Content.Can_CopyCut();
},
Set_Inline : function(Value)
{
History.Add( this, { Type : historyitem_Table_Inline, Old : this.Inline, New : 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