Commit 3f7dc021 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

убрал неиспользуемый код

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64416 954022d7-b5bf-4e40-9824-e11837661b57
parent 878147ee
......@@ -8222,8 +8222,6 @@
// Для past свой диапазон
if(isLocal === "binary")
checkRange = t._pasteFromBinary(val, true);
else if(isLocal === true)
checkRange = t._pasteFromLS(val, true);
else
checkRange = t._setInfoAfterPaste(val, onlyActive, true);
}
......@@ -8242,8 +8240,6 @@
var selectData;
if(isLocal === 'binary')
selectData = t._pasteFromBinary(val);
else if (isLocal === true)
selectData = t._pasteFromLS(val);
else
selectData = t._setInfoAfterPaste(val,onlyActive);
......@@ -8654,315 +8650,6 @@
return arnFor;
};
WorksheetView.prototype._pasteFromLS = function (val,isCheckSelection){
var t = this;
var arn = t.activeRange.clone(true);
var arrFormula = [];
var numFor = 0;
var rMax = val.lStorage.length + arn.r1;
var cMax = val.lStorage[0].length + arn.c1;
var values = val.lStorage;
var isMultiple = false;
var firstCell = t.model.getRange3(arn.r1, arn.c1, arn.r1, arn.c1);
var isMergedFirstCell = firstCell.hasMerged();
var rangeUnMerge = t.model.getRange3(arn.r1, arn.c1, rMax - 1, cMax - 1);
var isOneMerge = false;
var firstValuesCol;
var firstValuesRow;
if(values[0][0].merge != null)
{
firstValuesCol = values[0][0].merge.c2-values[0][0].merge.c1;
firstValuesRow = values[0][0].merge.r2-values[0][0].merge.r1;
}
else
{
firstValuesCol = 0;
firstValuesRow = 0;
}
//если вставляем в мерженную ячейку, диапазон которой больше или равен
if (arn.c2 >= cMax -1 && arn.r2 >= rMax - 1 &&
isMergedFirstCell && isMergedFirstCell.c1 === arn.c1 && isMergedFirstCell.c2 === arn.c2 && isMergedFirstCell.r1 === arn.r1 && isMergedFirstCell.r2 === arn.r2 &&
cMax - arn.c1 === (firstValuesCol + 1) && rMax - arn.r1 === (firstValuesRow + 1))
{
if(!isCheckSelection)
{
/*values[0][0].merge =
{
r1: 0,
r2: isMergedFirstCell.r2 -isMergedFirstCell.r1,
c1: 0,
c2: isMergedFirstCell.c2 -isMergedFirstCell.c1
}*/
/*val[0][0].colSpan = isMergedFirstCell.c2 -isMergedFirstCell.c1 + 1;
val[0][0].rowSpan = isMergedFirstCell.r2 -isMergedFirstCell.r1 + 1;*/
}
isOneMerge = true;
}
else if(arn.c2 >= cMax -1 && arn.r2 >= rMax - 1)
{
//если область кратная куску вставки
var widthArea = arn.c2 - arn.c1 + 1;
var heightArea = arn.r2 - arn.r1 + 1;
var widthPasteFr = cMax - arn.c1;
var heightPasteFr = rMax - arn.r1;
//если кратны, то обрабатываем
if(widthArea%widthPasteFr === 0 && heightArea%heightPasteFr === 0)
{
isMultiple = true;
}
else if(firstCell.hasMerged() !== null)//в противном случае ошибка
{
if(isCheckSelection)
{
return arn;
}
else
{
this.handlers.trigger ("onError", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return;
}
}
}
else
{
//проверка на наличие части объединённой ячейки в области куда осуществляем вставку
for (var rFirst = arn.r1;rFirst < rMax; ++rFirst) {
for (var cFirst = arn.c1; cFirst < cMax; ++cFirst) {
range = t.model.getRange3(rFirst, cFirst, rFirst, cFirst);
var merged = range.hasMerged();
if(merged)
{
if(merged.r1 < arn.r1 || merged.r2 > rMax - 1 || merged.c1 < arn.c1 || merged.c2 > cMax-1)
{
//ошибка в случае если вставка происходит в часть объедененной ячейки
if(isCheckSelection)
{
return arn;
}
else
{
this.handlers.trigger ("onErrorEvent", c_oAscError.ID.PastInMergeAreaError, c_oAscError.Level.NoCritical);
return;
}
}
}
}
}
}
var rMax2 = rMax;
var cMax2 = cMax;
//var rMax = values.length;
var trueArn = t.activeRange;
if(isCheckSelection)
{
var newArr = arn.clone(true);
newArr.r2 = rMax2 - 1;
newArr.c2 = cMax2 - 1;
if(isMultiple || isOneMerge)
{
newArr.r2 = trueArn.r2;
newArr.c2 = trueArn.c2;
}
return newArr;
}
//если не возникает конфликт, делаем unmerge
rangeUnMerge.unmerge();
if(!isOneMerge)
{
arn.r2 = rMax2 - 1;
arn.c2 = cMax2 -1;
}
var mergeArr = [];
var n = 0;
if(isMultiple)//случай автозаполнения сложных форм
{
t.model.getRange3(trueArn.r1, trueArn.c1, trueArn.r2, trueArn.c2).unmerge();
var maxARow = heightArea/heightPasteFr;
var maxACol = widthArea/widthPasteFr;
var plRow = (rMax2 - arn.r1);
var plCol = (arn.c2 - arn.c1) + 1;
}
else
{
var maxARow = 1;
var maxACol = 1;
var plRow = 0;
var plCol = 0;
}
/*if(isMultiple)
{
var currentObj = values[arn.r1][arn.c1][0];
var valFormat = '';
if(currentObj[0] !== undefined)
valFormat = currentObj[0].text;
if(currentObj.format !== null && currentObj.format !== '' && currentObj.format !== undefined)
{
var nameFormat = clipboard._decode(currentObj.format.split(';')[0]);
valFormat = clipboard._decode(currentObj.format.split(';')[1]);
}
}*/
for (var autoR = 0;autoR < maxARow; ++autoR) {
for (var autoC = 0;autoC < maxACol; ++autoC) {
for (var r = arn.r1;r < rMax; ++r) {
for (var c = arn.c1; c < cMax; ++c) {
var newVal = values[r - arn.r1][c - arn.c1];
if(undefined !== newVal)
{
var isMerged = false, mergeCheck;
var range = t.model.getRange3(r + autoR*plRow, c + autoC*plCol, r + autoR*plRow, c + autoC*plCol);
if(!isOneMerge)
{
for(mergeCheck = 0; mergeCheck < mergeArr.length; ++mergeCheck)
{
if(r + autoR*plRow <= mergeArr[mergeCheck].r2 && r + autoR*plRow >= mergeArr[mergeCheck].r1 && c + autoC*plCol <= mergeArr[mergeCheck].c2 && c + autoC*plCol >= mergeArr[mergeCheck].c1)
isMerged = true;
}
if(newVal.merge != null && !isMerged)
{
range.setOffsetLast({offsetCol: (newVal.merge.c2 - newVal.merge.c1), offsetRow: (newVal.merge.r2 - newVal.merge.r1)});
range.merge(c_oAscMergeOptions.Merge);
mergeArr[n] = {
r1: newVal.merge.r1 + arn.r1 - values.fromRow + autoR*plRow,
r2: newVal.merge.r2 + arn.r1 - values.fromRow + autoR*plRow,
c1: newVal.merge.c1 + arn.c1 - values.fromCol + autoC*plCol,
c2: newVal.merge.c2 + arn.c1 - values.fromCol + autoC*plCol
};
n++;
}
}
else
{
for(mergeCheck = 0; mergeCheck < mergeArr.length; ++mergeCheck)
{
if(r + autoR*plRow <= mergeArr[mergeCheck].r2 && r + autoR*plRow >= mergeArr[mergeCheck].r1 && c + autoC*plCol <= mergeArr[mergeCheck].c2 && c + autoC*plCol >= mergeArr[mergeCheck].c1)
isMerged = true;
}
if(!isMerged)
{
range.setOffsetLast({offsetCol: (isMergedFirstCell.c2 -isMergedFirstCell.c1), offsetRow: (isMergedFirstCell.r2 -isMergedFirstCell.r1)});
range.merge(c_oAscMergeOptions.Merge);
mergeArr[n] = {
r1: isMergedFirstCell.r1,
r2: isMergedFirstCell.r2,
c1: isMergedFirstCell.c1,
c2: isMergedFirstCell.c2
};
n++;
}
}
//add formula
var numFormula = null;
var skipFormat = null;
var noSkipVal = null;
for(var nF = 0; nF < newVal.value2.length;nF++)
{
if(newVal.value2[nF] && newVal.value2[nF].sId)
{
numFormula = nF;
break;
}
else if(newVal.value2[nF] && newVal.value2[nF].format && newVal.value2[nF].format.skip)
skipFormat = true;
else if(newVal.value2[nF] && newVal.value2[nF].format && !newVal.value2[nF].format.skip)
noSkipVal = nF;
}
if(newVal.value2.length == 1 || numFormula != null || (skipFormat != null && noSkipVal!= null))
{
if(numFormula == null)
numFormula = 0;
var numStyle = 0;
if(skipFormat != null && noSkipVal!= null)
numStyle = noSkipVal;
if( newVal.value2[numFormula].sId){
var offset = range.getCells()[numFormula].getOffset2(newVal.value2[numFormula].sId),
assemb,
_p_ = new parserFormula(newVal.value2[numFormula].sFormula,"",range.worksheet);
if( _p_.parse() ){
assemb = _p_.changeOffset(offset).assemble();
//range.setValue("="+assemb);
arrFormula[numFor] = {};
arrFormula[numFor].range = range;
arrFormula[numFor].val = "=" + assemb;
numFor++;
}
}
else if(newVal.valWithoutFormat)
range.setValue(newVal.valWithoutFormat);
else
range.setValue(newVal.value2[numStyle].text);
range.setBold(newVal.value2[numStyle].format.b);
range.setItalic(newVal.value2[numStyle].format.i);
range.setStrikeout(newVal.value2[numStyle].format.s);
if(!isOneMerge && newVal.value2[numStyle].format && null != newVal.value2[numStyle].format.c)
range.setFontcolor(newVal.value2[numStyle].format.c);
range.setUnderline(newVal.value2[numStyle].format.u);
//range.setAlignVertical(currentObj.va);
range.setFontname(newVal.value2[numStyle].format.fn);
range.setFontsize(newVal.value2[numStyle].format.fs);
}
else
range.setValue2(newVal.value2);
range.setAlignVertical(newVal.verAlign);
if(!isOneMerge)
range.setAlignHorizontal(newVal.horAlign);
if(!isOneMerge)
range.setBorderSrc(newVal.borders);
var nameFormat;
/*if(newVal.format.oPositiveFormat)
{
var output = {};
var bRes = newVal.format.shiftFormat(output, 0);
if(true == bRes)
nameFormat = output.format;
}*/
if(newVal.format && newVal.format.sFormat)
nameFormat = newVal.format.sFormat;
if(nameFormat)
range.setNumFormat(nameFormat);
range.setFill(newVal.fill);
range.setWrap(newVal.wrap);
if(newVal.angle)
range.setAngle(newVal.angle);
if(newVal.hyperlink != null)
{
newVal.hyperlink.Ref = range;
range.setHyperlink(newVal.hyperlink);
}
}
}
}
}
}
if(isMultiple)
{
arn.r2 = trueArn.r2;
arn.c2 = trueArn.c2;
}
t.isChanged = true;
t.activeRange.c2 = arn.c2;
t.activeRange.r2 = arn.r2;
var arnFor = [];
arnFor[0] = arn;
arnFor[1] = arrFormula;
return arnFor;
};
WorksheetView.prototype._pasteFromBinary = function (val,isCheckSelection){
var t = this;
var arn = t.activeRange.clone(true);
......
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