- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个小应用程序,它在 OOo Writer 中生成三个不同的模板文档。单击三个“生成”按钮之一时,这是执行的代码的一部分(在 C# 中):
// Connect to OOo
if (componentContext == null)
componentContext = uno.util.Bootstrap.bootstrap();
XMultiServiceFactory multiServiceFactory =
(XMultiServiceFactory) componentContext.getServiceManager();
XComponentLoader loader = (XComponentLoader)
multiServiceFactory.createInstance
("com.sun.star.frame.Desktop");
// Initialize class members document, text, and cursor
document = (XTextDocument) loader.loadComponentFromURL
("private:factory/swriter", "_blank", 0,
new PropertyValue[0]);
text = document.getText();
cursor = text.createTextCursor();
以下步骤会导致崩溃:
抛出此异常:
unoidl.com.sun.star.lang.DisposedException: URP-Bridge: disposed(tid=4) Unexpected connection closure
在尝试生成另一个图表之前,如何检查以确保连接仍然打开?如果它已关闭,我该如何重新连接?
编辑:更具体地说,这是完整的错误消息:
Marshaling clicked signal
Exception in Gtk# callback delegate
Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> unoidl.com.sun.star.lang.DisposedException: URP-Bridge: disposed(tid=4) Unexpected connection closure
at com.sun.star.bridges.mono_uno.UnoInterfaceProxy.ConstructReturnMessage (Any result, System.Object[] args, uno.Typelib.InterfaceMethodTypeDescription* methodTD, IMethodCallMessage callmsg, Any exception) [0x00000]
at com.sun.star.bridges.mono_uno.UnoInterfaceProxy.Invoke (IMessage request) [0x00000]
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000]
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000]
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000]
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000]
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000]
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000]
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000]
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000]
at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at TestDrive.MainClass.Main(System.String[] args) in /home/matthew/Dropbox/OpenSBS-mono/TestDrive/Main.cs:line 28
The application was terminated by a signal: SIGHUP
如果我去掉 if (componentContext == null)
这行(即,总是尝试连接,即使我们已经连接),我会得到一个堆栈跟踪和这条消息:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
最佳答案
这只是一个猜测。你可以使用 XComponent.addEventListener并收听 disposing事件。
例如:
class App : XEventListener
{
private XComponentLoader m_loader;
private XComponentLoader Loader
{
get
{
if (m_loader == null)
{
m_loader = (XComponentLoader)multiServiceFactory.createInstance("com.sun.star.frame.Desktop");
XComponent comp = (XComponent)m_loader;
comp.addEventListener(this);
}
return m_loader;
}
}
private void disposing(EventObject Source)
{
m_loader = null;
}
}
关于c# - 在 OpenOffice 中,如何检查我的 XComponentContext 是否已关闭?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1697667/
我想在我的 OpenOffice writer-document 中放置一个“签名字段”。 我需要 iOS/gPlay 应用程序 "PDF Forms"在触摸屏上签署 PDF 文档(手写/笔)。 根据
我已经以动态填充的Libre / OpenOffice Base形式获得了表控件。 我想更改其高度以匹配行数。 怎么做? 我已经尝试更改getSize() / setSize()和height属性,但
我在 Calc 电子表格中有几个数据列,每个列有 400 到 500 个条目。对于这些列中的每一列,我只想简单地找到均值和标准差,但不知道如何进行。 有人可以用简单而非技术性的语言逐步指导我如何做到这
我有两列有数字。当另一个有重复时,另一个只有一次数字。这些列中的数字不匹配。我需要在 B 列中找到在 A 列中匹配的所有数字。 这可能更好地解释了它: 甲乙 1 2 2 2 4 5 6 5 7 6 8
我想为 Calc 编写一个返回 #VALUE 的 Basic 函数!可使用 ISERR() 进行测试。 Function foo() foo = #VALUE! End Function 但是
我知道 OpenOffice.org 中的风格 .... 但 我想要与 HTML 样式相同的内联样式, 喜欢 (类似的东西)......这可能吗? 如果你知道这样的例子或文章,请引用我。 最佳答案
我正在尝试将 openOffice 作为 CentOS(非图形)服务器上的服务启动。 soffice -headless -nologo -nofirststartwizard -accept="so
有没有办法像在其他语言中一样在 OpenOffice Basic 中继续循环? For i = 0 To 10 If i = 5 Then Continue For # Not work
我正在尝试使用 OpenOffice 在 WinXP MSVC 2008.NET 上编写一个简单的“Hello World”窗口3.0 API和SDK。 这篇文章对于初学者来说很重要... http:
基本上,我希望 LibreOffice Calc 做我告诉它的,而不是它想要的。 例如: 当我输入 1.1.12 时,我想在那个单元格中有 1.1.12,而不是 01.01.2012 或其他什么。 当
让我们看看这个例子: 我有 HTML 标记的文本: Example text 我有 *.odt(OpenDocument 文本)文档,我想在其中放置此 HTML 文本,其格式取决于 HTML 标签(在
有没有什么方法可以在 linux 上将 odt 文档转换为 doc 或 rtf 而不使用 openoffice 或任何依赖于安装 openoffice 的库? 最佳答案 OpenOffice.org
我想过滤掉特定列上具有特定颜色的行。我尝试几乎到处搜索但找不到答案。希望大家给点好的建议,谢谢。 最佳答案 据我所知,目前没有内置函数允许根据单元格的格式选择单元格。但在 this OOo forum
我需要使用 OpenOffice Java API 复制文档部分并将其粘贴到另一个文档部分。到目前为止,我已经设法复制源文档部分的文本并将其粘贴到目标文档的部分(参见下面的示例)。 但是,问题是非文本
我有一个小问题,我需要计算控制台内的字数才能阅读 doc、docx、pptx、ppt、xls、xlsx、odt、pdf ......所以不要建议我 | wc -w 或 grep 因为它们只适用于文本或
是否可以将单元格的内容放在公式中。我所说的公式是指数学公式编辑器(插入-> 对象-> 公式)。 最佳答案 据我所知,无法从公式中引用单元格。数学公式编辑器对 OO Calc 一无所知。但是,您可以在需
在第一张原始数据和第二张修改数据中,如果 sheet1 和 sheet2 数据不匹配,我想比较两个工作表数据并用颜色标记。 我有两个不同的工作表,数据如下。 工作表 1: --------A-----
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 5年前关闭。 Improve thi
我编辑了一个来自客户的文档,其中有一些亮点,然后决定删除评论中的亮点。 无论出于何种原因,该文档突出显示了许多项目符号和编号列表部分,当我尝试选择整个文档并将突出显示更改为“无填充”时,我无法还原这些
我是 Calc 的新手,但我是 Excel 的老手。不幸的是,我没有后者。我正在尝试使用我需要使用的数据创建一个新的单元格,如下所示 AF Afghanistan AL Albania D
我是一名优秀的程序员,十分优秀!