You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2025/06/25 17:57:12 UTC

[Bug 69727] New: XSSFSheet Wrong count when call removeMergedRegion and addMergedRegion

https://bz.apache.org/bugzilla/show_bug.cgi?id=69727

            Bug ID: 69727
           Summary: XSSFSheet Wrong count when call removeMergedRegion and
                    addMergedRegion
           Product: POI
           Version: 5.4.1-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: 13966777303@139.com
  Target Milestone: ---

When we call XSSFSheet.removeMergedRegion(CellRangeAddress),
the count of CTMergeCells will not change;
Then if we call addMergedRegion.It's codes like this:
 XSSFSheet.addMergedRegion(CellRangeAddress region, boolean validate){
        XXX
        long count = ctMergeCells.getCount();

        if (count == 0) {
            count=ctMergeCells.sizeOfMergeCellArray();
        } else {
            count++;
        }

        // also adjust the number of merged regions overall
        ctMergeCells.setCount(count);

}

it use the wrong count,because the count is not change when we call
removeMergedRegion.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 69727] XSSFSheet Wrong count when call removeMergedRegion and addMergedRegion

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69727

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
I've created a PR - https://github.com/apache/poi/pull/837

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 69727] XSSFSheet Wrong count when call removeMergedRegion and addMergedRegion

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69727

Matafagafo <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matafagafo@gmail.com
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 69727] XSSFSheet Wrong count when call removeMergedRegion and addMergedRegion

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69727

PJ Fanning <fa...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org