Commit 55217784 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Убрал добавление в историю до создания точки при Paragraph_Add. Поправлено...

Убрал добавление в историю до создания точки при Paragraph_Add. Поправлено падение при открытии презентаций у которых Layout без фона.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62142 954022d7-b5bf-4e40-9824-e11837661b57
parent 7901fbd4
......@@ -1265,47 +1265,79 @@ DrawingObjectsController.prototype =
},
setCellFontName: function (fontName) {
var text_pr = new ParaTextPr({ FontFamily : { Name : fontName , Index : -1 } });
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellFontName);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ FontFamily : { Name : fontName , Index : -1 } }));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellFontName);
},
setCellFontSize: function (fontSize) {
var text_pr = new ParaTextPr({ FontSize : fontSize});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellFontSize);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ FontSize : fontSize}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellFontSize);
},
setCellBold: function (isBold) {
var text_pr = new ParaTextPr({ Bold : isBold});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellBold);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Bold : isBold}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellBold);
},
setCellItalic: function (isItalic) {
var text_pr = new ParaTextPr({ Italic : isItalic});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellItalic);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Italic : isItalic}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellItalic);
},
setCellUnderline: function (isUnderline) {
var text_pr = new ParaTextPr({ Underline : isUnderline});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellUnderline);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Underline : isUnderline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellUnderline);
},
setCellStrikeout: function (isStrikeout) {
var text_pr = new ParaTextPr({ Strikeout : isStrikeout});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellStrikeout);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Strikeout : isStrikeout}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellStrikeout);
},
setCellSubscript: function (isSubscript) {
var text_pr = new ParaTextPr({ VertAlign : isSubscript ? vertalign_SubScript : vertalign_Baseline});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellSubscript);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ VertAlign : isSubscript ? vertalign_SubScript : vertalign_Baseline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellSubscript);
},
setCellSuperscript: function (isSuperscript) {
var text_pr = new ParaTextPr({ VertAlign : isSuperscript ? vertalign_SubScript : vertalign_Baseline});
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellSuperscript);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ VertAlign : isSuperscript ? vertalign_SubScript : vertalign_Baseline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellSuperscript);
},
setCellAlign: function (align) {
......@@ -1379,10 +1411,15 @@ DrawingObjectsController.prototype =
},
setCellTextColor: function (color) {
var oThis = this;
var callBack = function()
{
var unifill = new CUniFill();
unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor(color, null));
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTextPr({Unifill: unifill})], false, historydescription_Spreadsheet_SetCellTextColor);
oThis.paragraphAdd(new ParaTextPr({Unifill: unifill}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellTextColor);
},
setCellBackgroundColor: function (color)
......@@ -4061,7 +4098,13 @@ DrawingObjectsController.prototype =
{
if(this.getTargetDocContent())
{
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTab()], false, historydescription_Spreadsheet_AddTab)
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaTab());
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddTab)
}
else
{
......@@ -4166,7 +4209,13 @@ DrawingObjectsController.prototype =
//if(this.selection.textSelection || this.selection.groupSelection && this.selection.groupSelection.selection.textSelection
// || this.selection.chartSelection && this.selection.chartSelection.selection.textSelection)
//{
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaSpace(1)], false, historydescription_Spreadsheet_AddSpace);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaSpace(1));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddSpace);
this.recalculate();
//}
// else
......@@ -4398,6 +4447,10 @@ DrawingObjectsController.prototype =
else if ( e.keyCode == 189 && false === isViewMode ) // Клавиша Num-
{
var Item = null;
var oThis = this;
var callBack = function()
{
var Item = null;
if ( true === ctrlKey && true === e.shiftKey )
{
......@@ -4408,8 +4461,9 @@ DrawingObjectsController.prototype =
Item = new ParaText( "_" );
else
Item = new ParaText( "-" );
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [Item], false, historydescription_Spreadsheet_AddItem);
oThis.paragraphAdd(Item);
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddItem);
this.recalculate();
bRetValue = true;
}
......
......@@ -844,6 +844,7 @@ function CLayoutThumbnailDrawer()
{
_back_fill = new CUniFill();
_back_fill.fill = new CSolidFill();
_back_fill.fill.color = new CUniColor();
_back_fill.fill.color.color = new CRGBColor();
_back_fill.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
}
......
This diff is collapsed.
......@@ -765,6 +765,7 @@ function CMasterThumbnailDrawer()
{
_back_fill = new CUniFill();
_back_fill.fill = new CSolidFill();
_back_fill.fill.color = new CUniColor();
_back_fill.fill.color.color = new CRGBColor();
_back_fill.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
}
......
......@@ -1791,43 +1791,58 @@ asc_docs_api.prototype.put_TextPrFontName = function(name)
var isasync = loader.LoadFont(fontinfo);
if (false === isasync)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrFontName);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontFamily : { Name : fontinfo.Name , Index : -1 } } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({
FontFamily: {
Name: fontinfo.Name,
Index: -1
}
}));
}
}
};
asc_docs_api.prototype.put_TextPrFontSize = function(size)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrFontSize);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontSize : Math.min(size, 100) } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({FontSize: Math.min(size, 100)}));
}
};
asc_docs_api.prototype.put_TextPrBold = function(value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrBold);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Bold : value } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Bold: value}));
}
};
asc_docs_api.prototype.put_TextPrItalic = function(value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrItalic);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Italic : value } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Italic: value}));
}
};
asc_docs_api.prototype.put_TextPrUnderline = function(value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrUnderline);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Underline : value } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Underline: value}));
}
};
asc_docs_api.prototype.put_TextPrStrikeout = function(value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrStrikeout);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Strikeout : value } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Strikeout: value}));
}
};
asc_docs_api.prototype.put_PrLineSpacing = function(Type, Value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrLineSpacing);
this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( { LineRule : Type, Line : Value } );
};
asc_docs_api.prototype.put_LineSpacingBeforeAfter = function(type,value)//"type == 0" means "Before", "type == 1" means "After"
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrSpacingBeforeAfter);
switch (type)
{
case 0:
......@@ -1838,12 +1853,10 @@ asc_docs_api.prototype.put_LineSpacingBeforeAfter = function(type,value)//"type
};
asc_docs_api.prototype.FontSizeIn = function()
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrIncreaseFontSize);
this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(true);
};
asc_docs_api.prototype.FontSizeOut = function()
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrDecreaseFontSize);
this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(false);
};
......@@ -2002,8 +2015,10 @@ asc_docs_api.prototype.put_PrAlign = function(value)
// 0- baseline, 2-subscript, 1-superscript
asc_docs_api.prototype.put_TextPrBaseline = function(value)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrBaseline);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { VertAlign : value } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({VertAlign: value}));
}
};
/* Маркированный список Type = 0
нет - SubType = -1
......@@ -2322,16 +2337,20 @@ asc_docs_api.prototype.put_LineEndSize = function(_size)
asc_docs_api.prototype.put_TextColor2 = function(r, g, b)
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextColor2);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Color : { r : r, g : g, b: b} } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Color: {r: r, g: g, b: b}}));
}
};
asc_docs_api.prototype.put_TextColor = function(color)
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
var _unifill = new CUniFill();
_unifill.fill = new CSolidFill();
_unifill.fill.color = CorrectUniColor(color, _unifill.fill.color, 0);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextColor);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Unifill : _unifill } ) );
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Unifill: _unifill}));
}
};
asc_docs_api.prototype.put_PrIndent = function(value,levelValue)
......@@ -2458,8 +2477,10 @@ asc_docs_api.prototype.get_DocumentOrientation = function()
asc_docs_api.prototype.put_AddPageBreak = function()
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_AddPageBreak);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaNewLine( break_Page ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaNewLine(break_Page));
}
};
asc_docs_api.prototype.Update_ParaInd = function( Ind ){
var FirstLine = 0;
......@@ -3920,8 +3941,10 @@ asc_docs_api.prototype.asyncFontStartLoaded = function()
asc_docs_api.prototype.asyncFontEndLoaded = function(fontinfo)
{
this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadFont);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_EndFontLoad);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontFamily : { Name : fontinfo.Name , Index : -1 } } ) );
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({FontFamily: {Name: fontinfo.Name, Index: -1}}));
}
// отжать заморозку меню
};
......
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