[Libreoffice-bugs] [Bug 108402] No html or txt file is created in UTF8 after convert (soffice --convert-to "html:XHTML Writer File UTF8" file.ods)

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jul 23 15:15:54 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=108402

--- Comment #7 from Julien Nabet <serval2412 at yahoo.fr> ---
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?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180723/b56a75ed/attachment.html>


More information about the Libreoffice-bugs mailing list