Issue 73311 - Adding macros with icons to toolbar crashes Writer
Summary: Adding macros with icons to toolbar crashes Writer
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: configuration (show other issues)
Version: OOo 2.1
Hardware: PC Linux, all
: P2 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sw
URL:
Keywords:
: 74192 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-01-09 16:33 UTC by mallarj
Modified: 2013-08-07 14:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
macro icons that i attach to each macro toolbar item i create (20.00 KB, application/x-tar)
2007-01-09 16:37 UTC, mallarj
no flags Details
My ~/.openoffice.org2/user/basic/Standard/Module1.xba (4.25 KB, text/plain)
2007-01-09 22:43 UTC, mallarj
no flags Details
strace output of run when I tried to fix the icon that didn't replace and casued a crash (29.06 KB, text/plain)
2007-01-09 23:13 UTC, mallarj
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mallarj 2007-01-09 16:33:30 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
Comment 1 mallarj 2007-01-09 16:35:27 UTC
I've attached the macro images to the issue.
Comment 2 mallarj 2007-01-09 16:37:09 UTC
Created attachment 42042 [details]
macro icons that i attach to each macro toolbar item i create
Comment 3 kpalagin 2007-01-09 19:59:34 UTC
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. 
Comment 4 mallarj 2007-01-09 22:43:33 UTC
Created attachment 42049 [details]
My ~/.openoffice.org2/user/basic/Standard/Module1.xba
Comment 5 mallarj 2007-01-09 22:45:20 UTC
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.
Comment 6 mallarj 2007-01-09 22:54:21 UTC
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.
Comment 7 mallarj 2007-01-09 22:56:48 UTC
I also tried using a png file instead of a bmp file and had the exact same results.
Comment 8 mallarj 2007-01-09 22:59:33 UTC
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.
Comment 9 mallarj 2007-01-09 23:13:45 UTC
Created attachment 42050 [details]
strace output of run when I tried to fix the icon that didn't replace and casued a crash
Comment 10 michael.ruess 2007-01-10 11:21:58 UTC
Reassigned to JSK.
Comment 11 joerg.skottke 2007-01-11 07:02:20 UTC
Hi mallarj,

im looking at the issue now. Thanks!
Comment 12 joerg.skottke 2007-01-11 08:26:42 UTC
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.
Comment 13 carsten.driesner 2007-01-11 09:24:01 UTC
cd: Started.
Comment 14 carsten.driesner 2007-01-12 08:42:53 UTC
cd: Fixed. Wrong order of object destruction lead to this crash.
Comment 15 mallarj 2007-01-12 17:11:38 UTC
Wonderful!  So - is this on track for 2.2 delivery then?  Muchas gracias!
Comment 16 mikhail.voytenko 2007-01-15 14:29:59 UTC
cd->jsk: Please verify my fix.
Comment 17 joerg.skottke 2007-01-19 09:34:20 UTC
Verified with patched version (Linux, m124, en_US -> CWS fwk59)
Comment 18 joerg.skottke 2007-02-02 10:04:21 UTC
You are working on this day by day ...

Is it ok in OOFm5? Please close then ;-)
Comment 19 oc 2007-02-07 15:33:07 UTC
closed because fix available in OOFm6
Comment 20 frank 2007-03-19 15:49:22 UTC
*** Issue 74192 has been marked as a duplicate of this issue. ***