On 10/22/2010 09:14 PM, Frank Schönheit wrote:
Hi Mathias,

If controls shall be accessible to auto tests or help content, they now
will need to get a HID assigned explicitly, the auto-HID feature of the
resmgr is gone. That's the small price to pay for getting rid of the
ridiculous HID compilation process and all the problems related to the
use of hid.lst.

Which is the ugly part of the (otherwise great) change :-\

If the layout manager, and the XML based dialog format, will not come to
our code base soon (Christian??!), it might be worth thinking of another
change: replace resource IDs with strings. The advantage (besides
getting rid of those ugly .hrc files) would be that the resource
compiler could again generate auto-help-ids, e.g. from
   Dialog "MyCoolDialog"
   {
     PushButton "Apply"
     {
       ...
     }
   };
, it could generate something like
"org.openoffice.org://dialogs/<module>/MyCoolDialog" and
"org.openoffice.org://dialogs/<module>/MyCoolDialog/Apply" as help
IDs/URLs ...

I considered that, but it would have been an even heavier change. You won't believe it before you see it: resource IDs are used in calculations even more than help ids. But there are more "nice" use cases.

I found code that only works if a RID for a string and a slot id have the same offset to some base numbers. Sometimes RIDs have been used as identifiers in other APIs ("I need a numerical identifier - hey, we have the resource ID, how nice, let's use it!").

etc. etc.

Switching resource IDs would have postponed the cws changehid for another few months.

In the meantime I expect that the number of new dialogs or tab pages will be manageable. Adding HIDs by a script is a small price, IMHO. Even manual adding of HIDs takes only a few minutes as a one-time operation (how many new dialogs do you write per week?).

Well, yes, having an XML-based resource format, where resource elemtns
have string identifiers, too, would remove the need for such a change to
the resource compiler ...

Yes, I think that this is the right way to go. For the existing src files the removal of auto-HIDs isn't a problem, all files have been converted already. Implementing a new resource format and using it for new UI probably won't take longer than switching the existing code base to string based resource IDs.

Regards,
Mathias

--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Oracle: http://blogs.sun.com/GullFOSS
Please don't reply to "[email protected]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to