[SSE][DE mobile] For Bug 38456

This commit is contained in:
Julia Radzhabova 2018-09-13 16:47:38 +03:00 committed by Alexey Golubev
parent 7a9b457821
commit e5cbf5c551
2 changed files with 15 additions and 4 deletions

View file

@ -409,12 +409,12 @@ define([
var tempW = w; w = h; h = tempW; var tempW = w; w = h; h = tempW;
} }
if (Math.abs(_pageSizesCurrent[0] - w) > 0.01 || if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
Math.abs(_pageSizesCurrent[1] - h) > 0.01) { Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
_pageSizesCurrent = [w, h]; _pageSizesCurrent = [w, h];
_.find(_pageSizes, function(size, index) { _.find(_pageSizes, function(size, index) {
if (Math.abs(size.value[0] - w) < 0.01 && Math.abs(size.value[1] - h) < 0.01) { if (Math.abs(size.value[0] - w) < 0.1 && Math.abs(size.value[1] - h) < 0.1) {
_pageSizesIndex = index; _pageSizesIndex = index;
} }
}, this); }, this);

View file

@ -121,7 +121,18 @@ define([
var w = opt.asc_getWidth(); var w = opt.asc_getWidth();
var h = opt.asc_getHeight(); var h = opt.asc_getHeight();
item = panel.cmbPaperSize.store.findWhere({value: w+'|'+h}); var store = panel.cmbPaperSize.store;
item = null;
for (var i=0; i<store.length; i++) {
var rec = store.at(i),
value = rec.get('value'),
pagewidth = parseFloat(/^\d{3}\.?\d*/.exec(value)),
pageheight = parseFloat(/\d{3}\.?\d*$/.exec(value));
if (Math.abs(pagewidth - w) < 0.1 && Math.abs(pageheight - h) < 0.1) {
item = rec;
break;
}
}
if (item) if (item)
panel.cmbPaperSize.setValue(item.get('value')); panel.cmbPaperSize.setValue(item.get('value'));
else else