Bug 105212 - SortDescriptor Delimeter property changed to CHAR value
Summary: SortDescriptor Delimeter property changed to CHAR value
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.2.0.0.beta1
Hardware: All All
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:5.4.0 target:5.2.6 target:5.3.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2017-01-09 17:14 UTC by devseppala
Modified: 2017-01-31 12:16 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example Writer document has a few lines and a button that launches sort()-macro. Works Before LO 5.2 beta1 (10.94 KB, application/vnd.oasis.opendocument.text)
2017-01-09 17:14 UTC, devseppala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description devseppala 2017-01-09 17:14:17 UTC
Created attachment 130281 [details]
Example Writer document has a few lines and a button that launches sort()-macro. Works Before LO 5.2 beta1

SortDescriptor is used to set sorting parameters when sorting text from a macro
ie.
  oVCursor = ThisComponent.getCurrentController().getViewCursor()
  oTCursor = oVCursor.getText.createTextCursorByRange(oVCursor)
  SortDesc = oTCursor.createSortDescriptor()

prior to LO 5.2 beta1 (Delimeter) SortDesc(1).Value used to be an integer value presenting the delimeter character.

From LO 5.2 beta1 (Delimeter) SortDesc(1).Value is expected to be an char value.

As Starbasic macro language does not have native char type, it is impossible to change the Delimeter character from a Starbasic macro.

ie.
  SortDesc(1).Value = 32
  oTCursor.sort(SortDesc())

fails.

Attached example file has a few lines and a button that launches sort()-macro. Before LO 5.2 beta1 the macro works and afterwards it does not.

Please make the sort method accept Delimeter that has an integer value.
Comment 1 Xisco Faulí 2017-01-12 10:41:25 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 9a30cb2161506e003f14592d83075ab9d30516c1
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

Regression introduced in range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=66d2b72667792cb18b25805387824d636e2a455c..db5358764fdb1855ee6b401d6165ed65677bdfbe
Comment 2 Xisco Faulí 2017-01-12 10:45:37 UTC
@Aron, would you mind bisecting this one?
Comment 3 devseppala 2017-01-12 13:12:22 UTC
Why was the Version (earliest affected) changed to 5.1.0.0 alpha1

I tested that the example macro works on LO 5.2.0.0 alpha1
and 
5.2.0.0 beta1 does not work.
Comment 4 Aron Budea 2017-01-13 02:05:07 UTC Comment hidden (bibisection)
Comment 5 Aron Budea 2017-01-13 02:09:07 UTC
This bug started with the commit referenced below. Adding Cc: to David Ostrovsky. Please take a look.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=e16fa715c43dcdf836ce8c400b6d54eae87b627d
author		David Ostrovsky <david@ostrovsky.org>	2016-03-13 08:18:00 (GMT)
committer	Stephan Bergmann <sbergman@redhat.com>	2016-05-03 19:26:06 (GMT)

"Handle wchar_t as native C++11 type on windows"
Comment 6 Stephan Bergmann 2017-01-13 09:11:44 UTC
(In reply to Aron Budea from comment #5)
> This bug started with the commit referenced below. Adding Cc: to David
> Ostrovsky. Please take a look.
> 
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=e16fa715c43dcdf836ce8c400b6d54eae87b627d
> author		David Ostrovsky <david@ostrovsky.org>	2016-03-13 08:18:00 (GMT)
> committer	Stephan Bergmann <sbergman@redhat.com>	2016-05-03 19:26:06 (GMT)
> 
> "Handle wchar_t as native C++11 type on windows"

Aron, what platform did you do the bibisection on?  (It's always useful to state that, and also the name of the bibisection repo you used, just in case.)
Comment 7 Aron Budea 2017-01-13 13:06:13 UTC
My bad, it was bibisect-win32-5.2 on Windows 7.
Comment 8 Commit Notification 2017-01-17 09:30:37 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1b835cdb5ef4cebeae729b1edf2a773f4a582c0f

tdf#105212: BASIC sets Delimiter prop to integer value

It will be available in 5.4.0.

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 Commit Notification 2017-01-17 15:54:06 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=35001a92d5e414e93e8e8bbbc3999aeb8d8efcf2&h=libreoffice-5-2

tdf#105212: BASIC sets Delimiter prop to integer value

It will be available in 5.2.6.

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 Commit Notification 2017-01-17 15:54:18 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1eadd137ade5e2c4361990cce3f153e46110a1e9&h=libreoffice-5-3

tdf#105212: BASIC sets Delimiter prop to integer value

It will be available in 5.3.1.

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 Commit Notification 2017-01-24 09:28:50 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-5-3-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=37fa60e6289b4c7ed88fd7b107af807211fd1ad9&h=libreoffice-5-3-0

tdf#105212: BASIC sets Delimiter prop to integer value

It will be available in 5.3.0.

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 12 devseppala 2017-01-31 10:49:13 UTC
I tested the fix in LO 5.3 RC3 and it solved the issue for me, thank you.
Comment 13 Aron Budea 2017-01-31 12:16:57 UTC
Setting to VERIFIED. Thanks for the feedback!