incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drew <d...@baseanswers.com>
Subject Re: Issue 119292: Forms do not open in saved view
Date Sat, 28 Apr 2012 21:48:15 GMT
On Sat, 2012-04-28 at 15:06 -0400, drew wrote:
> On Sat, 2012-04-28 at 14:57 +0200, Raphael Bircher wrote:
> > Am 28.04.12 12:58, schrieb Regina Henschel:
> > > Hi all,
> > >
> > > please have a look at
> > > https://issues.apache.org/ooo/show_bug.cgi?id=119292.
> > This issue was discused. Because there is a very easy workaround and we
> > allready started the vote we desided that this is not a showstoper for
> > 3.4 But yes, the bug is not nice.
> > 
> > Workaround
> > 
> > Open Wiriter befor Base
> > Switch to the Web layout
> > Forms open in the Web Layout for the session
> 
> Reading this email now and thinking that one should also be able to give
> the submitter a small basic macro that would execute the workaround, can
> be called when the ODB is opened that or actually maybe it would only
> need calling on when the office session starts, I'll try both. 
> 
> Will attach it to the issue ASAP.

or...

Ok - seems setting this property via the API, against a Writer document
during Application Start[1], doesn't trigger the automagical response we
are looking for.

For sure you can fix the problem by calling a procedure such as:

sub fixBaseForm
	ThisComponent.CurrentController.ViewSettings.setPropertyValue( "ShowOnlineLayout", True )
end sub

using the "Tools>Customize>Open Document" event on an individual forms,
that's a pain - first you need to set all your forms, then you need to
enable macros, but it certainly works.

I could actually put a couple of checks in that procedure making it
suitable for use from the "Open Component" event at the desktop level.
(check that it is an embedded base form that is opening), then you
wouldn't need to change forms nor enable macros for documents.

I'm going go eat and after I'll see about doing that last bit, and
that's what I'll post to the issue.

//drew

[1]
sub fixBaseForms
	Dim oVal(0) As New com.sun.star.beans.PropertyValue
	Dim oDoc     
    oVal(0).Name = "Hidden"
    oVal(0).Value = True

	' open a writer window
	oDoc = StarDesktop.loadComponentFromURL("private:factory/swriter","_blank",0,oVal())

	' switch to web view
	oDoc.CurrentController.ViewSettings.setPropertyValue( "ShowOnlineLayout", True )

	' close writer window
	oDoc.close(true) 
   	
end sub

> 
> //drew
> 
> 



Mime
View raw message