Commit 4da628df authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

asc_setSelectDialogRangeMode -> asc_setSelectionDialogMode

В функцию asc_setSelectionDialogMode добавил второй параметр (диапазон для стартового выделения)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48373 954022d7-b5bf-4e40-9824-e11837661b57
parent afae06fc
...@@ -2408,12 +2408,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2408,12 +2408,13 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
/** /**
* Режим выбора диапазона * Режим выбора диапазона
* @param {Boolean} isSelectDialogRangeMode * @param {Boolean} isSelectionDialogMode
* @param selectRange
*/ */
asc_setSelectDialogRangeMode: function (isSelectDialogRangeMode) { asc_setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
this.controller.setSelectDialogRangeMode(isSelectDialogRangeMode); this.controller.setSelectionDialogMode(isSelectionDialogMode);
if (this.wb) if (this.wb)
this.wb.setSelectDialogRangeMode(isSelectDialogRangeMode); this.wb.setSelectionDialogMode(isSelectionDialogMode, selectRange);
}, },
asc_SendThemeColors : function (colors, standart_colors) { asc_SendThemeColors : function (colors, standart_colors) {
...@@ -3021,7 +3022,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3021,7 +3022,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_insertFormula"] = prot.asc_insertFormula; prot["asc_insertFormula"] = prot.asc_insertFormula;
prot["asc_getFormulasInfo"] = prot.asc_getFormulasInfo; prot["asc_getFormulasInfo"] = prot.asc_getFormulasInfo;
prot["asc_setFontRenderingMode"] = prot.asc_setFontRenderingMode; prot["asc_setFontRenderingMode"] = prot.asc_setFontRenderingMode;
prot["asc_setSelectDialogRangeMode"] = prot.asc_setSelectDialogRangeMode; prot["asc_setSelectionDialogMode"] = prot.asc_setSelectionDialogMode;
prot["asc_ChangeColorScheme"] = prot.asc_ChangeColorScheme; prot["asc_ChangeColorScheme"] = prot.asc_ChangeColorScheme;
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
///////////////////CoAuthoring and Chat api////////////////////////////// ///////////////////CoAuthoring and Chat api//////////////////////////////
......
...@@ -2080,10 +2080,10 @@ ...@@ -2080,10 +2080,10 @@
addFilterDialog.dialog({ autoOpen: false, closeOnEscape: false, dialogClass: 'dialogClass', addFilterDialog.dialog({ autoOpen: false, closeOnEscape: false, dialogClass: 'dialogClass',
open: function() { open: function() {
api.asc_setSelectDialogRangeMode(true); api.asc_setSelectionDialogMode(true);
aDialogNames.push("addFilterDialog"); aDialogNames.push("addFilterDialog");
}, },
close: function() { aDialogNames.pop(); api.asc_setSelectDialogRangeMode(false);}, close: function() { aDialogNames.pop(); api.asc_setSelectionDialogMode(false);},
resizable: false, modal: false, width: '350px', resizable: false, modal: false, width: '350px',
buttons: [ buttons: [
{ {
...@@ -2129,7 +2129,7 @@ ...@@ -2129,7 +2129,7 @@
function setAxisXFont() { showChartFontDialog(chart.asc_getXAxis().asc_getTitleFont()) } function setAxisXFont() { showChartFontDialog(chart.asc_getXAxis().asc_getTitleFont()) }
function setAxisYFont() { showChartFontDialog(chart.asc_getYAxis().asc_getTitleFont()) } function setAxisYFont() { showChartFontDialog(chart.asc_getYAxis().asc_getTitleFont()) }
api.asc_setSelectDialogRangeMode(true); api.asc_setSelectionDialogMode(true);
chartForm.css("visibility", "visible"); chartForm.css("visibility", "visible");
chartForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400, chartForm.dialog({ autoOpen: false, closeOnEscape: true, height: 'auto', width: 400,
...@@ -2261,7 +2261,7 @@ ...@@ -2261,7 +2261,7 @@
], ],
close: function() { close: function() {
if (!bIsReopenDialog) if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false); api.asc_setSelectionDialogMode(false);
api.asc_enableKeyEvents(true); api.asc_enableKeyEvents(true);
// chart font unbinding // chart font unbinding
...@@ -2316,7 +2316,7 @@ ...@@ -2316,7 +2316,7 @@
], ],
close: function() { close: function() {
if (!bIsReopenDialog) if (!bIsReopenDialog)
api.asc_setSelectDialogRangeMode(false); api.asc_setSelectionDialogMode(false);
api.asc_enableKeyEvents(true); api.asc_enableKeyEvents(true);
}, },
create: function() { create: function() {
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
this.isMoveResizeRange = false; this.isMoveResizeRange = false;
this.isMoveResizeChartsRange = false; this.isMoveResizeChartsRange = false;
// Режим select-а для диалогов // Режим select-а для диалогов
this.isSelectDialogRangeMode = false; this.isSelectionDialogMode = false;
// Режим формулы // Режим формулы
this.isFormulaEditMode = false; this.isFormulaEditMode = false;
this.endWasPressed = false; this.endWasPressed = false;
...@@ -195,10 +195,10 @@ ...@@ -195,10 +195,10 @@
/** /**
* *
* @param {Boolean} isSelectDialogRangeMode * @param {Boolean} isSelectionDialogMode
*/ */
setSelectDialogRangeMode: function (isSelectDialogRangeMode) { setSelectionDialogMode: function (isSelectionDialogMode) {
this.isSelectDialogRangeMode = isSelectDialogRangeMode; this.isSelectionDialogMode = isSelectionDialogMode;
}, },
/** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */ /** @param whichSB {Number} Scroll bar to reinit (1=vertical, 2=horizontal) */
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
var t = this; var t = this;
// Для формулы не нужно выходить из редактирования ячейки // Для формулы не нужно выходить из редактирования ячейки
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectDialogRangeMode) {return true;} if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectionDialogMode) {return true;}
if( this.targetInfo && ( this.targetInfo.target == "moveResizeRange" || this.targetInfo.target == "moveRange" || this.targetInfo.target == "fillhandle" ) ){ if( this.targetInfo && ( this.targetInfo.target == "moveResizeRange" || this.targetInfo.target == "moveRange" || this.targetInfo.target == "fillhandle" ) ){
return true; return true;
...@@ -638,7 +638,7 @@ ...@@ -638,7 +638,7 @@
switch (event.which) { switch (event.which) {
case 113: // F2 case 113: // F2
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;} if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if ($.browser.opera) {stop();} if ($.browser.opera) {stop();}
// Выставляем блокировку на выход из редактора по клавишам-стрелкам // Выставляем блокировку на выход из редактора по клавишам-стрелкам
t.strictClose = true; t.strictClose = true;
...@@ -647,7 +647,7 @@ ...@@ -647,7 +647,7 @@
return t.__retval; return t.__retval;
case 8: // backspace case 8: // backspace
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;} if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if (t.isSelectDrawingObject) { if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone"); t.handlers.trigger("deleteDrawingObjectDone");
t.isSelectDrawingObject = false; t.isSelectDrawingObject = false;
...@@ -662,7 +662,7 @@ ...@@ -662,7 +662,7 @@
return true; return true;
case 46: // Del case 46: // Del
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;} if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
// Удаляем содержимое // Удаляем содержимое
if (t.isSelectDrawingObject) { if (t.isSelectDrawingObject) {
t.handlers.trigger("deleteDrawingObjectDone"); t.handlers.trigger("deleteDrawingObjectDone");
...@@ -805,7 +805,7 @@ ...@@ -805,7 +805,7 @@
case 88: // cut Ctrl + x case 88: // cut Ctrl + x
case 89: // redo Ctrl + y case 89: // redo Ctrl + y
case 90: // undo Ctrl + z case 90: // undo Ctrl + z
if (isViewerMode || t.isSelectDialogRangeMode) {stop(); return false;} if (isViewerMode || t.isSelectionDialogMode) {stop(); return false;}
case 65: // select all Ctrl + a case 65: // select all Ctrl + a
case 67: // copy Ctrl + c case 67: // copy Ctrl + c
...@@ -838,7 +838,7 @@ ...@@ -838,7 +838,7 @@
case 61: // Firefox, Opera (+/=) case 61: // Firefox, Opera (+/=)
case 187: // +/= case 187: // +/=
if (isViewerMode || t.isCellEditMode || t.isSelectDialogRangeMode) {return true;} if (isViewerMode || t.isCellEditMode || t.isSelectionDialogMode) {return true;}
if (event.altKey) { if (event.altKey) {
t.handlers.trigger("addFunction", /*functionName*/"SUM", /*autoComplet*/true); t.handlers.trigger("addFunction", /*functionName*/"SUM", /*autoComplet*/true);
...@@ -903,7 +903,7 @@ ...@@ -903,7 +903,7 @@
// не вводим текст в режиме просмотра // не вводим текст в режиме просмотра
// если в FF возвращать false, то отменяется дальнейшая обработка серии keydown -> keypress -> keyup // если в FF возвращать false, то отменяется дальнейшая обработка серии keydown -> keypress -> keyup
// и тогда у нас не будут обрабатываться ctrl+c и т.п. события // и тогда у нас не будут обрабатываться ctrl+c и т.п. события
if (t.settings.isViewerMode || t.isSelectDialogRangeMode) {return true;} if (t.settings.isViewerMode || t.isSelectionDialogMode) {return true;}
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects"); var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) { if ( graphicObjects.length ) {
......
...@@ -1309,8 +1309,8 @@ ...@@ -1309,8 +1309,8 @@
} }
}, },
setSelectDialogRangeMode: function (isSelectDialogRangeMode) { setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
this.getWorksheet().setSelectDialogRangeMode(isSelectDialogRangeMode); this.getWorksheet().setSelectionDialogMode(isSelectionDialogMode, selectRange);
}, },
// Поиск текста в листе // Поиск текста в листе
......
...@@ -427,9 +427,8 @@ ...@@ -427,9 +427,8 @@
this.isChartAreaEditMode = false; this.isChartAreaEditMode = false;
this.lockDraw = false; this.lockDraw = false;
this.isSelectDialogRangeMode = false; this.isSelectionDialogMode = false;
this.copyOfActiveRange = null; this.copyOfActiveRange = null;
this.newSelectRange = null; // Диапазон, который будет на начало выбора диапазона
this.startCellMoveResizeRange = null; this.startCellMoveResizeRange = null;
this.startCellMoveResizeRange2 = null; this.startCellMoveResizeRange2 = null;
...@@ -2760,7 +2759,7 @@ ...@@ -2760,7 +2759,7 @@
* @param {Asc.Range} range * @param {Asc.Range} range
*/ */
_drawSelection: function (range) { _drawSelection: function (range) {
if (!this.isSelectDialogRangeMode) { if (!this.isSelectionDialogMode) {
this._drawCollaborativeElements(/*bIsDrawObjects*/true); this._drawCollaborativeElements(/*bIsDrawObjects*/true);
this._drawSelectionRange(range); this._drawSelectionRange(range);
this.cellCommentator.drawCommentCells(false); this.cellCommentator.drawCommentCells(false);
...@@ -2779,7 +2778,7 @@ ...@@ -2779,7 +2778,7 @@
this.activeRange.c2 = this.cols.length - 1; this.activeRange.c2 = this.cols.length - 1;
} }
if (!this.isSelectDialogRangeMode) if (!this.isSelectionDialogMode)
range = this.activeRange.intersection(range !== undefined ? range : this.visibleRange); range = this.activeRange.intersection(range !== undefined ? range : this.visibleRange);
else else
range = this.copyOfActiveRange.intersection(range !== undefined ? range : this.visibleRange); range = this.copyOfActiveRange.intersection(range !== undefined ? range : this.visibleRange);
...@@ -2803,7 +2802,7 @@ ...@@ -2803,7 +2802,7 @@
var opt = this.settings; var opt = this.settings;
var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft; var offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft;
var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop; var offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
var arn = (!this.isSelectDialogRangeMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true); var arn = (!this.isSelectionDialogMode) ? this.activeRange.clone(true) : this.copyOfActiveRange.clone(true);
var x1 = (range) ? (this.cols[range.c1].left - offsetX) : 0; var x1 = (range) ? (this.cols[range.c1].left - offsetX) : 0;
var x2 = (range) ? (this.cols[range.c2].left + this.cols[range.c2].width - offsetX) : 0; var x2 = (range) ? (this.cols[range.c2].left + this.cols[range.c2].width - offsetX) : 0;
var y1 = (range) ? (this.rows[range.r1].top - offsetY) : 0; var y1 = (range) ? (this.rows[range.r1].top - offsetY) : 0;
...@@ -2923,7 +2922,7 @@ ...@@ -2923,7 +2922,7 @@
ctx.setFillStyle( opt.activeCellBackground ) ctx.setFillStyle( opt.activeCellBackground )
.fillRect(lRect, tRect, rRect - lRect, bRect - tRect); .fillRect(lRect, tRect, rRect - lRect, bRect - tRect);
var firstCell = (!this.isSelectDialogRangeMode) ? this.activeRange : this.copyOfActiveRange; var firstCell = (!this.isSelectionDialogMode) ? this.activeRange : this.copyOfActiveRange;
cr = this._getMergedCellsRange(firstCell.startCol, firstCell.startRow); cr = this._getMergedCellsRange(firstCell.startCol, firstCell.startRow);
// Получаем активную ячейку в выделении // Получаем активную ячейку в выделении
cr = range.intersection(cr !== undefined ? cr : asc_Range(firstCell.startCol, firstCell.startRow, firstCell.startCol, firstCell.startRow)); cr = range.intersection(cr !== undefined ? cr : asc_Range(firstCell.startCol, firstCell.startRow, firstCell.startCol, firstCell.startRow));
...@@ -2989,7 +2988,7 @@ ...@@ -2989,7 +2988,7 @@
this._drawFormulaRange(this.arrActiveChartsRanges) this._drawFormulaRange(this.arrActiveChartsRanges)
} }
if (this.isSelectDialogRangeMode) { if (this.isSelectionDialogMode) {
this._drawSelectRange(this.activeRange.clone(true)); this._drawSelectRange(this.activeRange.clone(true));
} }
...@@ -5864,7 +5863,7 @@ ...@@ -5864,7 +5863,7 @@
} }
if (!this.isCellEditMode && (sc !== ar.startCol || sr !== ar.startRow)) { if (!this.isCellEditMode && (sc !== ar.startCol || sr !== ar.startRow)) {
if (!this.isSelectDialogRangeMode) { if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false)); this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/false));
if (!isSelectMode) if (!isSelectMode)
this._trigger("selectionChanged", this.getSelectionInfo()); this._trigger("selectionChanged", this.getSelectionInfo());
...@@ -5991,7 +5990,7 @@ ...@@ -5991,7 +5990,7 @@
ret = this._calcActiveRangeOffset(); ret = this._calcActiveRangeOffset();
if (!this.isCellEditMode && !arnOld.isEqual(ar.clone(true))) { if (!this.isCellEditMode && !arnOld.isEqual(ar.clone(true))) {
if (!this.isSelectDialogRangeMode) { if (!this.isSelectionDialogMode) {
this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/true)); this._trigger("selectionNameChanged", this.getSelectionName(/*bRangeText*/true));
if (!isSelectMode) if (!isSelectMode)
this._trigger("selectionChanged", this.getSelectionInfo(false)); this._trigger("selectionChanged", this.getSelectionInfo(false));
...@@ -8766,20 +8765,13 @@ ...@@ -8766,20 +8765,13 @@
return this.isFormulaEditMode; return this.isFormulaEditMode;
}, },
// Функция выставляет диапазон для будующего селекта диапазона (ToDo стоит сделать по другому) setSelectionDialogMode: function (isSelectionDialogMode, selectRange) {
_setSelectDialogRange: function (newRange) { if (isSelectionDialogMode === this.isSelectionDialogMode)
if (this.isSelectDialogRangeMode)
return; return;
this.newSelectRange = newRange.clone(); this.isSelectionDialogMode = isSelectionDialogMode;
},
setSelectDialogRangeMode: function (isSelectDialogRangeMode) {
if (isSelectDialogRangeMode === this.isSelectDialogRangeMode)
return;
this.isSelectDialogRangeMode = isSelectDialogRangeMode;
this.cleanSelection(); this.cleanSelection();
if (false === this.isSelectDialogRangeMode) { if (false === this.isSelectionDialogMode) {
if (null !== this.copyOfActiveRange) { if (null !== this.copyOfActiveRange) {
this.activeRange = this.copyOfActiveRange.clone(true); this.activeRange = this.copyOfActiveRange.clone(true);
this.activeRange.startCol = this.copyOfActiveRange.startCol; this.activeRange.startCol = this.copyOfActiveRange.startCol;
...@@ -8790,11 +8782,12 @@ ...@@ -8790,11 +8782,12 @@
this.copyOfActiveRange = this.activeRange.clone(true); this.copyOfActiveRange = this.activeRange.clone(true);
this.copyOfActiveRange.startCol = this.activeRange.startCol; this.copyOfActiveRange.startCol = this.activeRange.startCol;
this.copyOfActiveRange.startRow = this.activeRange.startRow; this.copyOfActiveRange.startRow = this.activeRange.startRow;
if (this.newSelectRange) { if (selectRange) {
this.activeRange = this.newSelectRange.clone(true); selectRange = parserHelp.parse3DRef(selectRange);
this.activeRange.startCol = this.newSelectRange.startCol; if (selectRange) {
this.activeRange.startRow = this.newSelectRange.startRow; // ToDo стоит менять и лист
this.newSelectRange = null; this.activeRange = selectRange.range;
}
} }
} }
......
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