Regression in isHidden-Property of Frames

Michael Meeks michael.meeks at suse.com
Thu Sep 6 12:28:35 PDT 2012


Hi Andor,

On Wed, 2012-08-29 at 12:50 +0000, Andor E wrote:
> We're currently in the process of switching from OpenOffice.org 3.2.1
> to LibreOffice. As a part of this, we're testing our extension WollMux
> (www.wollmux.org) with LO.

	Great news :-)

> During these tests we found a change in the behaviour of the
> isHidden-Property of frames.

	That's annoying, sorry about that.

> We're using a com.sun.star.document.XEventListener to listen to the
> onViewCreated-Event. We then test, if the document is visible, and
> only then WollMux will process the document.
> In OOo 3.2.1 a new document created with File/New would have isHidden
> == false. In LO the document now returns isHidden == true.

	Odd indeed. Can you be more specific ?

> I have searched in the sources of LO and found a change in
> ./framework/source/services/frame.cxx. This was introduced with the
> commit 	74ffe76476d5b8941454a2acce569737237fc1d7.

	Interesting; that's a change we inherited around Frank's autorecovery
re-write.

> I believe that this change is wrong and should be reverted. Before the
> change isHidden represented the intended state of a frame. A document
> that was openened hidden, returned hidden. A document opened visible
> returned not hidden. Now it will always return isHidden == true. If
> this isn't changed back,  there needs to be another property to check
> the intended visibilty.

	Interesting - it merits deeper investigation - thanks so much for
getting down to the commit that caused the issue. I suppose it's
necessary to poke with and read the auto-recovery code to see why that
was done. Adding a new property on the frame to return a more helpful
setting is certainly possible; I wonder if that is already there via
some other interface.

	I suspect that if you use:

        virtual css::uno::Reference< css::awt::XWindow >  SAL_CALL getContainerWindow ();

	on the XFrame interface - then you have an XWindow interface to the
top-level window on which you can interrogate a visibility property of
some sort something like:

	awt::XWindow xFoo = xFrame->getContainerWindow();
	bool bVisible = xFoo->isVisible();

	Of course perhaps that is not what you want ? :-) but if you want to
see if the window is actually visible on the screen, that -might- do
what you want (untested but sniffing around there might help).

	HTH,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list