Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Hello,

Giving a try to tdf#92720, I retrieved a bt which shows a pb with
XML_NAMESPACE_LO_EXT
Indeed when search XML_P ("p" element), we don't find it in
SvXMLNamespaceMap::GetQNameByKey (see
http://opengrok.libreoffice.org/xref/core/xmloff/source/core/nmspmap.cxx#238)
because aNameMap doesn't contain XML_NAMESPACE_LO_EXT.

Searching a bit, I noticed that in xmloff/source/core/xmlexp.cxx, this
namespace was added only if :

getExportFlags() &
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)
(see
http://opengrok.libreoffice.org/xref/core/xmloff/source/core/xmlexp.cxx#340)
+
getDefaultVersion() > SvtSaveOptions::ODFVER_012
(see
http://opengrok.libreoffice.org/xref/core/xmloff/source/core/xmlexp.cxx#355)
If I move out the second if from the first if, I got no crash but a Java
stack trace with Pentaho complaining it doesn't know XML_NAMESPACE_LO_EXT

So finally, I thought about this patch to workaround this and prevent from
the crash:
diff --git a/xmloff/source/text/txtparae.cxx
b/xmloff/source/text/txtparae.cxx
index f7f0a8f..1c42df5 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1910,7 +1910,7 @@ bool
XMLTextParagraphExport::exportTextContentEnumeration(
 void XMLTextParagraphExport::exportParagraph(
         const Reference < XTextContent > & rTextContent,
         bool bAutoStyles, bool bIsProgress, bool bExportParagraph,
-        MultiPropertySetHelper& rPropSetHelper, TextPNS eExtensionNS)
+        MultiPropertySetHelper& rPropSetHelper, TextPNS /* eExtensionNS */)
 {
     sal_Int16 nOutlineLevel = -1;
 
@@ -2156,7 +2156,7 @@ void XMLTextParagraphExport::exportParagraph(
         bool bPrevCharIsSpace = true;
         enum XMLTokenEnum eElem =
             0 < nOutlineLevel ? XML_H : XML_P;
-        SvXMLElementExport aElem( GetExport(), eExtensionNS ==
TextPNS::EXTENSION ? XML_NAMESPACE_LO_EXT : XML_NAMESPACE_TEXT, eElem,
+        SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, eElem,
                                   true, false );
         if( bHasContentEnum )
             bPrevCharIsSpace = !exportTextContentEnumeration(

(like
http://cgit.freedesktop.org/libreoffice/core/commit/?id=6acc6c011d3afd6834efeee1b2efe43652a86f2e
which introduced XML_NAMESPACE_LO_EXT - thanks to Matthew Francis for having
pinpointed it in bugtracker - in this part and which sometimes doesn't use
eExtensionNS parameter)

Any thoughts?

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/About-tdf-92720-Report-fails-to-open-with-Charts-in-a-Report-tp4159129.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.