Commit b28620ff authored by Alexander Trofimov's avatar Alexander Trofimov Committed by GitHub

Merge pull request #92 from ONLYOFFICE/revert-91-formuladependence

Revert "Formuladependence"
parents fb852496 886673a3
......@@ -9,7 +9,7 @@ cd $BASEDIR
echo npm install
grunt --level=WHITESPACE_ONLY --mobile=true --noclosure=true --formatting=PRETTY_PRINT
grunt --level=WHITESPACE_ONLY --mobile=true --noclosure=true
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"
rm -f -r "temp.txt"
\ No newline at end of file
......@@ -16,14 +16,12 @@
"../common/downloaderfiles.js",
"../common/commonDefines.js",
"../common/editorscommon.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/Private/editorscommon.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",
......@@ -79,57 +77,38 @@
"../word/Editor/CollaborativeEditing.js",
"../word/Editor/Comments.js",
"../word/Editor/CommentsChanges.js",
"../word/Editor/History.js",
"../word/Editor/Styles.js",
"../word/Editor/StylesChanges.js",
"../word/Editor/Styles.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,10 +9,7 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../common/AdvancedOptions.js",
"../cell/apiDefines.js",
"../cell/utils/utils.js",
"../cell/view/HandlerList.js",
......@@ -45,6 +42,7 @@
"../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",
......@@ -82,7 +80,7 @@
"../common/Drawings/HatchPattern.js",
"../common/scroll.js",
"../common/Scrolls/iscroll.js",
"../cell/view/iscroll.js",
"../common/wordcopypaste.js",
......@@ -129,54 +127,35 @@
"../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",
......@@ -249,7 +228,7 @@
"../common/FontsFreeType/TextMeasurer.js",
"../cell/model/DrawingObjects/Graphics.js",
"../common/Drawings/TextDrawer.js",
"../common/Scrolls/iscroll.js"
"../cell/view/iscroll.js"
],
"dst": "../cell",
"externs": [
......
......@@ -9,10 +9,7 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../common/AdvancedOptions.js",
"../slide/apiDefines.js",
"../common/CollaborativeEditingBase.js",
"../slide/Editor/CollaborativeEditing.js",
......@@ -44,6 +41,7 @@
"../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",
......@@ -102,16 +100,12 @@
"../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",
......@@ -126,21 +120,12 @@
"../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",
......@@ -156,23 +141,18 @@
"../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,10 +12,7 @@
"../common/apiCommon.js",
"../common/SerializeCommonWordExcel.js",
"../common/editorscommon.js",
"../common/HistoryCommon.js",
"../common/TableId.js",
"../common/TableIdChanges.js",
"../common/AdvancedOptions.js",
"../common/AdvancedOptions.js",
"../word/apiDefines.js",
"../common/CollaborativeEditingBase.js",
"../word/Editor/CollaborativeEditing.js",
......@@ -47,6 +44,7 @@
"../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",
......@@ -102,56 +100,37 @@
"../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.substring('../'.length) + '"><\/script>');
document.write('<script type="text/javascript" src="' + item + '"><\/script>');
});
</script>
......
......@@ -472,21 +472,6 @@ $( 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 () {
......@@ -985,15 +970,15 @@ $( function () {
oParser = new parserFormula( "Лист2!A2", "A1", ws );
ok( oParser.parse() );
// strictEqual( oParser.parse(), true)
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2" );
strictEqual( oParser.changeSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2" );
oParser = new parserFormula( "Лист2:Лист3!A2", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.renameSheet( "Лист2", "Лист1" ).assemble(), "Лист1:Лист3!A2" );
strictEqual( oParser.changeSheet( "Лист2", "Лист1" ).assemble(), "Лист1:Лист3!A2" );
oParser = new parserFormula( "Лист2!A2:A5", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.renameSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2:A5" );
strictEqual( oParser.changeSheet( "Лист2", "Лист3" ).assemble(), "Лист3!A2:A5" );
ws = wb.getWorksheet( 0 );
ws.getRange2( "S95" ).setValue( "2" );
......@@ -1430,6 +1415,8 @@ $( 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" );
......@@ -1442,6 +1429,8 @@ $( 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,12 +12,16 @@
<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="../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="CellFormatTests.js"></script>
......
......@@ -10,14 +10,9 @@
<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="../../../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="../utils/utils.js"></script>
<script type="text/javascript" src="tests.js"></script>
</head>
......
......@@ -342,122 +342,4 @@ $(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,6 +95,7 @@ var c_oAscSelectionDialogType = {
None: 0,
FormatTable: 1,
Chart: 2,
DefinedName: 3,
FormatTableChangeRange: 4
};
......@@ -438,6 +439,7 @@ 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,14 +320,13 @@
};
CFormulaCF.prototype.init = function(ws) {
if (!this._f) {
this._f = new AscCommonExcel.parserFormula(this.Text, null, ws);
this._f = new AscCommonExcel.parserFormula(this.Text, '', ws);
this._f.parse();
}
};
CFormulaCF.prototype.getValue = function(ws) {
this.init(ws);
//todo bbox
return this._f.calculate(null, null).getValue();
return this._f.calculate().getValue();
};
function CIconSet () {
......
......@@ -226,7 +226,12 @@ 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,19 +148,6 @@ 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,17 +582,29 @@
}
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);
}
......@@ -619,6 +631,37 @@
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;
}
......@@ -993,6 +1036,38 @@
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.getSkip() ) {
if ( aText[i].format && aText[i].format.skip ) {
text += " ";
continue;
}
if ( aText[i].format && aText[i].format.getRepeat() )
if ( aText[i].format && aText[i].format.repeat )
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,6 +208,14 @@
}
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;
};
......@@ -232,6 +240,10 @@
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.
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.
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