hi marten,
On 25/11/2008 23:31, Marten Feldtmann wrote:
The following code is in one of my source files and executing this code
has a pretty good chance to hang my C# software and the OpenOffice
counterpart.
The systems hangs at line "docuProperties.Title = ..." or
"docuProperties.Subject = ..."
Sometimes this code works, but around 40% (or 30% ?) this code fails to
work. I've used the Subject and Title field in the template ott I open
with my software and then I fill the docu properties ..
Done in VS2008, .NET 3.5, OpenOffice 3.0 and Windows XP-SP3.
Marten Feldtmann
/// <summary>
/// Setze Thema und Titel des Dokumentes, damit dieses im
Dokument über Felder genutzt werden kann
/// </summary>
/// <param name="textDocument"></param>
/// <param name="titleString"></param>
/// <param name="themaString"></param>
private void SetTitleAndThema(XTextDocument textDocument,
string titleString, string themaString)
{
XDocumentPropertiesSupplier propSupp = textDocument as
XDocumentPropertiesSupplier;
if (propSupp != null)
{
XDocumentProperties docuProperties =
propSupp.getDocumentProperties();
docuProperties.Title = titleString;
docuProperties.Subject = themaString;
}
else
{
if (Debugger.IsAttached)
Debugger.Break();
}
}
in OOo 3.0, there is unfortunately a deadlock in the (new) implementation
of DocumentProperties service. i guess that would be the problem you hit
here. the issue number is 93514.
the fix is integrated in the following milestones: OOO300/m12, DEV300/m36
the fix will be shipped with OOo 3.0.1.
please try whether your program works with one of the above builds, and
let me know if that works for you.
if this is indeed the cause for your problem, then the symptoms are as you
described: ooo is completely stuck, as well as the thread in the foreign
code that called into UNO, and the only thing you can do is kill it.
(actually, it surprises you that this deadlock should occur in 30% of
calls; it has lurked in OOo for 4 months before someone noticed)
regards,
michael (who will be more careful when writing notifiers in the future :)
--
"I like verbing words. Verbing weirds language." -- Calvin, to Hobbes
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]