Commit fb852496 authored by Sergey Konovalov's avatar Sergey Konovalov Committed by GitHub

Merge pull request #91 from ONLYOFFICE/formuladependence

Formuladependence
parents e31de797 f6c7f64a
......@@ -9,7 +9,7 @@ cd $BASEDIR
echo npm install
grunt --level=WHITESPACE_ONLY --mobile=true --noclosure=true
grunt --level=WHITESPACE_ONLY --mobile=true --noclosure=true --formatting=PRETTY_PRINT
echo grunt --level=ADVANCED --mobile=true --noclosure=true
echo -n $'\r' > temp.txt
......@@ -25,4 +25,4 @@ cat "../../web-apps/vendor/xregexp/xregexp-all-min.js" "temp.txt" "../../web-app
cat "banners.js" "../cell/sdk-all-min.js" "../cell/sdk-all.js" > "../../mobile-apps/ios/Vendor/ONLYOFFICE/SDKData/spreadsheets/script.bin"
rm -f -r "banners.js"
rm -f -r "temp.txt"
\ No newline at end of file
rm -f -r "temp.txt"
......@@ -16,12 +16,14 @@
"../common/downloaderfiles.js",
"../common/commonDefines.js",
"../common/editorscommon.js",
"../common/Private/editorscommon.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/Private/editorscommon.js",
"../common/Shapes/Serialize.js",
"../common/Shapes/SerializeWriter.js",
"../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js",
"../common/Drawings/Format/Constants.js",
"../common/Drawings/Format/Format.js",
"../common/FontsFreeType/font_map.js",
......@@ -77,38 +79,57 @@
"../word/Editor/CollaborativeEditing.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/History.js",
"../word/Editor/Styles.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js",
"../word/Editor/RunChanges.js",
"../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js",
"../word/Editor/SectionsChanges.js",
"../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js",
"../word/Editor/HeaderFooter.js",
"../word/Editor/DocumentContentBase.js",
"../word/Editor/Document.js",
"../word/Editor/DocumentChanges.js",
"../word/Editor/DocumentContent.js",
"../word/Editor/DocumentContentChanges.js",
"../word/Editor/DocumentControllerBase.js",
"../word/Editor/LogicDocumentController.js",
"../word/Editor/DrawingsController.js",
"../word/Editor/HeaderFooterController.js",
"../word/Editor/Common.js",
"../word/Editor/Table.js",
"../word/Editor/Table/TableChanges.js",
"../word/Editor/Table/TableRecalculate.js",
"../word/Editor/Table/TableDraw.js",
"../word/Editor/Table/TableRow.js",
"../word/Editor/Table/TableRowChanges.js",
"../word/Editor/Table/TableCell.js",
"../word/Editor/Table/TableCellChanges.js",
"../word/Editor/Serialize2.js",
"../word/Editor/Search.js",
"../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js",
"../word/Drawing/Graphics.js",
"../common/Overlay.js",
......
......@@ -9,7 +9,10 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/AdvancedOptions.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../cell/apiDefines.js",
"../cell/utils/utils.js",
"../cell/view/HandlerList.js",
......@@ -42,7 +45,6 @@
"../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js",
"../common/Drawings/States.js",
"../common/Drawings/Format/CreateGeometry.js",
......@@ -80,7 +82,7 @@
"../common/Drawings/HatchPattern.js",
"../common/scroll.js",
"../cell/view/iscroll.js",
"../common/Scrolls/iscroll.js",
"../common/wordcopypaste.js",
......@@ -127,35 +129,54 @@
"../cell/model/DrawingObjects/Format/ChartSpacePrototype.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js",
"../word/Editor/RunChanges.js",
"../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js",
"../word/Editor/SectionsChanges.js",
"../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js",
"../word/Editor/HeaderFooter.js",
"../word/Editor/DocumentContentBase.js",
"../word/Editor/Document.js",
"../word/Editor/DocumentChanges.js",
"../word/Editor/DocumentContent.js",
"../word/Editor/DocumentContentChanges.js",
"../word/Editor/DocumentControllerBase.js",
"../word/Editor/LogicDocumentController.js",
"../word/Editor/DrawingsController.js",
"../word/Editor/HeaderFooterController.js",
"../word/Editor/Table.js",
"../word/Editor/Table/TableChanges.js",
"../word/Editor/Table/TableRecalculate.js",
"../word/Editor/Table/TableDraw.js",
"../word/Editor/Table/TableRow.js",
"../word/Editor/Table/TableRowChanges.js",
"../word/Editor/Table/TableCell.js",
"../word/Editor/Table/TableCellChanges.js",
"../word/Editor/Serialize2.js",
"../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js",
"../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/Common.js",
......@@ -228,7 +249,7 @@
"../common/FontsFreeType/TextMeasurer.js",
"../cell/model/DrawingObjects/Graphics.js",
"../common/Drawings/TextDrawer.js",
"../cell/view/iscroll.js"
"../common/Scrolls/iscroll.js"
],
"dst": "../cell",
"externs": [
......
......@@ -9,7 +9,10 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/AdvancedOptions.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../slide/apiDefines.js",
"../common/CollaborativeEditingBase.js",
"../slide/Editor/CollaborativeEditing.js",
......@@ -41,7 +44,6 @@
"../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js",
"../common/Drawings/States.js",
"../common/Drawings/Format/CreateGeometry.js",
......@@ -100,12 +102,16 @@
"../word/Drawing/GraphicsEvents.js",
"../word/Drawing/Rulers.js",
"../word/Editor/Table.js",
"../word/Editor/Table/TableChanges.js",
"../word/Editor/Table/TableRecalculate.js",
"../word/Editor/Table/TableDraw.js",
"../word/Editor/Table/TableRow.js",
"../word/Editor/Table/TableRowChanges.js",
"../word/Editor/Table/TableCell.js",
"../word/Editor/Table/TableCellChanges.js",
"../word/Editor/Common.js",
"../word/Editor/Sections.js",
"../word/Editor/SectionsChanges.js",
"../word/Drawing/Graphics.js",
"../word/Drawing/ShapeDrawer.js",
......@@ -120,12 +126,21 @@
"../slide/Editor/Format/Layout.js",
"../slide/Editor/Format/Comments.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js",
"../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js",
"../word/Editor/RunChanges.js",
"../word/Math/mathTypes.js",
"../word/Math/mathText.js",
"../word/Math/mathContent.js",
......@@ -141,18 +156,23 @@
"../word/Math/borderBox.js",
"../word/Editor/FlowObjects.js",
"../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/DocumentContentBase.js",
"../word/Editor/Document.js",
"../word/Editor/DocumentChanges.js",
"../word/Editor/DocumentContent.js",
"../word/Editor/DocumentContentChanges.js",
"../word/Editor/DocumentControllerBase.js",
"../word/Editor/LogicDocumentController.js",
"../word/Editor/DrawingsController.js",
"../word/Editor/HeaderFooterController.js",
"../word/Editor/HeaderFooter.js",
"../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js",
"../word/Editor/Search.js",
"../word/Editor/FontClassification.js",
......
......@@ -12,7 +12,10 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/AdvancedOptions.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../word/apiDefines.js",
"../common/CollaborativeEditingBase.js",
"../word/Editor/CollaborativeEditing.js",
......@@ -44,7 +47,6 @@
"../common/Drawings/ArcTo.js",
"../common/Drawings/ColorArray.js",
"../common/Drawings/Format/Constants.js",
"../common/Drawings/CommonController.js",
"../word/Editor/GraphicObjects/DrawingStates.js",
"../common/Drawings/Format/CreateGeometry.js",
......@@ -100,37 +102,56 @@
"../word/Editor/GraphicObjects/GraphicPage.js",
"../word/Editor/GraphicObjects/WrapManager.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/FlowObjects.js",
"../word/Editor/ParagraphContent.js",
"../word/Editor/ParagraphContentBase.js",
"../word/Editor/Paragraph/ParaTextPr.js",
"../word/Editor/Paragraph/ParaTextPrChanges.js",
"../word/Editor/Paragraph/ParaDrawing.js",
"../word/Editor/Paragraph/ParaDrawingChanges.js",
"../word/Editor/Hyperlink.js",
"../word/Editor/HyperlinkChanges.js",
"../word/Editor/Field.js",
"../word/Editor/FieldChanges.js",
"../word/Editor/Run.js",
"../word/Editor/RunChanges.js",
"../word/Editor/Math.js",
"../word/Editor/MathChanges.js",
"../word/Editor/Paragraph.js",
"../word/Editor/ParagraphChanges.js",
"../word/Editor/Paragraph_Recalculate.js",
"../word/Editor/Sections.js",
"../word/Editor/SectionsChanges.js",
"../word/Editor/Numbering.js",
"../word/Editor/NumberingChanges.js",
"../word/Editor/HeaderFooter.js",
"../word/Editor/DocumentContentBase.js",
"../word/Editor/Document.js",
"../word/Editor/DocumentChanges.js",
"../word/Editor/DocumentContent.js",
"../word/Editor/DocumentContentChanges.js",
"../word/Editor/DocumentControllerBase.js",
"../word/Editor/LogicDocumentController.js",
"../word/Editor/DrawingsController.js",
"../word/Editor/HeaderFooterController.js",
"../word/Editor/Common.js",
"../word/Editor/Table.js",
"../word/Editor/Table/TableChanges.js",
"../word/Editor/Table/TableRecalculate.js",
"../word/Editor/Table/TableDraw.js",
"../word/Editor/Table/TableRow.js",
"../word/Editor/Table/TableRowChanges.js",
"../word/Editor/Table/TableCell.js",
"../word/Editor/Table/TableCellChanges.js",
"../word/Editor/Serialize2.js",
"../word/Editor/Search.js",
"../word/Editor/FontClassification.js",
"../word/Editor/Spelling.js",
"../word/Editor/Footnotes.js",
"../word/Editor/FootnotesChanges.js",
"../word/Editor/FootEndNote.js",
"../word/Drawing/Graphics.js",
......
......@@ -14,7 +14,7 @@
<script type="text/javascript" src="../../../web-apps/apps/spreadsheeteditor/sdk_dev_scripts.js"></script>
<script>
window.sdk_dev_scrpipts.forEach(function(item){
document.write('<script type="text/javascript" src="' + item + '"><\/script>');
document.write('<script type="text/javascript" src="' + item.substring('../'.length) + '"><\/script>');
});
</script>
......
......@@ -472,6 +472,21 @@ $( function () {
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 6 );
} );
test( "Test: \"Cross\"", function () {
ws.getRange2( "A7" ).setValue( "1" );
ws.getRange2( "A8" ).setValue( "2" );
ws.getRange2( "A9" ).setValue( "3" );
oParser = new parserFormula( 'A7:A9', null, ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().cross(new AscCommon.CellAddress(5, 0, 0), ws.getId()).getValue(), "#VALUE!" );
strictEqual( oParser.calculate().cross(new AscCommon.CellAddress(6, 0, 0), ws.getId()).getValue(), 1 );
strictEqual( oParser.calculate().cross(new AscCommon.CellAddress(7, 0, 0), ws.getId()).getValue(), 2 );
strictEqual( oParser.calculate().cross(new AscCommon.CellAddress(8, 0, 0), ws.getId()).getValue(), 3 );
strictEqual( oParser.calculate().cross(new AscCommon.CellAddress(9, 0, 0), ws.getId()).getValue(), "#VALUE!" );
} );
test( "Test: \"Parse intersection\"", function () {
......@@ -970,15 +985,15 @@ $( function () {
oParser = new parserFormula( "Лист2!A2", "A1", ws );
ok( oParser.parse() );
// strictEqual( oParser.parse(), true)
strictEqual( oParser.changeSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2" );
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2" );
oParser = new parserFormula( "Лист2:Лист3!A2", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.changeSheet( "Лист2", "Лист1" ).assemble(), "Лист1:Лист3!A2" );
strictEqual( oParser.renameSheet( "Лист2", "Лист1" ).assemble(), "Лист1:Лист3!A2" );
oParser = new parserFormula( "Лист2!A2:A5", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.changeSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2:A5" );
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2:A5" );
ws = wb.getWorksheet( 0 );
ws.getRange2( "S95" ).setValue( "2" );
......@@ -1415,8 +1430,6 @@ $( function () {
test( "Test: \"TEXT\"", function () {
wb.dependencyFormulas = new AscCommonExcel.DependencyGraph( wb );
oParser = new parserFormula( "TEXT(1234.567,\"$0.00\")", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "$1234.57" );
......@@ -1429,8 +1442,6 @@ $( function () {
test( "Test: \"WORKDAY\"", function () {
wb.dependencyFormulas = new AscCommonExcel.DependencyGraph( wb );
oParser = new parserFormula( "WORKDAY(DATE(2006,1,1),0)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), 38718 );
......
......@@ -12,16 +12,12 @@
<script type="text/javascript" src="../../../web-apps/vendor/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../utils/utils.js"></script>
<script type="text/javascript" src="../model/Workbook.js"></script>
<script type="text/javascript" src="../model/WorkbookElems.js"></script>
<script type="text/javascript" src="../model/Serialize.js"></script>
<script type="text/javascript" >
AscCommonExcel.g_oDefaultFormat.FontAbs = {};
</script>
<script type="text/javascript" src="../model/FormulaObjects/parserFormula.js"></script>
<script type="text/javascript" src="../../Common/commonDefines.js"></script>
<script type="text/javascript" src="../../Common/NumFormat.js"></script>
<script type="text/javascript" src="../../../web-apps/apps/spreadsheeteditor/sdk_dev_scripts.js"></script>
<script>
window.sdk_dev_scrpipts.forEach(function(item){
document.write('<script type="text/javascript" src="' + item.substring('../'.length) + '"><\/script>');
});
</script>
<script type="text/javascript" src="CellFormatTests.js"></script>
......
......@@ -10,9 +10,14 @@
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen" />
<script type="text/javascript" src="qunit/qunit.js"></script>
<script type="text/javascript" src="../utils/utils.js"></script>
<script type="text/javascript" src="../../../web-apps/vendor/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../../../web-apps/apps/spreadsheeteditor/sdk_dev_scripts.js"></script>
<script>
window.sdk_dev_scrpipts.forEach(function(item){
document.write('<script type="text/javascript" src="' + item.substring('../'.length) + '"><\/script>');
});
</script>
<script type="text/javascript" src="tests.js"></script>
</head>
......
......@@ -342,4 +342,122 @@ $(function () {
l3.trigger("onEvent1", "trigger event with all handlers removed by 'remove()'"); //-
});
test("RangeTree", function test_HandlersList() {
function getRandomArbitary(min, max)
{
return Math.round(Math.random() * (max - min) + min);
}
function getCellIndex(row, col) {
return row * AscCommon.gc_nMaxCol + col;
}
function testCells(cells, tree, standart)
{
var starndartRes = {};
var treeCells = {};
for(var i = 0; i < cells.length; ++i){
var cell = cells[i];
treeCells[cell.index] = cell.index;
for(var id in standart){
var data = standart[id];
if(data.bbox.contains(cell.col, cell.row)){
starndartRes[data.id] = data;
}
}
}
var starndartResArr = [];
for(var i in starndartRes){
starndartResArr.push(starndartRes[i].id);
}
var treeRes = [];
var areas = tree.getByCells(treeCells);
for(var i = 0 ; i < areas.length; ++i){
treeRes.push(areas[i].data.id);
}
tree.getByCellsEnd(areas);
treeRes.sort();
starndartResArr.sort();
var res = JSON.stringify(starndartResArr)==JSON.stringify(treeRes);
return res;
}
function test(row, col, tree, standart)
{
var cells = [];
var cellsCount = 10;
while (cellsCount-- > 0) {
var r1 = getRandomArbitary(0, row);
var c1 = getRandomArbitary(0, col);
cells.push({row: r1, col: c1, index: getCellIndex(r1, c1)});
}
return testCells(cells, tree, standart);
}
var bboxCount = 1000;
var colMax = 100;
var rowMax = 100;
var tree = new AscCommonExcel.RangeTree();
var standard = {};
var count = 0;
for(var i = 0 ; i < bboxCount; ++i){
var r1 = getRandomArbitary(0, rowMax);
var r2 = getRandomArbitary(0, rowMax);
var c1 = getRandomArbitary(0, colMax);
var c2 = getRandomArbitary(0, colMax);
var bbox = new Asc.Range(c1, c2, r1, r2, true);
var name = bbox.getName();
if (!standard[name]) {
var data = {bbox: bbox, id: i};
standard[name] = data;
tree.add(bbox, data);
var res = test(rowMax, colMax, tree, standard);
count += res ? 0 : 1;
}
}
strictEqual(count, 0, "RangeTree missmatch");
count = 0;
for(var i in standard){
var data = standard[i];
delete standard[i];
tree.remove(data.bbox, data);
var res = test(rowMax, colMax, tree, standard);
count += res ? 0 : 1;
}
strictEqual(count, 0, "RangeTree no empty");
});
test("DependencyGraph.startListeningRange", function test_HandlersList() {
function getRandomArbitary(min, max)
{
return Math.round(Math.random() * (max - min) + min);
}
var bboxCount = 100;
var colMax = 100;
var rowMax = 100;
var sheetId = 0;
var graph = new AscCommonExcel.DependencyGraph(null);
var standard = {};
for(var i = 0 ; i < bboxCount; ++i){
var r1 = getRandomArbitary(0, rowMax);
var r2 = getRandomArbitary(0, rowMax);
var c1 = getRandomArbitary(0, colMax);
var c2 = getRandomArbitary(0, colMax);
var bbox = new Asc.Range(c1, c2, r1, r2, true);
var listener = {bbox: bbox, getListenerId: function(){return i;}};
standard[listener.getListenerId()] = listener;
graph.startListeningRange(sheetId, bbox, listener);
}
for(var i in standard){
var data = standard[i];
delete standard[i];
graph.endListeningRange(sheetId, data.bbox, data);
}
var res = "";
var sheetContainer = graph.sheetListeners[sheetId];
for(var i in sheetContainer.cellMap){
res += i;
}
for(var i in sheetContainer.areaMap){
res += i;
}
strictEqual(res, "", "DependencyGraph no empty");
});
});
This diff is collapsed.
This diff is collapsed.
......@@ -95,7 +95,6 @@ var c_oAscSelectionDialogType = {
None: 0,
FormatTable: 1,
Chart: 2,
DefinedName: 3,
FormatTableChangeRange: 4
};
......@@ -439,7 +438,6 @@ var c_oAscPopUpSelectorType = {
prot['None'] = prot.None;
prot['FormatTable'] = prot.FormatTable;
prot['Chart'] = prot.Chart;
prot['DefinedName'] = prot.DefinedName;
prot['FormatTableChangeRange'] = prot.FormatTableChangeRange;
window['Asc']['c_oAscHyperlinkType'] = window['Asc'].c_oAscHyperlinkType = c_oAscHyperlinkType;
prot = c_oAscHyperlinkType;
......
......@@ -320,13 +320,14 @@
};
CFormulaCF.prototype.init = function(ws) {
if (!this._f) {
this._f = new AscCommonExcel.parserFormula(this.Text, '', ws);
this._f = new AscCommonExcel.parserFormula(this.Text, null, ws);
this._f.parse();
}
};
CFormulaCF.prototype.getValue = function(ws) {
this.init(ws);
return this._f.calculate().getValue();
//todo bbox
return this._f.calculate(null, null).getValue();
};
function CIconSet () {
......
......@@ -226,12 +226,7 @@ CChartSpace.prototype.getParentObjects = function()
return parents;
};
CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransform;
CChartSpace.prototype.recalculateChart = function()
{
if(this.chartObj == null)
this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this);
};
CChartSpace.prototype.canResize = CShape.prototype.canResize;
CChartSpace.prototype.canMove = CShape.prototype.canMove;
CChartSpace.prototype.canRotate = function()
......
......@@ -148,6 +148,19 @@ CCollaborativeEditing.prototype.Check_MergeData = function()
//-----------------------------------------------------------------------------------
CCollaborativeEditing.prototype.Get_GlobalLock = function()
{
return false;
};
CCollaborativeEditing.prototype.Set_GlobalLock = function(isLock)
{
};
CCollaborativeEditing.prototype.Get_GlobalLockSelection = function()
{
return false;
};
CCollaborativeEditing.prototype.Set_GlobalLockSelection = function(isLock)
{
};
CCollaborativeEditing.prototype.OnStart_CheckLock = function()
......
......@@ -582,29 +582,17 @@
}
if (parserHelp.isArea.call(o, o.Formula, o.pCurrPos)) {
found_operand = new cArea3D(o.operand_str.toUpperCase(), _wsFrom, _wsTo, wb);
if (o.operand_str.indexOf("$") > -1) {
found_operand.isAbsolute = true;
}
} else if (parserHelp.isRef.call(o, o.Formula, o.pCurrPos)) {
if (_wsTo != _wsFrom) {
found_operand = new cArea3D(o.operand_str.toUpperCase(), _wsFrom, _wsTo, wb);
} else {
found_operand = new cRef3D(o.operand_str.toUpperCase(), _wsFrom, wb);
}
if (o.operand_str.indexOf("$") > -1) {
found_operand.isAbsolute = true;
}
}
} else if (parserHelp.isArea.call(o, o.Formula, o.pCurrPos)) {
found_operand = new cArea(o.operand_str.toUpperCase(), r1.worksheet);
if (o.operand_str.indexOf("$") > -1) {
found_operand.isAbsolute = true;
}
} else if (parserHelp.isRef.call(o, o.Formula, o.pCurrPos, true)) {
found_operand = new cRef(o.operand_str.toUpperCase(), r1.worksheet);
if (o.operand_str.indexOf("$") > -1) {
found_operand.isAbsolute = true;
}
} else if (parserHelp.isName.call(o, o.Formula, o.pCurrPos, wb)[0]) {
found_operand = new AscCommonExcel.cName(o.operand_str, wb, r1.worksheet);
}
......@@ -631,37 +619,6 @@
found_operand = found_operand.toRef();
}
var cellName = r1.getFirst().getID(), wsId = r1.worksheet.getId();
if ((cElementType.cell === found_operand.type || cElementType.cell3D === found_operand.type ||
cElementType.cellsRange === found_operand.type) && found_operand.isValid()) {
var nFrom, nTo;
if (r2) {
nFrom = r2.defName;
} else {
nFrom = wb.dependencyFormulas.addNode(wsId, cellName);
}
nTo = wb.dependencyFormulas.addNode(found_operand.getWsId(), found_operand._cells);
found_operand.setNode(nTo);
wb.dependencyFormulas.addEdge2(nFrom, nTo);
} else if (cElementType.cellsRange3D === found_operand.type && found_operand.isValid()) {
var wsR = found_operand.wsRange(), nTo, _cell = found_operand._cells.replace(/\$/g, "");
for (var j = 0; j < wsR.length; j++) {
if (r2) {
nTo = wb.dependencyFormulas.addNode(wsR[j].Id, _cell);
wb.dependencyFormulas.addEdge2(r2.defName, nTo);
} else {
wb.dependencyFormulas.addEdge(wsId, cellName.replace(/\$/g, ""), wsR[j].Id, _cell);
}
}
}
return this.value = found_operand;
}
......@@ -1036,38 +993,6 @@
this.value = new cError(cErrorType.wrong_value_type);
}
if (cElementType.cellsRange === this.value.type || cElementType.cell === this.value.type ||
cElementType.cell3D === this.value.type || cElementType.cellsRange3D === this.value.type) {
var r1 = arguments[1], r2 = arguments[2], wb = r1.worksheet.workbook, cellName = r1.getFirst()
.getID(), wsId = r1.worksheet.getId();
if ((cElementType.cell === this.value.type || cElementType.cell3D === this.value.type ||
cElementType.cellsRange === this.value.type) && this.value.isValid()) {
var nFrom, nTo;
if (r2) {
nFrom = r2.defName;
} else {
nFrom = wb.dependencyFormulas.addNode(wsId, cellName);
}
nTo = wb.dependencyFormulas.addNode(this.value.getWsId(), this.value._cells.replace(/\$/g, ""));
this.value.setNode(nTo);
wb.dependencyFormulas.addEdge2(nFrom, nTo);
} else if (cElementType.cellsRange3D === this.value.type && this.value.isValid()) {
var wsR = this.value.wsRange(), nTo, _cell = this.value._cells.replace(/\$/g, "");
for (var j = 0; j < wsR.length; j++) {
if (r2) {
nTo = wb.dependencyFormulas.addNode(wsR[j].Id, _cell);
wb.dependencyFormulas.addEdge2(r2.defName, nTo);
} else {
wb.dependencyFormulas.addEdge(wsId, cellName.replace(/\$/g, ""), wsR[j].Id, _cell);
}
}
}
}
return this.value;
};
......
This diff is collapsed.
......@@ -1722,11 +1722,11 @@ cTEXT.prototype.Calculate = function ( arg ) {
for ( var i = 0, length = aText.length; i < length; ++i ) {
if ( aText[i].format && aText[i].format.skip ) {
if ( aText[i].format && aText[i].format.getSkip() ) {
text += " ";
continue;
}
if ( aText[i].format && aText[i].format.repeat )
if ( aText[i].format && aText[i].format.getRepeat() )
continue;
text += aText[i].text;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -208,14 +208,6 @@
}
co = this.charOffset(pos, i - 1, h);
// если самый последний символ - это новая строка, то надо сместить еще на одну линию
if (t.charWidths[t.chars.length - 1] === 0) {
co.left = null;
co.top += l[i - 1].th;
co.lineIndex++;
}
return co;
};
......@@ -240,10 +232,6 @@
return this.charWidths[pos];
};
CellTextRender.prototype.isLastCharNL = function () {
return this.charWidths[this.chars.length - 1] === 0;
};
//------------------------------------------------------------export---------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
......
This diff is collapsed.
......@@ -729,6 +729,9 @@
t.skipKeyPress = true;
switch (event.which) {
case 120: // F9
t.handlers.trigger("calcAll", shiftKey);
return result;
case 113: // F2
if (isViewerMode || t.handlers.trigger("getCellEditMode") || t.isSelectionDialogMode) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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