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 = ...@@ -1265,47 +1265,79 @@ DrawingObjectsController.prototype =
}, },
setCellFontName: function (fontName) { 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) { 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) { setCellBold: function (isBold) {
var text_pr = new ParaTextPr({ Bold : isBold}); var oThis = this;
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellBold); var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Bold : isBold}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellBold);
}, },
setCellItalic: function (isItalic) { setCellItalic: function (isItalic) {
var oThis = this;
var text_pr = new ParaTextPr({ Italic : isItalic}); var callBack = function()
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellItalic); {
oThis.paragraphAdd(new ParaTextPr({ Italic : isItalic}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellItalic);
}, },
setCellUnderline: function (isUnderline) { setCellUnderline: function (isUnderline) {
var text_pr = new ParaTextPr({ Underline : isUnderline}); var oThis = this;
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellUnderline); var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Underline : isUnderline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellUnderline);
}, },
setCellStrikeout: function (isStrikeout) { setCellStrikeout: function (isStrikeout) {
var text_pr = new ParaTextPr({ Strikeout : isStrikeout}); var oThis = this;
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellStrikeout); var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ Strikeout : isStrikeout}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellStrikeout);
}, },
setCellSubscript: function (isSubscript) { setCellSubscript: function (isSubscript) {
var text_pr = new ParaTextPr({ VertAlign : isSubscript ? vertalign_SubScript : vertalign_Baseline}); var oThis = this;
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellSubscript); var callBack = function()
{
oThis.paragraphAdd(new ParaTextPr({ VertAlign : isSubscript ? vertalign_SubScript : vertalign_Baseline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellSubscript);
}, },
setCellSuperscript: function (isSuperscript) { setCellSuperscript: function (isSuperscript) {
var oThis = this;
var text_pr = new ParaTextPr({ VertAlign : isSuperscript ? vertalign_SubScript : vertalign_Baseline}); var callBack = function()
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [text_pr], false, historydescription_Spreadsheet_SetCellSuperscript); {
oThis.paragraphAdd(new ParaTextPr({ VertAlign : isSuperscript ? vertalign_SubScript : vertalign_Baseline}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellSuperscript);
}, },
setCellAlign: function (align) { setCellAlign: function (align) {
...@@ -1379,10 +1411,15 @@ DrawingObjectsController.prototype = ...@@ -1379,10 +1411,15 @@ DrawingObjectsController.prototype =
}, },
setCellTextColor: function (color) { setCellTextColor: function (color) {
var unifill = new CUniFill(); var oThis = this;
unifill.setFill(new CSolidFill()); var callBack = function()
unifill.fill.setColor(CorrectUniColor(color, null)); {
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaTextPr({Unifill: unifill})], false, historydescription_Spreadsheet_SetCellTextColor); var unifill = new CUniFill();
unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor(color, null));
oThis.paragraphAdd(new ParaTextPr({Unifill: unifill}));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_SetCellTextColor);
}, },
setCellBackgroundColor: function (color) setCellBackgroundColor: function (color)
...@@ -4061,7 +4098,13 @@ DrawingObjectsController.prototype = ...@@ -4061,7 +4098,13 @@ DrawingObjectsController.prototype =
{ {
if(this.getTargetDocContent()) 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 else
{ {
...@@ -4166,8 +4209,14 @@ DrawingObjectsController.prototype = ...@@ -4166,8 +4209,14 @@ DrawingObjectsController.prototype =
//if(this.selection.textSelection || this.selection.groupSelection && this.selection.groupSelection.selection.textSelection //if(this.selection.textSelection || this.selection.groupSelection && this.selection.groupSelection.selection.textSelection
// || this.selection.chartSelection && this.selection.chartSelection.selection.textSelection) // || this.selection.chartSelection && this.selection.chartSelection.selection.textSelection)
//{ //{
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [new ParaSpace(1)], false, historydescription_Spreadsheet_AddSpace);
this.recalculate(); var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaSpace(1));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddSpace);
this.recalculate();
//} //}
// else // else
// { // {
...@@ -4399,17 +4448,22 @@ DrawingObjectsController.prototype = ...@@ -4399,17 +4448,22 @@ DrawingObjectsController.prototype =
{ {
var Item = null; var Item = null;
if ( true === ctrlKey && true === e.shiftKey ) var oThis = this;
var callBack = function()
{ {
Item = new ParaText( String.fromCharCode( 0x2013 ) ); var Item = null;
Item.SpaceAfter = false; if ( true === ctrlKey && true === e.shiftKey )
} {
else if ( true === e.shiftKey ) Item = new ParaText( String.fromCharCode( 0x2013 ) );
Item = new ParaText( "_" ); Item.SpaceAfter = false;
else }
Item = new ParaText( "-" ); else if ( true === e.shiftKey )
Item = new ParaText( "_" );
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [Item], false, historydescription_Spreadsheet_AddItem); else
Item = new ParaText( "-" );
oThis.paragraphAdd(Item);
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddItem);
this.recalculate(); this.recalculate();
bRetValue = true; bRetValue = true;
} }
......
...@@ -844,6 +844,7 @@ function CLayoutThumbnailDrawer() ...@@ -844,6 +844,7 @@ function CLayoutThumbnailDrawer()
{ {
_back_fill = new CUniFill(); _back_fill = new CUniFill();
_back_fill.fill = new CSolidFill(); _back_fill.fill = new CSolidFill();
_back_fill.fill.color = new CUniColor();
_back_fill.fill.color.color = new CRGBColor(); _back_fill.fill.color.color = new CRGBColor();
_back_fill.fill.color.color.RGBA = {R:255, G:255, B:255, A:255}; _back_fill.fill.color.color.RGBA = {R:255, G:255, B:255, A:255};
} }
......
This diff is collapsed.
...@@ -765,6 +765,7 @@ function CMasterThumbnailDrawer() ...@@ -765,6 +765,7 @@ function CMasterThumbnailDrawer()
{ {
_back_fill = new CUniFill(); _back_fill = new CUniFill();
_back_fill.fill = new CSolidFill(); _back_fill.fill = new CSolidFill();
_back_fill.fill.color = new CUniColor();
_back_fill.fill.color.color = new CRGBColor(); _back_fill.fill.color.color = new CRGBColor();
_back_fill.fill.color.color.RGBA = {R:255, G:255, B:255, A:255}; _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) ...@@ -1791,43 +1791,58 @@ asc_docs_api.prototype.put_TextPrFontName = function(name)
var isasync = loader.LoadFont(fontinfo); var isasync = loader.LoadFont(fontinfo);
if (false === isasync) if (false === isasync)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrFontName); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontFamily : { Name : fontinfo.Name , Index : -1 } } ) ); 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) asc_docs_api.prototype.put_TextPrFontSize = function(size)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrFontSize); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontSize : Math.min(size, 100) } ) ); 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) asc_docs_api.prototype.put_TextPrBold = function(value)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrBold); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Bold : value } ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Bold: value}));
}
}; };
asc_docs_api.prototype.put_TextPrItalic = function(value) asc_docs_api.prototype.put_TextPrItalic = function(value)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrItalic); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Italic : value } ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Italic: value}));
}
}; };
asc_docs_api.prototype.put_TextPrUnderline = function(value) asc_docs_api.prototype.put_TextPrUnderline = function(value)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrUnderline); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Underline : value } ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Underline: value}));
}
}; };
asc_docs_api.prototype.put_TextPrStrikeout = function(value) asc_docs_api.prototype.put_TextPrStrikeout = function(value)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrStrikeout); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Strikeout : value } ) ); 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) 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 } ); 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" 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) switch (type)
{ {
case 0: case 0:
...@@ -1838,12 +1853,10 @@ asc_docs_api.prototype.put_LineSpacingBeforeAfter = function(type,value)//"type ...@@ -1838,12 +1853,10 @@ asc_docs_api.prototype.put_LineSpacingBeforeAfter = function(type,value)//"type
}; };
asc_docs_api.prototype.FontSizeIn = function() asc_docs_api.prototype.FontSizeIn = function()
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrIncreaseFontSize);
this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(true); this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(true);
}; };
asc_docs_api.prototype.FontSizeOut = function() asc_docs_api.prototype.FontSizeOut = function()
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrDecreaseFontSize);
this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(false); this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(false);
}; };
...@@ -2002,8 +2015,10 @@ asc_docs_api.prototype.put_PrAlign = function(value) ...@@ -2002,8 +2015,10 @@ asc_docs_api.prototype.put_PrAlign = function(value)
// 0- baseline, 2-subscript, 1-superscript // 0- baseline, 2-subscript, 1-superscript
asc_docs_api.prototype.put_TextPrBaseline = function(value) asc_docs_api.prototype.put_TextPrBaseline = function(value)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextPrBaseline); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { VertAlign : value } ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({VertAlign: value}));
}
}; };
/* Маркированный список Type = 0 /* Маркированный список Type = 0
нет - SubType = -1 нет - SubType = -1
...@@ -2322,16 +2337,20 @@ asc_docs_api.prototype.put_LineEndSize = function(_size) ...@@ -2322,16 +2337,20 @@ asc_docs_api.prototype.put_LineEndSize = function(_size)
asc_docs_api.prototype.put_TextColor2 = function(r, g, b) asc_docs_api.prototype.put_TextColor2 = function(r, g, b)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextColor2); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Color : { r : r, g : g, b: b} } ) ); 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) asc_docs_api.prototype.put_TextColor = function(color)
{ {
var _unifill = new CUniFill(); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
_unifill.fill = new CSolidFill(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
_unifill.fill.color = CorrectUniColor(color, _unifill.fill.color, 0); var _unifill = new CUniFill();
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_PutTextColor); _unifill.fill = new CSolidFill();
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Unifill : _unifill } ) ); _unifill.fill.color = CorrectUniColor(color, _unifill.fill.color, 0);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaTextPr({Unifill: _unifill}));
}
}; };
asc_docs_api.prototype.put_PrIndent = function(value,levelValue) asc_docs_api.prototype.put_PrIndent = function(value,levelValue)
...@@ -2458,8 +2477,10 @@ asc_docs_api.prototype.get_DocumentOrientation = function() ...@@ -2458,8 +2477,10 @@ asc_docs_api.prototype.get_DocumentOrientation = function()
asc_docs_api.prototype.put_AddPageBreak = function() asc_docs_api.prototype.put_AddPageBreak = function()
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_AddPageBreak); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaNewLine( break_Page ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.WordControl.m_oLogicDocument.Paragraph_Add(new ParaNewLine(break_Page));
}
}; };
asc_docs_api.prototype.Update_ParaInd = function( Ind ){ asc_docs_api.prototype.Update_ParaInd = function( Ind ){
var FirstLine = 0; var FirstLine = 0;
...@@ -3920,8 +3941,10 @@ asc_docs_api.prototype.asyncFontStartLoaded = function() ...@@ -3920,8 +3941,10 @@ asc_docs_api.prototype.asyncFontStartLoaded = function()
asc_docs_api.prototype.asyncFontEndLoaded = function(fontinfo) asc_docs_api.prototype.asyncFontEndLoaded = function(fontinfo)
{ {
this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadFont); this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadFont);
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(historydescription_Presentation_EndFontLoad); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { FontFamily : { Name : fontinfo.Name , Index : -1 } } ) ); 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