Freitag, 20. März 2015

This crazy dialogs

Ok next thing i looked into where the crashing dialogs. Because i had font selecting system on my todo list for my other project i decided to look into the crash when the Font Dialog is opend.
For a short period of time you can see a Window with some drawn white rectangels so it looks like the Windows crashes right when its constructed.
Diving a little bit into the code revealed that it crashed when abiword tried to update the font list.
Therefore it accessed the view which should countain this list via a find method.
Now the find method returned nothing but it was never checked. So i thought good.. easy to solve.. just check if the it found the right view and here we go...

I looked for ever FindView and made a "security" check if the View was found so that no segment fault could happen.
It turned out.... it was not enought.
Still crashing :(

So i researched more. I tried to find the Place where all the Views where construckted. To my suprise there was no code at all wich created this FontDialog. even searching throught the whoel abiword source didnt showed a sign of creating such a Dialog.
I already thought maybe it wasnt implemented at all.. but something was shown before the fontdialog crashed abiword.
So i went back to the source.. was very surprised to find out that the window and BView where constructed over a BMessageobject wicht was tacken from the ressources of the abiword programm.

That was really suprising and verry unusal. I have nervers seen such a use of ressources and such a way to construkt and save Dialogs.
So i found out that its not only the Font dialog which is "constructed" this way but also some other dialogs:

As you can see on your own it is was widely uses in the Abiwordport for beos :(

  1. DateTime.rsrc
  2. Tabs.rsrc
  3. break.rsrc
  4. columns.rsrc
  5. field.rsrc
  6. find.rsrc
  7. font.rsrc
  8. goto.rsrc
  9. icons.rsrc
  10. list.rsrc
  11. options.rsrc
  12. pagenum.rsrc
  13. paragraph.rsrc
  14. replace.rsrc
  15. spell.rsrc
  16. wordcount.rsrc
  17. zoom.rsrc
Some are working and some not.. so  i need to investigate this a little more.
Thanks to the help of stippi i will be able to do so... but i think this will be part a other blogpost :)
But later or sooner we need to rewrite the dialogs anyway to use Layoutcode from Haiku.

Keine Kommentare:

Kommentar veröffentlichen