Commit 18ff92f2 authored by alexey.musinov's avatar alexey.musinov

Merge branch 'develop' of https://github.com/ONLYOFFICE/sdkjs into develop

parents 6d22a5ba 6123d3a5
...@@ -553,7 +553,13 @@ ...@@ -553,7 +553,13 @@
if(filterObj.filter.TableStyleInfo !== undefined) if(filterObj.filter.TableStyleInfo !== undefined)
autoFilter = filterObj.filter.AutoFilter; autoFilter = filterObj.filter.AutoFilter;
if(!autoFilter) if(!autoFilter)
{
autoFilter = new AscCommonExcel.AutoFilter(); autoFilter = new AscCommonExcel.AutoFilter();
autoFilter.Ref = currentFilter.Ref.clone();
filterObj.filter.AutoFilter = autoFilter;
}
var newFilterColumn; var newFilterColumn;
if(filterObj.index !== null) if(filterObj.index !== null)
{ {
......
...@@ -11611,6 +11611,7 @@ function CreateAscStroke(ln, _canChangeArrows) ...@@ -11611,6 +11611,7 @@ function CreateAscStroke(ln, _canChangeArrows)
break; break;
} }
} }
} }
...@@ -11650,7 +11651,12 @@ function CreateAscStroke(ln, _canChangeArrows) ...@@ -11650,7 +11651,12 @@ function CreateAscStroke(ln, _canChangeArrows)
{ {
ret.asc_putLineendstyle(LineEndType.None); ret.asc_putLineendstyle(LineEndType.None);
} }
if(AscFormat.isRealNumber(ln.prstDash)){
ret.prstDash = ln.prstDash;
}
else{
ret.prstDash = Asc.c_oDashType.solid;
}
if (true === _canChangeArrows) if (true === _canChangeArrows)
ret.canChangeArrows = true; ret.canChangeArrows = true;
...@@ -11739,7 +11745,12 @@ function CorrectUniStroke(asc_stroke, unistroke, flag) ...@@ -11739,7 +11745,12 @@ function CorrectUniStroke(asc_stroke, unistroke, flag)
ret.tailEnd.w = 2 - ((_end_size/3) >> 0); ret.tailEnd.w = 2 - ((_end_size/3) >> 0);
ret.tailEnd.len = 2 - (_end_size % 3); ret.tailEnd.len = 2 - (_end_size % 3);
} }
if(AscFormat.isRealNumber(asc_stroke.prstDash)){
ret.prstDash = asc_stroke.prstDash;
}
else{
ret.prstDash = Asc.c_oDashType.solid;
}
return ret; return ret;
} }
......
...@@ -867,7 +867,7 @@ ...@@ -867,7 +867,7 @@
// Offline mode // Offline mode
baseEditorsApi.prototype.asc_isOffline = function() baseEditorsApi.prototype.asc_isOffline = function()
{ {
return false; return (window.location.protocol.indexOf("file") == 0) ? true : false;
}; };
baseEditorsApi.prototype.asc_getUrlType = function(url) baseEditorsApi.prototype.asc_getUrlType = function(url)
{ {
......
...@@ -2022,6 +2022,7 @@ ...@@ -2022,6 +2022,7 @@
this.type = null; this.type = null;
this.width = null; this.width = null;
this.color = null; this.color = null;
this.prstDash = null;
this.LineJoin = null; this.LineJoin = null;
this.LineCap = null; this.LineCap = null;
...@@ -2057,7 +2058,10 @@ ...@@ -2057,7 +2058,10 @@
asc_getLineendsize: function(){return this.LineEndSize;}, asc_getLineendsize: function(){return this.LineEndSize;},
asc_putLineendsize: function(v){this.LineEndSize = v;}, asc_putLineendsize: function(v){this.LineEndSize = v;},
asc_getCanChangeArrows: function(){return this.canChangeArrows;} asc_getCanChangeArrows: function(){return this.canChangeArrows;},
asc_putPrstDash: function(v){this.prstDash = v;},
asc_getPrstDash: function(){ return this.prstDash;}
}; };
// цвет. может быть трех типов: // цвет. может быть трех типов:
...@@ -2868,6 +2872,8 @@ ...@@ -2868,6 +2872,8 @@
prot["get_lineendsize"] = prot["asc_getLineendsize"] = prot.asc_getLineendsize; prot["get_lineendsize"] = prot["asc_getLineendsize"] = prot.asc_getLineendsize;
prot["put_lineendsize"] = prot["asc_putLineendsize"] = prot.asc_putLineendsize; prot["put_lineendsize"] = prot["asc_putLineendsize"] = prot.asc_putLineendsize;
prot["get_canChangeArrows"] = prot["asc_getCanChangeArrows"] = prot.asc_getCanChangeArrows; prot["get_canChangeArrows"] = prot["asc_getCanChangeArrows"] = prot.asc_getCanChangeArrows;
prot["put_prstDash"] = prot["asc_putPrstDash"] = prot.asc_putPrstDash;
prot["get_prstDash"] = prot["asc_getPrstDash"] = prot.asc_getPrstDash;
window["AscCommon"].CAscColorScheme = CAscColorScheme; window["AscCommon"].CAscColorScheme = CAscColorScheme;
prot = CAscColorScheme.prototype; prot = CAscColorScheme.prototype;
......
...@@ -812,6 +812,20 @@ var c_oAscPrintDefaultSettings = { ...@@ -812,6 +812,20 @@ var c_oAscPrintDefaultSettings = {
CustomMode : 3 CustomMode : 3
}; };
var c_oDashType = {
dash: 0,
dashDot: 1,
dot: 2,
lgDash: 3,
lgDashDot: 4,
lgDashDotDot: 5,
solid: 6,
sysDash: 7,
sysDashDot: 8,
sysDashDotDot: 9,
sysDot: 10
};
var c_oAscEncodings = [ var c_oAscEncodings = [
[ 0, 28596, "ISO-8859-6", "Arabic (ISO 8859-6)" ], [ 0, 28596, "ISO-8859-6", "Arabic (ISO 8859-6)" ],
[ 1, 720, "DOS-720", "Arabic (OEM 720)" ], [ 1, 720, "DOS-720", "Arabic (OEM 720)" ],
...@@ -1399,7 +1413,21 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom ...@@ -1399,7 +1413,21 @@ window['Asc']['c_oAscMaxCellOrCommentLength'] = window['Asc'].c_oAscMaxCellOrCom
prot['DeleteRows'] = prot.DeleteRows; prot['DeleteRows'] = prot.DeleteRows;
prot['DeleteTable'] = prot.DeleteTable; prot['DeleteTable'] = prot.DeleteTable;
window['AscCommon'] = window['AscCommon'] || {}; window['Asc']['c_oDashType'] = window['Asc'].c_oDashType = c_oDashType;
prot = c_oDashType;
prot['dash'] = prot.dash;
prot['dashDot'] = prot.dashDot;
prot['dot'] = prot.dot;
prot['lgDash'] = prot.lgDash;
prot['lgDashDot'] = prot.lgDashDot;
prot['lgDashDotDot'] = prot.lgDashDotDot;
prot['solid'] = prot.solid;
prot['sysDash'] = prot.sysDash;
prot['sysDashDot'] = prot.sysDashDot;
prot['sysDashDotDot'] = prot.sysDashDotDot;
prot['sysDot'] = prot.sysDot;
window['AscCommon'] = window['AscCommon'] || {};
window["AscCommon"].g_cCharDelimiter = g_cCharDelimiter; window["AscCommon"].g_cCharDelimiter = g_cCharDelimiter;
window["AscCommon"].bDate1904 = false; window["AscCommon"].bDate1904 = false;
window["AscCommon"].c_oAscAdvancedOptionsAction = c_oAscAdvancedOptionsAction; window["AscCommon"].c_oAscAdvancedOptionsAction = c_oAscAdvancedOptionsAction;
......
...@@ -580,6 +580,33 @@ CFootnotesController.prototype.private_GetFootnotesOnPage = function(PageAbs, St ...@@ -580,6 +580,33 @@ CFootnotesController.prototype.private_GetFootnotesOnPage = function(PageAbs, St
oFootnotes[oFootnote.Get_Id()] = oFootnote; oFootnotes[oFootnote.Get_Id()] = oFootnote;
} }
}; };
CFootnotesController.prototype.private_OnNotValidActionForFootnotes = function()
{
// Пока ничего не делаем, если надо будет выдавать сообщение, то обработать нужно будет здесь.
};
CFootnotesController.prototype.private_IsOnFootnoteSelected = function()
{
var nCounter = 0;
for (var sId in this.Selection.Footnotes)
{
nCounter++;
if (nCounter > 1)
return false;
}
return true;
};
CFootnotesController.prototype.private_CheckFootnotesSelectionBeforeAction = function()
{
if (true !== this.private_IsOnFootnoteSelected() || null === this.CurFootnote)
{
this.private_OnNotValidActionForFootnotes();
return false;
}
return true;
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Controller area // Controller area
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...@@ -603,108 +630,75 @@ CFootnotesController.prototype.GetCurPage = function() ...@@ -603,108 +630,75 @@ CFootnotesController.prototype.GetCurPage = function()
}; };
CFootnotesController.prototype.AddNewParagraph = function(bRecalculate, bForceAdd) CFootnotesController.prototype.AddNewParagraph = function(bRecalculate, bForceAdd)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_NewParagraph(bRecalculate, bForceAdd);
}
return bRetValue; return this.CurFootnote.Add_NewParagraph(bRecalculate, bForceAdd);
}; };
CFootnotesController.prototype.AddInlineImage = function(nW, nH, oImage, oChart, bFlow) CFootnotesController.prototype.AddInlineImage = function(nW, nH, oImage, oChart, bFlow)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_InlineImage(nW, nH, oImage, oChart, bFlow);
}
return bRetValue; return this.CurFootnote.Add_InlineImage(nW, nH, oImage, oChart, bFlow);
}; };
CFootnotesController.prototype.AddOleObject = function(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId) CFootnotesController.prototype.AddOleObject = function(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_OleObject(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId);
}
return bRetValue; return this.CurFootnote.Add_OleObject(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId);
}; };
CFootnotesController.prototype.AddTextArt = function(nStyle) CFootnotesController.prototype.AddTextArt = function(nStyle)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_TextArt(nStyle);
}
return bRetValue; return this.CurFootnote.Add_TextArt(nStyle);
}; };
CFootnotesController.prototype.EditChart = function(Chart) CFootnotesController.prototype.EditChart = function(Chart)
{ {
// TODO: Реализовать if (false === this.private_CheckFootnotesSelectionBeforeAction())
return;
this.CurFootnote.Edit_Chart(Chart);
}; };
CFootnotesController.prototype.AddInlineTable = function(Cols, Rows) CFootnotesController.prototype.AddInlineTable = function(Cols, Rows)
{ {
// TODO: Доделать селект и курсор if (false === this.private_CheckFootnotesSelectionBeforeAction())
if (true === this.Selection.Use) return;
{
} if (null !== this.CurFootnote)
else this.CurFootnote.Add_InlineTable(Cols, Rows);
{
if (null !== this.CurFootnote)
this.CurFootnote.Add_InlineTable(Cols, Rows);
}
}; };
CFootnotesController.prototype.ClearParagraphFormatting = function() CFootnotesController.prototype.ClearParagraphFormatting = function()
{ {
// TODO: Доделать селект и курсор for (var sId in this.Selection.Footnotes)
if (true === this.Selection.Use)
{
}
else
{ {
if (null !== this.CurFootnote) var oFootnote = this.Selection.Footnotes[sId];
this.CurFootnote.Paragraph_ClearFormatting(); oFootnote.Paragraph_ClearFormatting();
} }
}; };
CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate) CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate)
{ {
// TODO: Доделать селект и курсор if (oItem instanceof ParaTextPr)
if (true === this.Selection.Use)
{ {
for (var sId in this.Selection.Footnotes)
{
var oFootnote = this.Selection.Footnotes[sId];
oFootnote.Paragraph_Add(oItem, false);
}
if (false !== bRecalculate)
{
this.LogicDocument.Recalculate();
}
} }
else else
{ {
if (false === this.private_CheckFootnotesSelectionBeforeAction())
return;
if (null !== this.CurFootnote) if (null !== this.CurFootnote)
this.CurFootnote.Paragraph_Add(oItem, bRecalculate); this.CurFootnote.Paragraph_Add(oItem, bRecalculate);
} }
......
...@@ -655,7 +655,8 @@ ...@@ -655,7 +655,8 @@
asc_docs_api.prototype.SetReaderModeOnly = function() asc_docs_api.prototype.SetReaderModeOnly = function()
{ {
this.isOnlyReaderMode = true; this.isOnlyReaderMode = true;
this.ImageLoader.bIsAsyncLoadDocumentImages = false; if (this.ImageLoader)
this.ImageLoader.bIsAsyncLoadDocumentImages = false;
}; };
asc_docs_api.prototype.IncreaseReaderFontSize = function() asc_docs_api.prototype.IncreaseReaderFontSize = function()
...@@ -7875,6 +7876,9 @@ background-repeat: no-repeat;\ ...@@ -7875,6 +7876,9 @@ background-repeat: no-repeat;\
this.asc_setDrawCollaborationMarks(this.tmpCoMarksDraw); this.asc_setDrawCollaborationMarks(this.tmpCoMarksDraw);
asc_docs_api.superclass._onEndLoadSdk.call(this); asc_docs_api.superclass._onEndLoadSdk.call(this);
if (this.isOnlyReaderMode)
this.ImageLoader.bIsAsyncLoadDocumentImages = false;
}; };
asc_docs_api.prototype.asc_Recalculate = function(bIsUpdateInterface) asc_docs_api.prototype.asc_Recalculate = function(bIsUpdateInterface)
......
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