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

Добавлена функция в апи для удаления все кастомных стилей (баг 29882).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64931 954022d7-b5bf-4e40-9824-e11837661b57
parent d041645a
...@@ -1574,6 +1574,7 @@ var historydescription_Presentation_SetVert = 0x0122; ...@@ -1574,6 +1574,7 @@ var historydescription_Presentation_SetVert = 0x0122;
var historydescription_Document_AddNewStyle = 0x0123; var historydescription_Document_AddNewStyle = 0x0123;
var historydescription_Document_RemoveStyle = 0x0124; var historydescription_Document_RemoveStyle = 0x0124;
var historydescription_Document_AddTextArt = 0x0125; var historydescription_Document_AddTextArt = 0x0125;
var historydescription_Document_RemoveAllCustomStyles = 0x0126;
...@@ -1879,6 +1880,7 @@ function Get_HistoryPointStringDescription(nDescription) ...@@ -1879,6 +1880,7 @@ function Get_HistoryPointStringDescription(nDescription)
case historydescription_Document_AddNewStyle : sString = "Document_AddNewStyle "; break; case historydescription_Document_AddNewStyle : sString = "Document_AddNewStyle "; break;
case historydescription_Document_RemoveStyle : sString = "Document_RemoveStyle "; break; case historydescription_Document_RemoveStyle : sString = "Document_RemoveStyle "; break;
case historydescription_Document_AddTextArt : sString = "Document_AddTextArt "; break; case historydescription_Document_AddTextArt : sString = "Document_AddTextArt "; break;
case historydescription_Document_RemoveAllCustomStyles : sString = "Document_RemoveAllCustomStyles "; break;
} }
return sString; return sString;
} }
...@@ -14762,6 +14762,16 @@ CDocument.prototype.Remove_Style = function(sStyleName) ...@@ -14762,6 +14762,16 @@ CDocument.prototype.Remove_Style = function(sStyleName)
this.Document_UpdateInterfaceState(); this.Document_UpdateInterfaceState();
} }
}; };
CDocument.prototype.Remove_AllCustomStyles = function()
{
if (false === this.Document_Is_SelectionLocked(changestype_Document_Styles))
{
History.Create_NewPoint(historydescription_Document_RemoveAllCustomStyles);
this.Styles.Remove_AllCustomStylesFromInterface();
this.Recalculate();
this.Document_UpdateInterfaceState();
}
};
CDocument.prototype.Add_ChangedStyle = function(arrStylesId) CDocument.prototype.Add_ChangedStyle = function(arrStylesId)
{ {
for (var nIndex = 0, nCount = arrStylesId.length; nIndex < nCount; nIndex++) for (var nIndex = 0, nCount = arrStylesId.length; nIndex < nCount; nIndex++)
......
...@@ -4797,6 +4797,18 @@ CStyles.prototype = ...@@ -4797,6 +4797,18 @@ CStyles.prototype =
this.Update_Interface(StyleId); this.Update_Interface(StyleId);
}, },
Remove_AllCustomStylesFromInterface : function()
{
for (var StyleId in this.Style)
{
var Style = this.Style[StyleId];
if ((styletype_Paragraph === Style.Get_Type() || styletype_Character === Style.Get_Type()) && true === Style.Get_QFormat())
{
this.Remove_StyleFromInterface(StyleId);
}
}
},
Create_StyleFromInterface : function(oAscStyle, bCheckLink) Create_StyleFromInterface : function(oAscStyle, bCheckLink)
{ {
var oStyle = new CStyle(); var oStyle = new CStyle();
......
...@@ -7188,6 +7188,10 @@ asc_docs_api.prototype.asc_RemoveStyle = function(sName) ...@@ -7188,6 +7188,10 @@ asc_docs_api.prototype.asc_RemoveStyle = function(sName)
{ {
this.WordControl.m_oLogicDocument.Remove_Style(sName); this.WordControl.m_oLogicDocument.Remove_Style(sName);
}; };
asc_docs_api.prototype.asc_RemoveAllCustomStyles = function()
{
this.WordControl.m_oLogicDocument.Remove_AllCustomStyles();
};
asc_docs_api.prototype.asc_IsStyleDefault = function(sName) asc_docs_api.prototype.asc_IsStyleDefault = function(sName)
{ {
return this.WordControl.m_oLogicDocument.Is_StyleDefault(sName); return this.WordControl.m_oLogicDocument.Is_StyleDefault(sName);
...@@ -7698,4 +7702,4 @@ function CSpellCheckApi_desktop() ...@@ -7698,4 +7702,4 @@ function CSpellCheckApi_desktop()
window["AscDesktopEditor_Save"] = function() window["AscDesktopEditor_Save"] = function()
{ {
return editor.asc_Save(); return editor.asc_Save();
}; };
\ No newline at end of file
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