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 oThis = this;
var callBack = function()
{
var unifill = new CUniFill(); var unifill = new CUniFill();
unifill.setFill(new CSolidFill()); unifill.setFill(new CSolidFill());
unifill.fill.setColor(CorrectUniColor(color, null)); 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) 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,7 +4209,13 @@ DrawingObjectsController.prototype = ...@@ -4166,7 +4209,13 @@ 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);
var oThis = this;
var callBack = function()
{
oThis.paragraphAdd(new ParaSpace(1));
};
this.checkSelectedObjectsAndCallback(callBack, [], false, historydescription_Spreadsheet_AddSpace);
this.recalculate(); this.recalculate();
//} //}
// else // else
...@@ -4398,6 +4447,10 @@ DrawingObjectsController.prototype = ...@@ -4398,6 +4447,10 @@ DrawingObjectsController.prototype =
else if ( e.keyCode == 189 && false === isViewMode ) // Клавиша Num- else if ( e.keyCode == 189 && false === isViewMode ) // Клавиша Num-
{ {
var Item = null;
var oThis = this;
var callBack = function()
{
var Item = null; var Item = null;
if ( true === ctrlKey && true === e.shiftKey ) if ( true === ctrlKey && true === e.shiftKey )
{ {
...@@ -4408,8 +4461,9 @@ DrawingObjectsController.prototype = ...@@ -4408,8 +4461,9 @@ DrawingObjectsController.prototype =
Item = new ParaText( "_" ); Item = new ParaText( "_" );
else else
Item = new ParaText( "-" ); Item = new ParaText( "-" );
oThis.paragraphAdd(Item);
this.checkSelectedObjectsAndCallback(this.paragraphAdd, [Item], false, historydescription_Spreadsheet_AddItem); };
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};
} }
......
...@@ -1096,9 +1096,18 @@ CPresentation.prototype = ...@@ -1096,9 +1096,18 @@ CPresentation.prototype =
}, },
Paragraph_Add : function( ParaItem, bRecalculate ) Paragraph_Add : function( ParaItem, bRecalculate, noUpdateInterface )
{ {
this.Slides[this.CurPage] && this.Slides[this.CurPage].graphicObjects.checkSelectedObjectsAndCallback(this.Slides[this.CurPage].graphicObjects.paragraphAdd, [ParaItem, bRecalculate], false, historydescription_Presentation_ParagraphAdd); if(this.Slides[this.CurPage])
{
this.Slides[this.CurPage].graphicObjects.paragraphAdd(ParaItem, bRecalculate);
this.Slides[this.CurPage].graphicObjects.startRecalculate();
if(!(noUpdateInterface === true))
{
this.Document_UpdateInterfaceState();
}
}
// this.Slides[this.CurPage] && this.Slides[this.CurPage].graphicObjects.checkSelectedObjectsAndCallback(this.Slides[this.CurPage].graphicObjects.paragraphAdd, [ParaItem, bRecalculate], false, historydescription_Presentation_ParagraphAdd, true);
}, },
...@@ -1632,7 +1641,10 @@ CPresentation.prototype = ...@@ -1632,7 +1641,10 @@ CPresentation.prototype =
} }
else else
{ {
this.Paragraph_Add( new ParaTab() ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTab());
}
} }
} }
else else
...@@ -1659,13 +1671,17 @@ CPresentation.prototype = ...@@ -1659,13 +1671,17 @@ CPresentation.prototype =
{ {
if ( e.ShiftKey ) if ( e.ShiftKey )
{ {
this.Paragraph_Add( new ParaNewLine( break_Line ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaNewLine(break_Line));
}
} }
else if ( e.CtrlKey ) else if ( e.CtrlKey )
{ {
this.Paragraph_Add( new ParaNewLine( break_Page ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaNewLine(break_Page));
}
} }
else else
{ {
...@@ -1786,8 +1802,11 @@ CPresentation.prototype = ...@@ -1786,8 +1802,11 @@ CPresentation.prototype =
this.DrawingDocument.TargetStart(); this.DrawingDocument.TargetStart();
this.DrawingDocument.TargetShow(); this.DrawingDocument.TargetShow();
this.Paragraph_Add( new ParaText( String.fromCharCode( 0x00A0 ) ) );
this.Document_UpdateInterfaceState(); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaText(String.fromCharCode(0x00A0)));
}
} }
else if ( true === e.CtrlKey ) else if ( true === e.CtrlKey )
{ {
...@@ -1798,8 +1817,10 @@ CPresentation.prototype = ...@@ -1798,8 +1817,10 @@ CPresentation.prototype =
// this.DrawingDocument.TargetStart(); // this.DrawingDocument.TargetStart();
// this.DrawingDocument.TargetShow(); // this.DrawingDocument.TargetShow();
this.Paragraph_Add( new ParaSpace( 1 ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaSpace(1));
}
} }
bRetValue = true; bRetValue = true;
...@@ -2024,8 +2045,10 @@ CPresentation.prototype = ...@@ -2024,8 +2045,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { Bold : TextPr.Bold === true ? false : true } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({Bold: TextPr.Bold === true ? false : true}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2062,9 +2085,10 @@ CPresentation.prototype = ...@@ -2062,9 +2085,10 @@ CPresentation.prototype =
} }
else // Ctrl + Alt + E - добавляем знак евро € else // Ctrl + Alt + E - добавляем знак евро €
{ {
this.Create_NewHistoryPoint(historydescription_Document_AddEuroLetter); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Paragraph_Add( new ParaText( "" ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Document_UpdateInterfaceState(); this.Paragraph_Add(new ParaText(""));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2085,8 +2109,10 @@ CPresentation.prototype = ...@@ -2085,8 +2109,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { Italic : TextPr.Italic === true ? false : true } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({Italic: TextPr.Italic === true ? false : true}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2198,8 +2224,10 @@ CPresentation.prototype = ...@@ -2198,8 +2224,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { Underline : TextPr.Underline === true ? false : true } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({Underline: TextPr.Underline === true ? false : true}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2208,8 +2236,10 @@ CPresentation.prototype = ...@@ -2208,8 +2236,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { Strikeout : TextPr.Strikeout === true ? false : true } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({Strikeout: TextPr.Strikeout === true ? false : true}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2306,11 +2336,13 @@ CPresentation.prototype = ...@@ -2306,11 +2336,13 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
if ( true === e.ShiftKey ) if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Paragraph_Add( new ParaTextPr( { VertAlign : TextPr.VertAlign === vertalign_SuperScript ? vertalign_Baseline : vertalign_SuperScript } ) ); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
if (true === e.ShiftKey)
this.Paragraph_Add(new ParaTextPr({VertAlign: TextPr.VertAlign === vertalign_SuperScript ? vertalign_Baseline : vertalign_SuperScript}));
else else
this.Paragraph_Add( new ParaTextPr( { VertAlign : TextPr.VertAlign === vertalign_SubScript ? vertalign_Baseline : vertalign_SubScript } ) ); this.Paragraph_Add(new ParaTextPr({VertAlign: TextPr.VertAlign === vertalign_SubScript ? vertalign_Baseline : vertalign_SubScript}));
this.Document_UpdateInterfaceState(); }
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2319,8 +2351,10 @@ CPresentation.prototype = ...@@ -2319,8 +2351,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { VertAlign : TextPr.VertAlign === vertalign_SuperScript ? vertalign_Baseline : vertalign_SuperScript } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({VertAlign: TextPr.VertAlign === vertalign_SuperScript ? vertalign_Baseline : vertalign_SuperScript}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2329,6 +2363,8 @@ CPresentation.prototype = ...@@ -2329,6 +2363,8 @@ CPresentation.prototype =
this.DrawingDocument.TargetStart(); this.DrawingDocument.TargetStart();
this.DrawingDocument.TargetShow(); this.DrawingDocument.TargetShow();
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
var Item = null; var Item = null;
if ( true === e.CtrlKey && true === e.ShiftKey ) if ( true === e.CtrlKey && true === e.ShiftKey )
{ {
...@@ -2341,7 +2377,7 @@ CPresentation.prototype = ...@@ -2341,7 +2377,7 @@ CPresentation.prototype =
Item = new ParaText( "-" ); Item = new ParaText( "-" );
this.Paragraph_Add( Item ); this.Paragraph_Add( Item );
this.Document_UpdateInterfaceState(); }
bRetValue = true; bRetValue = true;
} }
else if ( e.KeyCode == 190 && true === e.CtrlKey ) // Ctrl + . else if ( e.KeyCode == 190 && true === e.CtrlKey ) // Ctrl + .
...@@ -2349,8 +2385,10 @@ CPresentation.prototype = ...@@ -2349,8 +2385,10 @@ CPresentation.prototype =
var TextPr = this.Get_Paragraph_TextPr(); var TextPr = this.Get_Paragraph_TextPr();
if ( null != TextPr ) if ( null != TextPr )
{ {
this.Paragraph_Add( new ParaTextPr( { VertAlign : TextPr.VertAlign === vertalign_SubScript ? vertalign_Baseline : vertalign_SubScript } ) ); if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.Document_UpdateInterfaceState(); History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
this.Paragraph_Add(new ParaTextPr({VertAlign: TextPr.VertAlign === vertalign_SubScript ? vertalign_Baseline : vertalign_SubScript}));
}
bRetValue = true; bRetValue = true;
} }
} }
...@@ -2410,8 +2448,8 @@ CPresentation.prototype = ...@@ -2410,8 +2448,8 @@ CPresentation.prototype =
} }
else*/ if ( Code > 0x20 ) else*/ if ( Code > 0x20 )
{ {
//if ( false === this.Document_Is_SelectionLocked(changestype_Drawing_Props) ) if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
{ History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
//this.Create_NewHistoryPoint(); //this.Create_NewHistoryPoint();
//this.DrawingDocument.TargetStart(); //this.DrawingDocument.TargetStart();
...@@ -2421,7 +2459,7 @@ CPresentation.prototype = ...@@ -2421,7 +2459,7 @@ CPresentation.prototype =
{ {
target_doc_content1 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(); target_doc_content1 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent();
} }
this.Paragraph_Add( new ParaText( String.fromCharCode( Code ) ) ); this.Paragraph_Add( new ParaText( String.fromCharCode( Code ) ), undefined, true );
if(this.Slides[this.CurPage]) if(this.Slides[this.CurPage])
{ {
target_doc_content2 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(); target_doc_content2 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent();
...@@ -4678,21 +4716,23 @@ CPresentation.prototype = ...@@ -4678,21 +4716,23 @@ CPresentation.prototype =
// у нас все добавляется в 1 параграф, так можно делать. // у нас все добавляется в 1 параграф, так можно делать.
this.TurnOffRecalc = true; this.TurnOffRecalc = true;
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
var Count = sText.length; var Count = sText.length;
for ( var Index = 0; Index < Count; Index++ ) for (var Index = 0; Index < Count; Index++) {
{ if (Index === Count - 1)
if ( Index === Count - 1 )
this.TurnOffRecalc = false; this.TurnOffRecalc = false;
var _char = sText.charAt(Index); var _char = sText.charAt(Index);
if (" " == _char) if (" " == _char)
this.Paragraph_Add( new ParaSpace(1) ); this.Paragraph_Add(new ParaSpace(1));
else else
this.Paragraph_Add( new ParaText(_char) ); this.Paragraph_Add(new ParaText(_char));
// На случай, если Count = 0 // На случай, если Count = 0
this.TurnOffRecalc = false; this.TurnOffRecalc = false;
} }
}
this.Document_UpdateUndoRedoState(); this.Document_UpdateUndoRedoState();
}, },
......
...@@ -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)
{ {
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
History.Create_NewPoint(historydescription_Presentation_ParagraphAdd);
var _unifill = new CUniFill(); var _unifill = new CUniFill();
_unifill.fill = new CSolidFill(); _unifill.fill = new CSolidFill();
_unifill.fill.color = CorrectUniColor(color, _unifill.fill.color, 0); _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) 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