mirror of https://github.com/apache/poi.git
Fixing future bug when we support continue records for more than xxxx merged
regions. Fetch the last merged record as the merged pointer if the current one is killed. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
72e18903be
commit
fa17a12b5b
|
@ -469,12 +469,20 @@ public class Sheet implements Model
|
||||||
numMergedRegions--;
|
numMergedRegions--;
|
||||||
if (rec.getNumAreas() == 0)
|
if (rec.getNumAreas() == 0)
|
||||||
{
|
{
|
||||||
|
mergedRecords.remove(pos);
|
||||||
|
if (merged == rec) {
|
||||||
|
//pull up the LAST record for operations when we finally
|
||||||
|
//support continue records for mergedRegions
|
||||||
|
if (mergedRecords.size() > 0) {
|
||||||
|
merged = (MergeCellsRecord) mergedRecords.get(mergedRecords.size() - 1);
|
||||||
|
} else {
|
||||||
|
merged = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (merged == rec)
|
|
||||||
merged = (MergeCellsRecord) mergedRecords.get(mergedRecords.size() - 1);
|
|
||||||
int removePos = ((Integer) mergedLocs.get(pos)).intValue();
|
int removePos = ((Integer) mergedLocs.get(pos)).intValue();
|
||||||
records.remove(removePos);
|
records.remove(removePos);
|
||||||
mergedRecords.remove(pos);
|
|
||||||
mergedLocs.remove(pos);
|
mergedLocs.remove(pos);
|
||||||
|
|
||||||
//if we're not tracking merged records, kill the pointer to reset the state
|
//if we're not tracking merged records, kill the pointer to reset the state
|
||||||
|
|
Loading…
Reference in New Issue