Apache OpenOffice (AOO) Bugzilla – Issue 73311
Adding macros with icons to toolbar crashes Writer
Last modified: 2013-08-07 14:42:35 UTC
I have several macros I create and add to the standard toolbar. First, I record the macros by selecting text, changing the font color and saving. Macros are included towards the end of the email for reference. After recording the macros, I add them to the standard toolbar. I click the toolbar's customize button, select Customize Toolbar, scroll down to the end of the menu item list, and click Add. From the add menu, I choose OpenOffice.org Macros | My Macros | Standard | Module1 and then click each macro (blue, green, magenta, normal, red, yellow), adding each one to the toolbar. When done, you should see the macro names at the end of the standard toolbar. This all works fine, no crashes. I have some .bmp files that I had created a few years ago as icons for each of these macros. The name of the icon file is related to the name of the macro. I then use the Change Icon from the Customize Toolbar option to Import the bmp file and assign it to each macro toolbar item. This all appears to work fine. Now, restart OO. Immediately upon restarting it will crash. This happens consistently, although every now and then it will finally load. However if it does load, one (and only one) of the macro buttons is still showing the name instead of the button image. It always appears to be the middle item that doesn't get the icon attached correctly, regardless of the order of the icons or how I rearrange them. Here's my macros: sub blue rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = 255 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub sub green rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = 3394662 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub sub yellow rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = 13421568 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub sub red rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = 15425853 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub sub magenta rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = 16711935 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub sub normal rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Color" args1(0).Value = -1 dispatcher.executeDispatch(document, ".uno:Color", "", 0, args1()) end sub
I've attached the macro images to the issue.
Created attachment 42042 [details] macro icons that i attach to each macro toolbar item i create
mallarj, can't reproduce with OO 2.1 on Suse10.2. Please check if: 1. OO crashes if you add your icon for any of standard actions? 2. OO crashes if you have just one macro? Also please provide document with macro as the text you have provided contains some extra characters.
Created attachment 42049 [details] My ~/.openoffice.org2/user/basic/Standard/Module1.xba
1. Yes, I can reproduce it by using my icons for standard actions. I replaced the first six visible icons with my icons (bmp files). Then restarted Writer. It came up okay, but not all of the icons were replaced now (the other 5 were still replaced, but the 3rd was back to it's default icon). I tried to change the icon again, and oo crashed. Repeated restarts also crashed until I cleared the .openoffice.org2 dir again and restarted from scratch. 2. With just one macro with or without a custom icon, OO is fine, it doesn't crash. It only appears to crash with multiple macros with custom icons. 3. I've attached my macro file - sorry about the extra chars. If you need clearer info on how to reproduce, i'll be glad to write that up - i can get it to happen consistently.
I also tried using the same icon file for all 6 macros (same happens with standard toolbar items rather than macros). I changed the icon for 6 items (either standard or my added macros) to the same file, and restarted 00. The first 3 had my new icon, the 4th had the default icon (or none or macros) and the last 2 had the new icon. I tried to correct the 4th and it crashed 00 again. It doesn't appear to be tied to a given icon file either, i tried with all 6 different icons and got the same results.
I also tried using a png file instead of a bmp file and had the exact same results.
As a final test, I added my 6 macros and used standard icons instead of importing my own. Same results; after restarting OO, 4th didn't replaced, tried to fix it, OO crashed. FYI - I've done fresh installs of OO via the 2.1 RPMs several times today clearing out my .openoffice.org2 dir each time, that didn't seem to make a difference.
Created attachment 42050 [details] strace output of run when I tried to fix the icon that didn't replace and casued a crash
Reassigned to JSK.
Hi mallarj, im looking at the issue now. Thanks!
Confirmed. Used following approach: - install OOo 2.0 - Assign custom icons from attachment to macros from attachment -> Works ok - Updated (patched) to OOo 2.1 -> The office runs into a crash/recovery-loop and must be killed by force. Created spinoff issue for disappearing custom icons from the "Select Icon" palette (Issue 73354) Setting prio to 2 (Crash) and target to 2.2 which is open for discussion. This is a regression to 2.0 but in a rarely used area of the application. Need to check resources. Setting owner to CD, please reassign if necessary. Will try to reproduce on m199 full install.
cd: Started.
cd: Fixed. Wrong order of object destruction lead to this crash.
Wonderful! So - is this on track for 2.2 delivery then? Muchas gracias!
cd->jsk: Please verify my fix.
Verified with patched version (Linux, m124, en_US -> CWS fwk59)
You are working on this day by day ... Is it ok in OOFm5? Please close then ;-)
closed because fix available in OOFm6
*** Issue 74192 has been marked as a duplicate of this issue. ***