Created attachment 113851 [details] Macro of BubbleSortList_2 Dear Madam or Sir, First I would like apologize for my faulty English but I am learning yet. I hope you understand me even so. In Libre-Office Macros/Tools/Strings exists the macro "BubbleSortList". I'm afraid isn't right the result of this macro. Words wich begins with little letters and/or umlauts won't be sorting imprecisely. Libre-Office sorted correct. The reworked tool "BubblesortList_2" produces the same list like Libre-Office. In accordance with the orthography regulations will handle umlauts like not umlauted vowels. This function BubbleSortList_2 sorts an array it's no matter how many fields. The array will sort after the field wich number's as second parameters hand over. The default sorting order is the first dimension (sortfield is missing or sortfield = 0) Function BubbleSortList_2(ByVal SortList(), optional sortfield) 'This function BubbleSortList_2 sorts an array it's no matter how many fields. 'The array will sorted after the field with number of sortfield start by 0. 'The default sorting order is the first dimension (sortfield is missing or sortfield = 0) Dim s As Integer Dim t As Integer Dim i As Integer Dim k As Integer Dim Field As Integer Dim DisplayDummy Dim Dummylist(0) As String Dim Dummylist2(0,2) As String Dim InitialASC As Integer Dim Initialletter As String Dim dimension As Integer 'Test dimension On Local Error GoTo ErrorDim dimension = - 1 Do dimension = dimension + 1 Initialletter = SortList(0,dimension) Loop Until Err > 0 ErrorDim: If Err = 9 Then dimension = dimension - 1 Else If Err = 6 Then dimension = 1 sortfield = 0 End If End If If Ismissing(sortfield) Then Field = 1 Else If Isnumeric(sortfield) Then If sortfield = 0 Then Field = 0 Else Field = sortfield End If Else 'On account of compatibility to original BubbleSortList 'That is to say if sortfield = true If LCase(Sortfield) = "true" then Field = 1 Else Field = 0 End If End If End If If Field > dimension And dimension > 0 Then Msgbox(Error(9)) Stop End If ReDim Dummylist(UBound(SortList())) As String If dimension < 2 Then ReDim DummyList2(UBound(SortList()),2) As String Else ReDim DummyList2(UBound(SortList()),dimension+1) As String End If 'The information which requisite to sort will broadcast in this loop For i = 0 To UBound(SortList()) If dimension = 0 Then Dummylist2(i,1) = SortList(i) Else If SortList(i,Field) = "" Then Dummylist2(i,1) = "zzz" & SortList(i,Field-1) Else Dummylist2(i,1) = SortList(i,Field) End If End If 'Data set number DummyList2(i,2) = i Next 'From here will only use array Dummylist2 For i = 0 To UBound(Dummylist2()) Initialletter = Dummylist2(i,1) If Initialletter <> "" Then InitialASC = ASC(Mid(Dummylist2(i,1),1,1)) 'Initialletter exchange and with the rest put together Select Case InitialASC Case 192 To 198, 224 To 230 'À, Á, Ã, Ä, Å, Æ, à, á, â, ã, ä, å, æ Initialletter = "a" Case 199, 231 'Ç, ç Initialletter = "c" Case 200 To 203, 232 To 235 'È, É, Ê, Ë, è, é, ê, ë Initialletter = "e" Case 204 To 207, 236 To 239 'Ì, Í, Î, Ï, ì, í, î, ï Initialletter = "i" Case 208, 240 'Ð Initialletter = "d" Case 209 , 241 'Ñ Initialletter = "n" Case 210 To 214, 242 To 246 'Ò, Ó, Ô, Õ, Ö, ö, ò, ó, ô, õ, ö Initialletter = "o" Case 217 To 220, 249 To 252 'Ù, Ú, Û, Ü, ù, ú, û, ü Initialletter = "u" Case 221, 253 'Ý, ý Initialletter = "y" Case Else Initialletter = LCase(Mid(Dummylist2(i,1),1,1)) End Select Else Initialletter = "zzz" & Dummylist2(i,1) End If Initialletter = Initialletter & Mid(Dummylist2(i,1),2,len(Dummylist2(i,1)) Dummylist2(i,0) = Initialletter Next i = UBound(Dummylist2()) For s = 1 To i - 1 For t = 0 To i-s If Dummylist2(t,0) > Dummylist2(t+1,0) Then For k = 0 To dimension+1 DisplayDummy = Dummylist2(t,k) Dummylist2(t,k) = Dummylist2(t+1,k) Dummylist2(t+1,k) = DisplayDummy Next k End If Next t Next s If dimension > 0 Then Dim SetNr As Integer For i = 0 To UBound(Dummylist2()) SetNr = Dummylist2(i,2) For s = 0 To dimension Dummylist2(i,s) = SortList(SetNr,s) Next Next End If If dimension = 0 Then For i = 0 To UBound(Dummylist2()) Dummylist(i) = Dummylist2(i,1) Next BubbleSortList_2 = Dummylist() Else BubbleSortList_2 = Dummylist2() End If End Function
Sorry! The last rows be must: . . . If dimension = 0 Then For i = 0 To UBound(Dummylist2()) Dummylist(i) = Dummylist2(i,1) Next BubbleSortList_2 = Dummylist() Else ReDim Preserve DummyList2(UBound(SortList()),dimension) BubbleSortList_2 = DummyList2() End If End Function
Olaf: what about contributing directly on LibreOffice? :-) You may start here: https://wiki.documentfoundation.org/Development then propose a patch by following this link: https://wiki.documentfoundation.org/Development/gerrit ?
You wrote: "In Libre-Office Macros/Tools/Strings exists the macro "BubbleSortList".". Where did you find the BASIC code in LibreOffice?
Hello Olaf, Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided. (Please note that the attachment will be public, remove any sensitive information before attaching it. See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)
Dear Bug Submitter, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping-20170727
Dear Bug Submitter, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-20170830