Hello Albert, Sorry that it took me a bit to review your patch but my master trees are totally screwed for my own feature. I now checked your patch and solved the conflicts that were related to my last fix for sort dialogs. Attached you'll find a patch that applies cleanly on master. I checked the dialog and it looks like we need to move some items a bit. 2012/5/14 Albert Thuswaldner <albert.thuswaldner@gmail.com>:
1.) Compile time waring about resources ids. There is probably a simple fix for this, I think I understand the problem but not what to do about it. f4099: "/home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src", line 60: Warning in the object (Type: ListBox, 15): Global resources should have an identifier >= 256. Pos = MAP_APPFONT ( 172 , 11 ) ; ^ f4099: "/home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src", line 68: Warning in the object (Type: RadioButton, 16): Global resources should have an identifier >= 256. Pos = MAP_APPFONT ( 172 , 25 ) ; ^ f4099: "/home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src", line 75: Warning in the object (Type: RadioButton, 17): Global resources should have an identifier >= 256. Pos = MAP_APPFONT ( 6 , 0 ) ; ^ f4099: "/home/thuswa/work/libo2/sc/source/ui/src/sortdlg.src", line 82: Warning in the object (Type: FixedLine, 14): Global resources should have an identifier >= 256. [ build DEP ] SRS:sc/res
This one is quite simple. we need to move the identifiers out of the 0 to 255 range. Andras, do you have an idea what range is useable in sc for this? I think most of the 256 to 999 range is already used but I have no idea where to check this.
2.) to return a pointer to the vector containing the ui widgets is of course not ideal, see below: ScSortKeyItems* ScSortKeyWindow::AddSortKey( sal_uInt16 nItem ) ScSortKeyItems* ScSortKeyCtrl::AddSortKey( sal_uInt16 nItem ) Instead I probably should create a reference when I initialize ScSortKeyCtrl and ScSortKeyWindow, but I'm not exactly sure how to do this.
I've attached a simple patch showing how to do this. The patch will not compile but shows already the basic ideas. The idea is to move the ScSortKeyItems variable into tpsort and only pass a reference. I think a good final step is to use a boost::ptr_vector which will control the lifetime of the contained objects. Regards, Markus
Attachment:
0001-fdo-45747-remove-the-limitation-to-3-sort-entries-in.patch
Description: Binary data
Attachment:
0001-how-to-add-ScSortKeyItems-as-reference.patch
Description: Binary data
Attachment:
sort dialog.png
Description: PNG image