Apache OpenOffice (AOO) Bugzilla – Issue 72811
C# CloseVetoException problem
Last modified: 2013-02-24 21:09:50 UTC
Hi! I'm having trouble making OO close document using uno from C# (MS.NET). After call to XCloseable xClose = (XCloseable)xTextDocument; xClose.close(true); Exception is raised in unoidl.com.sun.star.uno.Exception unoidl.com.sun.star.util.CloseVetoException: Controller disagree ... Server stack trace: Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at unoidl.com.sun.star.util.XCloseable.close(Boolean DeliverOwnership) What I'm doing is the following open existing document write to it print it try to close it But the document wont close and it raises this exception. Maybe this is not a bug, but I'm just doing in the wrong way. This is exactly what I'm doing xLocalContext = uno.util.Bootstrap.bootstrap(); xRemoteFactory = (unoidl.com.sun.star.lang.XMultiServiceFactory)xLocalContext.getServiceManager(); aLoader = (XComponentLoader)xRemoteFactory.createInstance("com.sun.star.frame.Desktop"); xComponent = aLoader.loadComponentFromURL("file:///" + fajl, "_blank", 0, new unoidl.com.sun.star.beans.PropertyValue[0]); xTextDocument = (unoidl.com.sun.star.text.XTextDocument)xComponent; ... some edditing ... XCloseable xClose = (XCloseable)xTextDocument; xClose.close(true);
That is no bug. You have either to use a XPrintJobListener or print with the PrintOption Wait=true to force a synchronous call. See teh appropriate IDL docu and/or the DevGuide
closed