Commit b752282e 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@63764 954022d7-b5bf-4e40-9824-e11837661b57
parent 1867efe9
...@@ -554,7 +554,7 @@ var maxIndividualValues = 10000; ...@@ -554,7 +554,7 @@ var maxIndividualValues = 10000;
ws._onUpdateFormatTable(oldFilter.Ref, false, true); ws._onUpdateFormatTable(oldFilter.Ref, false, true);
}, },
checkAddAutoFilter: function(activeRange, styleName) checkAddAutoFilter: function(activeRange, styleName, addFormatTableOptionsObj)
{ {
//write error, if not add autoFilter and return false //write error, if not add autoFilter and return false
var result = true; var result = true;
...@@ -566,6 +566,16 @@ var maxIndividualValues = 10000; ...@@ -566,6 +566,16 @@ var maxIndividualValues = 10000;
aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical); aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical);
result = false; result = false;
} }
else if(!styleName && this._isEmptyRange(activeRange))//add filter to empty range
{
aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterDataRangeError, c_oAscError.Level.NoCritical);
result = false;
}
else if(styleName && addFormatTableOptionsObj.isTitle === false && this._isEmptyCellsUnderRange(activeRange) == false && this._isPartTablePartsUnderRange(activeRange))//add format table without title if down another format table
{
aWs.workbook.handlers.trigger("asc_onError", c_oAscError.ID.AutoFilterChangeFormatTableError, c_oAscError.Level.NoCritical);
result = false;
}
return result; return result;
}, },
...@@ -4511,6 +4521,28 @@ var maxIndividualValues = 10000; ...@@ -4511,6 +4521,28 @@ var maxIndividualValues = 10000;
} }
return result; return result;
},
_isEmptyRange: function(activeCells)
{
var aWs = this._getCurrentWS();
var cell;
for(var n = activeCells.r1 - 1; n <= activeCells.r2 + 1; n++)
{
if(n < 0)
n = 0;
for(var k = activeCells.c1 - 1; k <= activeCells.c2 + 1; k++)
{
if(k < 0)
k = 0;
cell = aWs.getCell3(n, k, n, k);
if(cell.getValueWithoutFormat() != '')
return false;
}
}
return 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