Commit e5fd97ac authored by Alexander.Trofimov's avatar Alexander.Trofimov

частично поправил bug #24245

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68127 954022d7-b5bf-4e40-9824-e11837661b57
parent fb210e6a
......@@ -2761,7 +2761,7 @@ var editor;
// Формат по образцу
spreadsheet_api.prototype.asc_formatPainter = function(stateFormatPainter) {
if (this.wb) {
this.wb.getWorksheet().formatPainter(stateFormatPainter);
this.wb.formatPainter(stateFormatPainter);
}
};
......
......@@ -162,6 +162,9 @@
this.overlayGraphicCtx = undefined;
this.stringRender = undefined;
this.stateFormatPainter = c_oAscFormatPainterState.kOff;
this.rangeFormatPainter = null;
this.selectionDialogType = c_oAscSelectionDialogType.None;
this.copyActiveSheet = -1;
......@@ -419,7 +422,7 @@
// FormatPainter
'isFormatPainter': function() {
return self.getWorksheet().stateFormatPainter;
return self.stateFormatPainter;
}
});
......@@ -531,9 +534,11 @@
self.handlers.trigger("asc_onSelectionRangeChanged", val);
}, "onRenameCellTextEnd": function(countFind, countReplace) {
self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace);
}, "onStopFormatPainter": function() {
self.handlers.trigger("asc_onStopFormatPainter");
}, "onDocumentPlaceChanged": function() {
}, 'onStopFormatPainter': function() {
self._onStopFormatPainter();
}, 'getRangeFormatPainter': function() {
return self.rangeFormatPainter;
},"onDocumentPlaceChanged": function() {
self._onDocumentPlaceChanged();
}, "updateSheetViewSettings": function() {
self.handlers.trigger("asc_onUpdateSheetViewSettings");
......@@ -1094,9 +1099,8 @@
};
WorkbookView.prototype._onStopFormatPainter = function() {
var ws = this.getWorksheet();
if (ws.stateFormatPainter) {
ws.formatPainter();
if (this.stateFormatPainter) {
this.formatPainter(c_oAscFormatPainterState.kOff);
}
};
......@@ -1455,6 +1459,10 @@
selectionRange = tmpWorksheet.activeRange.clone(true);
tmpWorksheet.setSelectionDialogMode(c_oAscSelectionDialogType.None);
}
if (this.stateFormatPainter) {
// Должны отменить выбор на закрываемом листе
this.getWorksheet().formatPainter(c_oAscFormatPainterState.kOff);
}
var wb = this.model;
if (asc_typeof(index) === "number" && index >= 0) {
......@@ -1502,6 +1510,10 @@
ws.setSelectionDialogMode(this.selectionDialogType, selectionRange);
this.handlers.trigger("asc_onSelectionRangeChanged", ws.getSelectionRangeValue());
}
if (this.stateFormatPainter) {
// Должны отменить выбор на закрываемом листе
this.getWorksheet().formatPainter(this.stateFormatPainter);
}
if (!bLockDraw) {
ws.objectRender.controller.updateSelectionState();
ws.objectRender.controller.updateOverlay();
......@@ -2066,6 +2078,19 @@
}
};
WorkbookView.prototype.formatPainter = function(stateFormatPainter) {
// Если передали состояние, то выставляем его. Если нет - то меняем на противоположное.
this.stateFormatPainter = (null != stateFormatPainter) ? stateFormatPainter : ((c_oAscFormatPainterState.kOff !== this.stateFormatPainter) ? c_oAscFormatPainterState.kOff : c_oAscFormatPainterState.kOn);
this.rangeFormatPainter = this.getWorksheet().formatPainter(this.stateFormatPainter);
if (this.stateFormatPainter) {
this.copyActiveSheet = this.wsActive;
} else {
this.copyActiveSheet = -1;
this.handlers.trigger('asc_onStopFormatPainter');
}
};
WorkbookView.prototype._cleanFindResults = function() {
this.lastFindOptions = null;
this.lastFindResults = {};
......
......@@ -3961,7 +3961,7 @@
if ( !isFrozen && this.isSelectionDialogMode ) {
this._drawSelectRange( this.activeRange.clone( true ) );
}
if ( !isFrozen && this.stateFormatPainter ) {
if ( !isFrozen && this.stateFormatPainter && this.handlers.trigger('isActive') ) {
this._drawFormatPainterRange();
}
......@@ -7729,7 +7729,7 @@
WorksheetView.prototype.applyFormatPainter = function () {
var t = this;
var from = t.copyActiveRange.getAllRange(), to = t.activeRange.getAllRange();
var from = t.handlers.trigger('getRangeFormatPainter'), to = t.activeRange.getAllRange();
var oTmpRange = this._getRange( 0, 0, 0, 0 );
var onApplyFormatPainterCallback = function ( isSuccess ) {
// Очищаем выделение
......@@ -7745,7 +7745,7 @@
// Сбрасываем параметры
t._updateCellsRange( to, /*canChangeColWidth*/c_oAscCanChangeColWidth.none, /*lockDraw*/true );
if ( c_oAscFormatPainterState.kMultiple !== t.stateFormatPainter ) {
t.formatPainter();
t.handlers.trigger('onStopFormatPainter');
}
// Перерисовываем
t._recalculateAfterUpdate( [to] );
......@@ -7760,20 +7760,19 @@
this._isLockedCells( to, null, onApplyFormatPainterCallback );
};
WorksheetView.prototype.formatPainter = function ( stateFormatPainter ) {
WorksheetView.prototype.formatPainter = function(stateFormatPainter) {
// Если передали состояние, то выставляем его. Если нет - то меняем на противоположное.
this.stateFormatPainter = (null != stateFormatPainter) ? stateFormatPainter : ((c_oAscFormatPainterState.kOff !== this.stateFormatPainter) ? c_oAscFormatPainterState.kOff : c_oAscFormatPainterState.kOn);
if ( this.stateFormatPainter ) {
this.copyActiveRange = this.activeRange.clone( true );
if (this.stateFormatPainter) {
this.copyActiveRange = this.activeRange.clone(true);
this._drawFormatPainterRange();
}
else {
} else {
this.cleanSelection();
this.copyActiveRange = null;
this._drawSelection();
this.handlers.trigger( "onStopFormatPainter" );
}
return this.copyActiveRange;
};
/* Функция для работы автозаполнения (selection). (x, y) - координаты точки мыши на области */
......
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