Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OLEControlSite and complete menubar loss
OLEControlSite and complete menubar loss [message #530798] Sat, 01 May 2010 05:01 Go to next message
Craig Foote is currently offline Craig FooteFriend
Messages: 195
Registered: July 2009
Senior Member
We're using an OLEControlSite to embed MS Word in our RCP app as an
editor and becuase it's in an SWT package I assume this to be the best
place to post on a problem with it. Sorry for the length but it is
interesting so please bear with me :)

A while ago we upgraded to eclipse 3.5.1 and today a bug was discovered.
I'm wondering if it's a known bug and if it's been fixed in 3.5.2 or if
there's a workaround.

At times the RCP window's menubar gets removed - resizing or moving the
window I think triggers a redraw and the entire menubar is omitted. The
titlebar and toolbar render fine but there's no sign of the menubar.

Rather than work with the rather large editor, I created a simple
generic, no-function editor in which I can create an error condition to
duplicate the problem. If the EditorInput passed to the editor returns
null for #getName or #getToolTipText, the editor causes an Assertion
error (I think it's actually some workbench part that validates the
editor when opening it) that results in the menubar loss. This
vulnerability is not seen unless the #createPartControl instantiates an
OLEControl for MS Word, i.e. the Assertion error does not result in
menubar loss for an editor using other widgets. When using the
OLEControlSite, I see that somehow Word's menubar replaces the RCP one
while the OLEControlSite is active. I'm guessing that when the Assertion
error occurs, the RCP menubar has already been removed but the Word
menubar is unavailable for some reason and so nothing is drawn. The RCP
app has to be restarted to bring the menubar back.

To further complicate things, the real editor seems to always return
valid Strings for those methods so I don't know what exactly the problem
is with it - I just have to assume it is related as the result is the
same. I'm hoping if I get this one under control the real editor will
work.

I ran my EditorTest plugin in eclipse 3.4.x and the Assertion error
occurred but the RCP menubar remains. This leads me to believe this
vulnerability was introduced in 3.5.0 or 3.5.1. We do not have 3.5.2 on
our intranet yet to test if it has the flaw as well.

I'm not sure if it's pertinent but we're using MS Office 2003 SP3.

Has anyone else seen this behaviour? Do you agree it's an SWT
vulnerability or could we just not be using the OLEControlSite properly
(sorry I don't have code to attach right now)?

Interesting right? Any comments would be greatly appreciated because I'm
at a loss.

Craig
Re: OLEControlSite and complete menubar loss [message #530986 is a reply to message #530798] Mon, 03 May 2010 09:16 Go to previous message
Praveen  is currently offline Praveen Friend
Messages: 86
Registered: July 2009
Member
> Interesting right? Any comments would be greatly appreciated because I'm
> at a loss.

Very interesting Craig. However, if you can provide us the simple SWT
snippet to recreate this problem scenario, then it would be really
helpful for us to dig into the code causing problem. So, if possible,
provide us the SWT snippet, or the plug-in for recreating the scenario.
Also, if possible, verify the behavior on latest eclipse 3.6 build or
3.5.2. Thanks.
Previous Topic:how to catch home and end keys in SWT styledText
Next Topic:Is there something like treeitem.showCheckBox (boolean)
Goto Forum:
  


Current Time: Sat Nov 29 05:19:40 GMT 2014

Powered by FUDForum. Page generated in 0.10922 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software