Bug 53814 - Macros: sorting range in calc in 3.6 puts nulls ahead of filled in rows
Summary: Macros: sorting range in calc in 3.6 puts nulls ahead of filled in rows
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.6.0.4 release
Hardware: Other All
: medium normal
Assignee: Noel Power
URL:
Whiteboard: BSA target:3.7.0 target:3.6.3
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-19 19:28 UTC by bugzilla
Modified: 2012-10-13 05:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Bug 53814 - example (13.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-10-07 15:49 UTC, janekptacijarabaci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugzilla 2012-08-19 19:28:54 UTC
Problem description: I have a selected range and when I sort descending by the 2nd column it puts the NULL cells/rows at the top or the rows that contain data as opposed to having them at the bottom.

This is new behavior noticed in 3.6, but not 3.4.2, 3.4.4, 3.5.2, 3.5.3, nor 3.5.4

Steps to reproduce:
Here is the code snipit that I've been using successfully in multiple versions for 1 1/2 years:

oSortFields(0).Field = 1
oSortFields(0).SortAscending = FALSE    
oSortDesc(0).Name = "SortFields"
oSortDesc(0).Value = oSortFields()
oCellRange = oSheet.getCellRangeByName("c3:d8")
oCellRange.Sort(oSortDesc())

So if I have cells like this

bob     2
tim     3
brian   4
larry   1
[blank cells]
[blank cells]

Current behavior:

[blank cells]
[blank cells]
brian   4
tim     3
bob     2
larry   1

Expected behavior:

brian   4
tim     3
bob     2
larry   1
[blank cells]
[blank cells]

Platform (if different from the browser): Only tested on Linux i586, but heard reports from one of my directors with the same problem with the same version(3.6.0.4) on Windows
              
Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11
Comment 1 janekptacijarabaci 2012-09-29 10:10:00 UTC
Accepted. Very annoying bug.
Comment 2 Noel Power 2012-10-05 15:02:32 UTC
please could you add an example document with some sample data and the macro ( not just a snippet ) to reproduce this ? would make things much easier
Comment 3 janekptacijarabaci 2012-10-07 15:49:48 UTC
Created attachment 68214 [details]
Bug 53814 - example
Comment 4 janekptacijarabaci 2012-10-07 16:51:42 UTC
(In reply to comment #3)
> Created attachment 68214 [details]
> Bug 53814 - example

In attachment - text is true: 'After deleting „List2“, saved and closed/reopened LibreOffice/this sheet: sorting is OK'
Comment 5 Noel Power 2012-10-10 13:57:38 UTC
ok, I see it, very strange that the presence of entries on sheet 2 that point back to the data on sheet1 to be sorted affect the sorting order. Thanks for the example, at least now it is easily reproduceable
Comment 6 Noel Power 2012-10-10 15:45:52 UTC
meant to say I would take this too
Comment 7 Not Assigned 2012-10-10 15:53:24 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=44e8a8240a3a1cce747f1998e617f8dd4621a992

fix for fdo#53814 Revert "there should be no need any more for this check"



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Not Assigned 2012-10-10 20:30:49 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd9d51a36cc3106d4124855874af657615a93061&g=libreoffice-3-6

fix for fdo#53814 Revert "there should be no need any more for this check"


It will be available in LibreOffice 3.6.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Not Assigned 2012-10-11 09:19:49 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-3-6-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c450c73ab7c83a55209cc7de9381cc32eb6313ff&g=libreoffice-3-6-3

fix for fdo#53814 Revert "there should be no need any more for this check"


It will be available already in LibreOffice 3.6.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Not Assigned 2012-10-11 12:51:51 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=71ada2fb20cdb1741767165948a2856b4198c700

regression test for fdo#53814



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Markus Mohrhard 2012-10-12 04:37:10 UTC
*** Bug 55712 has been marked as a duplicate of this bug. ***
Comment 12 janekptacijarabaci 2012-10-12 20:19:36 UTC
libreoffice-3-6~2012-10-12_13.47.16_LibO-Dev_3.6.4.0_Win_x86_install_en-US.msi
Version 3.6.4.0+ (Build ID: 14a24950)

The error is corrected, OK.

Thank you very much :)
Comment 13 pierre-yves samyn 2012-10-13 05:39:13 UTC
Hello

I confirm that the bug has been resolved: I reproduce with Version 3.6.2.2 (Build ID: da8c1e6) and do not reproduce with Version 3.6.4.0+ (Build ID: a010c4e)

My Bug 55712 has been marked as a duplicate of this bug.

However I have to reopen it because 3.6.4 did not solve.

Regards
Pierre-Yves