View | Details | Raw Unified | Return to bug 52834
Collapse All | Expand All

(-)src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/ColumnHelper.java (-3 / +12 lines)
Lines 326-331 Link Here
326
        layout = new TextLayout(str.getIterator(), frc);
326
        layout = new TextLayout(str.getIterator(), frc);
327
        int defaultCharWidth = (int)layout.getAdvance();
327
        int defaultCharWidth = (int)layout.getAdvance();
328
328
329
        int numMergedRegions = sheet.getNumMergedRegions();
330
331
        CellRangeAddress[] regions = new CellRangeAddress[numMergedRegions];
332
        for (int i = 0; i < numMergedRegions; i++) {
333
            CellRangeAddress region = sheet.getMergedRegion(i);
334
            regions[i] = region;
335
        }
336
329
        double width = -1;
337
        double width = -1;
330
        rows:
338
        rows:
331
        for (Iterator it = sheet.rowIterator(); it.hasNext();) {
339
        for (Iterator it = sheet.rowIterator(); it.hasNext();) {
Lines 336-345 Link Here
336
                continue;
344
                continue;
337
            }
345
            }
338
346
347
            int rowNum = row.getRowNum();
339
            int colspan = 1;
348
            int colspan = 1;
340
            for (int i = 0 ; i < sheet.getNumMergedRegions(); i++) {
349
            for (int i = 0 ; i < numMergedRegions; i++) {
341
                CellRangeAddress region = sheet.getMergedRegion(i);
350
                CellRangeAddress region = regions[i];
342
                if (containsCell(region, row.getRowNum(), column)) {
351
                if (containsCell(region, rowNum, column)) {
343
                    if (!useMergedCells) {
352
                    if (!useMergedCells) {
344
                        // If we're not using merged cells, skip this one and move on to the next.
353
                        // If we're not using merged cells, skip this one and move on to the next.
345
                        continue rows;
354
                        continue rows;

Return to bug 52834