Posts mit dem Label Bugs werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Bugs werden angezeigt. Alle Posts anzeigen

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.

Fixing the first bug :)

After reading a some github tutorials i felt kind of read for my first attemps to merge the beos code into my new created Abiword branch of the up to date source.
Thanks to the commandline attribute from  git called merg git merge -s ours i was able to mix in the beos code from 2.4 (dated back to 2006 - someone worked on this code in 2013 ... but noth too much) so this code is roughly 9 years old. The task is now to bring it toghether with the api wich changed a lot in the last 9 years.
My first strugle was and ist the build system. Abiword uses autoconf for building, an i am no fan of makefile or autconf so i didnt learnd a lot about them in the years i developed. I always prefferd a GUI :).
So next task is to learn this stuff .. also i dont like it, or maybe find someone who can help me.
Because this is a little frustrating - look into some  of the bugs.

To see why e.g. loading faild i startet to build Abiword with a simpel make compile_dbg
to build a debug version of the Abiword binaries.

Running Abiword and opening a file brought me straight to the debugger it turned out - a simple missing lock of of the Blooper was the cause. I just covererd the call wich triggered the Debugger into a a lock an a unlock statement and loading and saving is working now - Jear. :)

https://github.com/Paradoxianer/AbiWord/commit/5bad4ca6fd0092dc575ebb01796b78ce7b5a9fd5