// Delete chart series IF SERIES ARE ROW-BASED -- do before updateReferences
List charts = this.mysheet.getCharts();
for (int i= 0; i < charts.size(); i++) {
String sht= GenericPtg.qualifySheetname(this.getSheetName());
Chart c= (Chart) charts.get(i);
HashMap seriesmap= c.getSeriesPtgs();
Iterator ii= seriesmap.keySet().iterator();
while (ii.hasNext()) {
com.extentech.formats.XLS.charts.Series s= ( com.extentech.formats.XLS.charts.Series) ii.next();
Ptg[] ptgs= (Ptg[])seriesmap.get(s);
PtgRef pr;
String cursheet;
int[] rc;
for (int j= 0; j < ptgs.length; j++) {
try {
pr= (PtgRef)ptgs[j];
cursheet= pr.getSheetName();
rc= pr.getIntLocation();
if (rc[1]!=rc[3] && sht.equalsIgnoreCase(cursheet)) { // series are in rows, if existing series fall within deleted row
if ((rc[0])==rownum-1) {
c.removeSeries(j);
break; // got it
}
} else
break; // isn't row-based so split
} catch (Exception e) {
continue; // shouldn't happen!
}
}
}
// also shift chart up if necessary [BugTracker 2858]
int row= c.getRow0();
// only move images whose top is >= rnum
int rnum= rownum+1;
if (row > rnum) {
int h= c.getHeight();
// move down 1 row
c.setRow(row-1);
c.setHeight(h);
}
}
if (flag!=WorkSheetHandle.ROW_DELETE_NO_REFERENCE_UPDATE)
ReferenceTracker.updateReferences(rownum, -1, this.mysheet, true);