Yes, Suse “Hackweek” ( where you can scratch an itch on work time ) has just been and gone. This time I wanted to work on and tackle an aspect of usability ( to do with cell styles in Calc ) that really pisses me off, e.g. when you have some cell style and you want to see what that style will look like you more or less have to apply the style. Ok, if you are really sadistic you could open the Styles dialog ( F11 ), select the style and edit it ( and they you can access format dialog which describes ( but still doesn’t really show ) all the individual elements of the style ). Excel ( in later versions at least ) does a wonderful job with this by allowing you to preview the style in-place, in other words when selecting a style whatever cells are currently selected get that style temporarily applied. Excel also does the same thing for Font selection.
First I actually decided to try and implement a simple Font preview, it’s not quite what I wanted but it seemed maybe a simpler version of what I wanted to achieve and would provide the basic knowledge to be able to tackle the styles. After far more effort that I thought I managed to get a quite passable implementation of the Font preview working despite some unexpected challenges ( e.g. the listbox implementation doesn’t easily allow you to know about the currently highlighted element in the listbox which required some poking around in vcl ) Anyway in the end and after a couple of days a much smaller patch ( that the effort would have suggested ) appeared. It’s even in master right now with this commit
Next I started tackling the Styles preview, things initially seemed to go well, the cell previewed at least all of the font related information from the selected element in the Style dialog and after realising I was missing things like Rotation etc. I managed to get that stuff working too. Then of course I noticed things like cell background or border attributes weren’t being displayed, it took me quite some time to figure out in the drawing layer where this was happening and ( I wont say understand ) but find where to modify the code to do this. At this point I ran out of time
A quick screencast shows what works currently. I really wish I had more time to tackle the style dialog itself ( or perhaps create a slimmed down version ) that would additionally in the control itself show some sort of preview of the style ( at least in terms of the font, background etc ) that could be shown on the toolbar. Also the existing dialog doesn’t track the mouse moves and highlight the element you hover over ( it’s not immediately obvious but the Styles dialog uses a Tree like widget ( although most of the time it displays like a listbox ) ) Another annoyance ( quite obvious in the screencast ) is the fact that the selection area is highlighted when previewing which has the irritating effect of changing the background colour.
The full set of patches ( based of libreoffice-4-0 ) for the hackweek work can be found here A squashed version is available here
Again note the Font preview part has been extracted from the above patches and already applied to master. There are still some issues with the CellStyle Preview that I would like to iron out before applying it.


The screenshot shows a MSO userform with some multiple levels of nested container controls, then the same useform imported in ‘vanilla’ openoffice and finally how it looks now in the cws. You should notice some other nice improvements that also are included in this cws e.g. the ’spinbutton’ is now imported ( unfortunately this cws does not make use of the spinbutton generally available for normal Openoffice.org Dialogs ) However this cws does enable controls in Openoffice Dialogs to now access embedded images ( note the image control from the MSO Userforms has an associated image, the filter has been modified to create embedded images on import and the Dialog controls now can handle embedded images ) Also some good news regarding the toolbar enhancements mentioned in the last
you’ll notice that of course we don’t actually import a menu on the toolbar, this is a pity and exposes a gap in Openoffice.org functionality. The best I can do at the moment is import the menu ( which in reality is just another toolbar ) as a separate toolbar. The basic toolbar, commands and associated images import well, builtin commands are not yet supported, unfortunately it would take quite some time to generate the appropriate translation between the Excel command-ids and the corrosponding ‘uno.xxxx’ commands. While I didn’t have time to do that I did spend some time debuging through the relevant code so I think if I can get some time I can close some of the obvious functionality gaps e.g.





