[PATCH] [WIP] fdo#45747 - [EasyHack] remove the limitation to 3 sort entries in calc

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Mar 14 20:27:24 PDT 2012


Hello Albert,

2012/3/15 Albert Thuswaldner <albert.thuswaldner at gmail.com>:
> Hi Markus,
> So I have hacked on this a bit, progress has been slow, detours and so
> on. Anyhow, I think have now completed the step 1, i.e changed the
> underlying code removing the static limit. I've have tried to keep
> much of the old structure for now, probably do a re-factoring once all
> bits are in place.
>
> To test this I have temporarily inserted a fourth sort key to check
> that it all works as expected.
>
> For part 2 the UI bits, I (ironically) thought of using Robert's work
> on "unlimited number of conditions for conditional formatting"[1]
> as kind of a "cheat-sheet" for my own implementation.

My idea was to reuse my rework of the conditional format fialog but
the current mock-up is not usable for the sort dialog.

>
> Then, yesterday I saw your comment [2], which on a closer thought I
> can agree on.
>
> The question is what to do instead? I'm kind of stuck in the "old"
> thinking to use the scroll offset to alter the widgets in-place. Could
> you give me any pointers?
> Has anything similar been made somewhere else in LO, that I could "copy"?  :)

I have a simple idea that shouldn't be too complex to implement. I
think we can agree that only the sort entries are the difficult part.
I would create a control for an entry an instantiate this one for each
new sort entry. I think we do similar things for several other
dialogs, e.g. SvTabListBox with simple entries or the document
properties dialog with more complex entries.

>
> I've attached a patch of the work done so far, If you have the time to
> quickly review it, I would appreciate that. As I said I probably will
> reorganize the code once the all the bits are in place, and make it
> more elegant in places.

Just two small comments. I think it would be a good idea to group the
three entries in ScSortParam into a own struct so that we only need
one vector. That will make it easier to keep the entries in sync.
And you have a lot of whitespace changes. Can you check your editor
why it replaces so many spaces with tabs. It is quite difficult to
review it otherwise.

>
> BTW: I have a Patch that partly fixes fdo#43937, but I guess since it
> needs a greater overhaul anyway,  that's of no interest?

Sure it is. If it is simple and safe we can of course use it for 3-5
and until it is fixed in master there too.

Thanks for your great work.

Markus


More information about the LibreOffice mailing list