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 2010/12/06 11:37:39 UTC

DO NOT REPLY [Bug 50416] New: shiftRows compute wrong the last row number

https://issues.apache.org/bugzilla/show_bug.cgi?id=50416

           Summary: shiftRows compute wrong the last row number
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: fr.koala@gmail.com


In org.apache.poi.hssf.usermodel.HSSFSheet,

in method public void shiftRows(int startRow, int endRow, int n,
            boolean copyRowHeight, boolean resetOriginalRowHeight, boolean
moveComments), 
the line if ( endRow == _lastrow || endRow + n > _lastrow ) _lastrow =
Math.min( endRow + n, SpreadsheetVersion.EXCEL97.getLastRowIndex() ); compute
the _lastrow if the end == lastrow and n is NEGATIVE.

Regards, F.K

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

French.Koala <fr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |3.7
         OS/Version|Windows XP                  |All

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

--- Comment #3 from French.Koala <fr...@gmail.com> 2010-12-13 08:00:54 EST ---
Sorry for the description, so please find the attached unitTest which describe
the bug.

Regards, F.K

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

--- Comment #2 from French.Koala <fr...@gmail.com> 2010-12-13 07:59:41 EST ---
Created an attachment (id=26399)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26399)
Test case which describe the bug

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2010-12-13 00:53:05 EST ---
I'm not sure I quite follow, sorry

Could you write up a little unit test that shows the problem? Or describe what
parameters to pass to shiftRows to make it compute it wrong?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

French.Koala <fr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50416] shiftRows compute wrong the last row number

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

Nick Burch <ni...@alfresco.com> changed:

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

--- Comment #4 from Nick Burch <ni...@alfresco.com> 2010-12-14 01:41:32 EST ---
I've found the problem. In the case of:

* 1
* blank
* 3
* 4

Then when you move 4 to (blank=2) with a shift of 2, it wasn't checking if row
3 existed or not before re-computing the last

In the case of

* 1
* 2
* 3

then moving row 1 to row 4 would also have left it confused

I think I've fixed this in r1048951, along with a slightly expanded version of
your unit test (thanks for that!)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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