[SSE][DE mobile] For Bug 38456
This commit is contained in:
parent
7a9b457821
commit
e5cbf5c551
|
@ -409,12 +409,12 @@ define([
|
|||
var tempW = w; w = h; h = tempW;
|
||||
}
|
||||
|
||||
if (Math.abs(_pageSizesCurrent[0] - w) > 0.01 ||
|
||||
Math.abs(_pageSizesCurrent[1] - h) > 0.01) {
|
||||
if (Math.abs(_pageSizesCurrent[0] - w) > 0.1 ||
|
||||
Math.abs(_pageSizesCurrent[1] - h) > 0.1) {
|
||||
_pageSizesCurrent = [w, h];
|
||||
|
||||
_.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;
|
||||
}
|
||||
}, this);
|
||||
|
|
|
@ -121,7 +121,18 @@ define([
|
|||
var w = opt.asc_getWidth();
|
||||
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)
|
||||
panel.cmbPaperSize.setValue(item.get('value'));
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue