<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - No html or txt file is created in UTF8 after convert (soffice --convert-to "html:XHTML Writer File UTF8" file.ods)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=108402#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - No html or txt file is created in UTF8 after convert (soffice --convert-to "html:XHTML Writer File UTF8" file.ods)"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=108402">bug 108402</a>
from <span class="vcard"><a class="email" href="mailto:serval2412@yahoo.fr" title="Julien Nabet <serval2412@yahoo.fr>"> <span class="fn">Julien Nabet</span></a>
</span></b>
<pre>On pc Debian x86-64 with master sources updated some days ago, I could still
reproduce this.
The pb is here:
513 SwDoc* SwXMLExport::getDoc()
514 {
515 if( m_pDoc != nullptr )
516 return m_pDoc;
517 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
xTextDoc is emptyRef here because GetModel() retrieves mxModel which is
"uno::Reference to (ScModelObj *)" (expected since we got a Calc file)
With this patch:
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 8a7da0693df1..420e5974011e 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -515,6 +515,9 @@ SwDoc* SwXMLExport::getDoc()
if( m_pDoc != nullptr )
return m_pDoc;
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
+ if (!xTextDoc)
+ throw css::uno::RuntimeException("Problem of mismatching filter for
export.");
+
Reference < XText > xText = xTextDoc->getText();
Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
assert( xTextTunnel.is());
I got:
warn:xmloff:19932:19932:xmloff/source/core/xmlerror.cxx:170: An error or a
warning has occurred during XML import/export!
Error-Id: 0x60040004
Flags: 6 ERROR SEVERE
Class: 4 API
Number: 4
Parameters:
Exception-Message: com.sun.star.uno.RuntimeException: "Problem of mismatching
filter for export."
Would it be ok?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>