Commit cb84e920 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Получение всех комментариев через asc_getWorkbookComments

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53178 954022d7-b5bf-4e40-9824-e11837661b57
parent 00bbfa3f
...@@ -2176,8 +2176,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2176,8 +2176,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.IsFocus = isEnabled; this.IsFocus = isEnabled;
}, },
asc_searchEnabled: function(bIsEnabled) asc_searchEnabled: function(bIsEnabled) {
{
}, },
asc_findText: function (text, scanByRows, scanForward, isMatchCase, isWholeCell) { asc_findText: function (text, scanByRows, scanForward, isMatchCase, isWholeCell) {
...@@ -2458,9 +2457,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2458,9 +2457,14 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
asc_getWorkbookComments: function() { asc_getWorkbookComments: function() {
var _this = this, comments = []; var _this = this, comments = [];
if ( _this.wb ) { if ( _this.wb ) {
for (var i = 0; i < _this.wb.model.aWorksheets.length; i++) { for (var key in _this.wb.model.aWorksheets) {
for (var j = 0; j < _this.wb.model.aWorksheets[i].aComments.length; j++) { var wsModel = _this.wb.model.aWorksheets[key];
comments.push( { "Id": _this.wb.model.aWorksheets[i].aComments[j].asc_getId(), "Comment": _this.wb.model.aWorksheets[i].aComments[j] } ); var ws = _this.wb.getWorksheet(wsModel.index);
if ( ws ) {
for (var i = 0; i < ws.cellCommentator.aComments.length; i++) {
var comment = ws.cellCommentator.aComments[i];
comments.push( { "Id": comment.asc_getId(), "Comment": comment } );
}
} }
} }
} }
...@@ -2469,7 +2473,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2469,7 +2473,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Shapes // Shapes
setStartPointHistory: function(){History.Create_NewPoint(); History.StartTransaction()}, setStartPointHistory: function(){History.Create_NewPoint(); History.StartTransaction()},
setEndPointHistory: function(){History.EndTransaction()},
setEndPointHistory: function(){History.EndTransaction()},
asc_startAddShape: function(sPreset) { asc_startAddShape: function(sPreset) {
this.isStartAddShape = true; this.isStartAddShape = true;
......
...@@ -987,6 +987,7 @@ ...@@ -987,6 +987,7 @@
// initializing is completed // initializing is completed
this._trigger("initialized"); this._trigger("initialized");
}, },
_initConditionalFormatting: function () { _initConditionalFormatting: function () {
var oGradient = null; var oGradient = null;
var aCFs = this.model.aConditionalFormatting; var aCFs = this.model.aConditionalFormatting;
...@@ -1052,19 +1053,15 @@ ...@@ -1052,19 +1053,15 @@
} }
} }
}, },
_prepareComments: function () { _prepareComments: function () {
var commentList = []; // для отправки за один раз // Теперь получение всех комментариев через asc_getWorkbookComments
for(var i = 0, length = this.model.aComments.length; i < length; ++i) for (var i = 0, length = this.model.aComments.length; i < length; ++i) {
{
var comment = { "Id": this.model.aComments[i].asc_getId(), "Comment": this.model.aComments[i] }; var comment = { "Id": this.model.aComments[i].asc_getId(), "Comment": this.model.aComments[i] };
this.cellCommentator.addCommentSerialize(comment["Comment"]); this.cellCommentator.addCommentSerialize(comment["Comment"]);
commentList.push(comment);
// Если, например, перемещаем лист
this.model.workbook.handlers.trigger("asc_onRemoveComment", comment["Id"]);
} }
if ( commentList.length )
this.model.workbook.handlers.trigger("asc_onAddComments", commentList);
}, },
_prepareDrawingObjects: function () { _prepareDrawingObjects: function () {
if ( !this.settings.objectRender ) { if ( !this.settings.objectRender ) {
this.objectRender = new DrawingObjects(); this.objectRender = new DrawingObjects();
...@@ -1073,6 +1070,7 @@ ...@@ -1073,6 +1070,7 @@
else else
this.objectRender = this.settings.objectRender; this.objectRender = this.settings.objectRender;
}, },
_initWorksheetDefaultWidth: function () { _initWorksheetDefaultWidth: function () {
this.nBaseColWidth = this.model.nBaseColWidth || this.nBaseColWidth; this.nBaseColWidth = this.model.nBaseColWidth || this.nBaseColWidth;
// Теперь рассчитываем число px // Теперь рассчитываем число px
...@@ -1097,6 +1095,7 @@ ...@@ -1097,6 +1095,7 @@
var tm = this._roundTextMetrics(sr.measureString("A")); var tm = this._roundTextMetrics(sr.measureString("A"));
this.headersHeightByFont = tm.height; this.headersHeightByFont = tm.height;
}, },
_initConstValues: function () { _initConstValues: function () {
var ppiX = this._getPPIX(); var ppiX = this._getPPIX();
var ppiY = this._getPPIY(); var ppiY = this._getPPIY();
...@@ -1111,6 +1110,7 @@ ...@@ -1111,6 +1110,7 @@
this.height_3px = asc_calcnpt(0, ppiY, 3/*px*/); this.height_3px = asc_calcnpt(0, ppiY, 3/*px*/);
this.height_4px = asc_calcnpt(0, ppiY, 4/*px*/); this.height_4px = asc_calcnpt(0, ppiY, 4/*px*/);
}, },
_initCellsArea: function (fullRecalc) { _initCellsArea: function (fullRecalc) {
// calculate rows heights and visible rows // calculate rows heights and visible rows
this._calcHeaderRowHeight(); this._calcHeaderRowHeight();
...@@ -1126,6 +1126,7 @@ ...@@ -1126,6 +1126,7 @@
this._calcVisibleColumns(); this._calcVisibleColumns();
this._updateVisibleColsCount(/*skipScrolReinit*/true); this._updateVisibleColsCount(/*skipScrolReinit*/true);
}, },
_initPane: function () { _initPane: function () {
var pane = this.model.sheetViews[0].pane; var pane = this.model.sheetViews[0].pane;
if (null !== pane) { if (null !== pane) {
......
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