Commit fe68678d authored by GoshaZotov's avatar GoshaZotov

add changes from SVN branch(FormatAsTable Branch)

parent 7dc3e9bd
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
if (typeof String.prototype.startsWith != 'function') {
......@@ -1463,7 +1463,7 @@ parserHelper.prototype.checkDataRange = function (model, wb, dialogType, dataRan
return c_oAscError.ID.MaxDataSeriesError;
} else if (c_oAscSelectionDialogType.FormatTable === dialogType) {
// ToDo убрать эту проверку, заменить на более грамотную после правки функции _searchFilters
if (true === wb.getWorksheet().autoFilters.isRangeIntersectionTableOrFilter(dataRange))
if (true === wb.getWorksheet().model.autoFilters.isRangeIntersectionTableOrFilter(dataRange))
return c_oAscError.ID.AutoFilterDataRangeError;
}
}
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
(function($, window, undefined) {
......@@ -2984,7 +2984,7 @@
var api = window["Asc"]["editor"];
var ws = api.wb.getWorksheet();
bIsTablePartContainActiveRange = ws.autoFilters.isTablePartContainActiveRange();
bIsTablePartContainActiveRange = ws.model.autoFilters.isTablePartContainActiveRange(ws.activeRange);
}
else
{
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
var c_oUndoRedoSerializeType =
......@@ -3058,7 +3058,7 @@ UndoRedoCell.prototype = {
cell.setValueData(Val);
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
var worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
worksheetView.autoFilters.renameTableColumn(new Asc.Range(nCol, nRow, nCol, nRow), bUndo);
worksheetView.model.autoFilters.renameTableColumn(new Asc.Range(nCol, nRow, nCol, nRow), bUndo);
}
else if(historyitem_Cell_SetStyle == Type)
{
......@@ -3219,7 +3219,7 @@ UndoRedoWoorksheet.prototype = {
if(bUndo)
{
var workSheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
workSheetView.autoFilters.reDrawFilter(new Asc.Range(0, from, ws.nColsCount - 1, to));
workSheetView.model.autoFilters.reDrawFilter(new Asc.Range(0, from, ws.nColsCount - 1, to));
}
}
else if(historyitem_Worksheet_AddRows == Type || historyitem_Worksheet_RemoveRows == Type)
......@@ -3256,8 +3256,6 @@ UndoRedoWoorksheet.prototype = {
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
if(!bUndo)
worksheetView.autoFilters.insertRows(bInsert ? "insCell" : "delCell", range, operType);
worksheetView.cellCommentator.updateCommentsDependencies(bInsert, operType, range);
}
else if(historyitem_Worksheet_AddCols == Type || historyitem_Worksheet_RemoveCols == Type)
......@@ -3295,8 +3293,6 @@ UndoRedoWoorksheet.prototype = {
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
if(!bUndo)
worksheetView.autoFilters.insertColumn(bInsert ? "insCell" : "delCell", range, operType);
worksheetView.cellCommentator.updateCommentsDependencies(bInsert, operType, range);
}
else if(historyitem_Worksheet_ShiftCellsLeft == Type || historyitem_Worksheet_ShiftCellsRight == Type)
......@@ -3334,10 +3330,6 @@ UndoRedoWoorksheet.prototype = {
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
var isCheckChangeAutoFilter = worksheetView.autoFilters.isActiveCellsCrossHalfFTable(range.bbox, operType, bInsert ? "insCell" : "delCell");
if(!bUndo && isCheckChangeAutoFilter === true)
worksheetView.autoFilters.insertColumn(bInsert ? "insCell" : "delCell", range.bbox, operType);
worksheetView.cellCommentator.updateCommentsDependencies(bInsert, operType, range.bbox);
}
else if(historyitem_Worksheet_ShiftCellsTop == Type || historyitem_Worksheet_ShiftCellsBottom == Type)
......@@ -3375,8 +3367,6 @@ UndoRedoWoorksheet.prototype = {
// ToDo Так делать неправильно, нужно поправить (перенести логику в model, а отрисовку отделить)
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
if(!bUndo)
worksheetView.autoFilters.insertRows(bInsert ? "insCell" : "delCell",range.bbox, operType);
worksheetView.cellCommentator.updateCommentsDependencies(bInsert, operType, range.bbox);
}
else if(historyitem_Worksheet_Sort == Type)
......@@ -3440,11 +3430,11 @@ UndoRedoWoorksheet.prototype = {
worksheetView = this.wb.oApi.wb.getWorksheetById(nSheetId);
if(bUndo)//если на Undo перемещается диапазон из форматированной таблицы - стиль форматированной таблицы не должен цепляться
{
worksheetView.autoFilters._cleanStyleTable(to);
worksheetView.model.autoFilters._cleanStyleTable(to);
}
worksheetView.autoFilters.reDrawFilter(to);
worksheetView.autoFilters.reDrawFilter(from);
worksheetView.model.autoFilters.reDrawFilter(to);
worksheetView.model.autoFilters.reDrawFilter(from);
}
else if(historyitem_Worksheet_Merge == Type || historyitem_Worksheet_Unmerge == Type)
{
......@@ -3815,7 +3805,7 @@ UndoRedoAutoFilters.prototype = {
var ws = api.wb.getWorksheetById(nSheetId);
Data.worksheet = ws;
var autoFilters = ws.autoFilters;
var autoFilters = ws.model.autoFilters;
if (bUndo == true)
{
autoFilters.Undo(Type, Data);
......
......@@ -3152,6 +3152,8 @@ function Woorksheet(wb, _index, sId){
this.aConditionalFormatting = [];
this.sheetPr = null;
this.aFormulaExt = null;
this.autoFilters = new asc.AutoFilters(this);
this.oDrawingOjectsManager = new DrawingObjectsManager(this);
this.contentChanges = new CContentChanges();
......@@ -3681,6 +3683,8 @@ Woorksheet.prototype._removeRows=function(start, stop){
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveRows, this.getId(), new Asc.Range(0, start, gc_nMaxCol0, gc_nMaxRow0), new UndoRedoData_FromToRowCol(true, start, stop));
this.autoFilters.insertRows( "delCell", new Asc.Range(0, start, gc_nMaxCol0, stop), c_oAscDeleteOptions.DeleteRows );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3738,6 +3742,8 @@ Woorksheet.prototype._insertRowsBefore=function(index, count){
History.LocalChange = false;
}
this.autoFilters.insertRows( "insCell", new Asc.Range(0, index, gc_nMaxCol0, index + count - 1), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3821,6 +3827,8 @@ Woorksheet.prototype._removeCols=function(start, stop){
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_RemoveCols, this.getId(), new Asc.Range(start, 0, gc_nMaxCol0, gc_nMaxRow0), new UndoRedoData_FromToRowCol(false, start, stop));
this.autoFilters.insertColumn( "delCell", new Asc.Range(start, 0, stop, gc_nMaxRow0), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -3861,7 +3869,8 @@ Woorksheet.prototype._insertColsBefore=function(index, count){
}
}
this.autoFilters.insertColumn( "insCells", new Asc.Range(index, 0, index + count - 1, gc_nMaxRow0), c_oAscInsertOptions.InsertColumns );
buildRecalc(this.workbook);
unLockDraw(this.workbook);
......@@ -4650,6 +4659,9 @@ Woorksheet.prototype._moveRange=function(oBBoxFrom, oBBoxTo, copyRange){
}
}
if(false == this.workbook.bUndoChanges && false == this.workbook.bRedoChanges)
this.autoFilters._moveAutoFilters( oBBoxTo, oBBoxFrom, null, copyRange, true, oBBoxFrom );
if(false == this.workbook.bUndoChanges && (false == this.workbook.bRedoChanges || true == this.workbook.bCollaborativeChanges))
{
History.LocalChange = true;
......@@ -4758,6 +4770,7 @@ Woorksheet.prototype._shiftCellsLeft=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsLeft, this.getId(), new Asc.Range(nLeft, oBBox.r1, gc_nMaxCol0, oBBox.r2), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertColumn( "delCell", oBBox, c_oAscDeleteOptions.DeleteCellsAndShiftLeft );
//todo проверить не уменьшились ли границы таблицы
};
Woorksheet.prototype._shiftCellsUp=function(oBBox){
......@@ -4800,6 +4813,7 @@ Woorksheet.prototype._shiftCellsUp=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsTop, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, oBBox.c2, gc_nMaxRow0), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertRows( "delCell", oBBox, c_oAscDeleteOptions.DeleteCellsAndShiftTop );
//todo проверить не уменьшились ли границы таблицы
};
Woorksheet.prototype._shiftCellsRight=function(oBBox){
......@@ -4837,6 +4851,7 @@ Woorksheet.prototype._shiftCellsRight=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsRight, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, gc_nMaxCol0, oBBox.r2), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertColumn( "insCells", oBBox, c_oAscInsertOptions.InsertCellsAndShiftRight );
};
Woorksheet.prototype._shiftCellsBottom=function(oBBox){
//до перемещения ячеек, перед функцией, в которой используются nodesSheetArea/nodesSheetCell move/shift нужно обязательно вызвать force buildRecalc
......@@ -4871,6 +4886,7 @@ Woorksheet.prototype._shiftCellsBottom=function(oBBox){
}
History.Add(g_oUndoRedoWorksheet, historyitem_Worksheet_ShiftCellsBottom, this.getId(), new Asc.Range(oBBox.c1, oBBox.r1, oBBox.c2, gc_nMaxRow0), new UndoRedoData_BBox(oBBox));
this.autoFilters.insertRows( "insCell", oBBox, c_oAscInsertOptions.InsertCellsAndShiftDown );
};
Woorksheet.prototype._setIndex=function(ind){
this.index = ind;
......
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7  3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7  3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"use strict";
var g_oColorManager = null;
......@@ -4817,6 +4817,9 @@ FilterColumn.prototype.isHideValue = function(val, isDateTimeFormat, top10Length
res = this.CustomFiltersObj.isHideValue(val);
else if(this.Top10)
res = this.Top10.isHideValue(val, top10Length);
else if(this.ColorFilter)
res = this.ColorFilter.isHideValue(val);
return res;
};
FilterColumn.prototype.clean = function() {
......@@ -5334,6 +5337,9 @@ ColorFilter.prototype.clone = function() {
}
return res;
};
ColorFilter.prototype.isHideValue = function() {
return false;
};
ColorFilter.prototype.asc_getCellColor = function () { return this.CellColor; };
ColorFilter.prototype.asc_getDxf = function () { return this.dxf; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
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