Issue 85272 - XML import crashes when using a template for import
Summary: XML import crashes when using a template for import
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Code
Component: external filters (show other issues)
Version: OOo 2.1
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 3.2
Assignee: svante.schubert
QA Contact: issues@xml
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2008-01-15 19:52 UTC by htgoebel
Modified: 2009-09-11 10:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
XML importfilter "Freemind 0.7 as Presentation" (9.94 KB, application/octet-stream)
2008-01-15 19:53 UTC, htgoebel
no flags Details
sample input file (802 bytes, text/xml)
2008-01-15 19:55 UTC, htgoebel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description htgoebel 2008-01-15 19:52:24 UTC
When using a template for importing XML as Impress presentation (.odp), Impress
crashes. Even if the xslt is proofen to be okay. When using the same filter,
same imput-file, but no template, Impress imports the file.

Reproduce:
A) crash
   - install the attached xml-filter-bug.jar as a XML import filter
     This will give you an "Freemind 0.7 as Presentation" importer
   - test this filter using the attached mindmap-mini.mm
   -> ooo crashes
B) no crash
   - Remove the "Template for import" from "Freemind 0.7 as Presentation"
   - test this filter using the attached mindmap-mini.mm
   -> no crash, file get imported

So same input-file, same filter. Using with template crashes, using wothiut
template works (but does not have the template ;-[
Comment 1 htgoebel 2008-01-15 19:53:44 UTC
Created attachment 50886 [details]
XML importfilter "Freemind 0.7 as Presentation"
Comment 2 htgoebel 2008-01-15 19:55:05 UTC
Created attachment 50887 [details]
sample input file
Comment 3 jogi 2008-06-24 12:58:45 UTC
confirming the crash in DEV300m17 also on Solaris SPARC; It is not regression
because it crashes also in the SRC680 build.
Comment 4 svante.schubert 2008-06-24 13:53:22 UTC
sus->mba: 
Could you please test this scenario in your m20 CWS as discussed?
Thanks in advance,
Svante
Comment 5 Mathias_Bauer 2008-06-25 09:10:34 UTC
The crash happens because the Impress document does not support the XStyleLoader
interface.

Christian, is this a bug or intended behavior? Without a support for this
Impress xslt filters can't use templates.

Here's the code in xmlfilteradaptor:

Reference< XNameAccess >xName;
if(xstylefamiliessupplier.is())
    xName=xstylefamiliessupplier->getStyleFamilies();
 
Reference< XStyleLoader > xstyleLoader 
    (xstylefamiliessupplier->getStyleFamilies(), UNO_QUERY);
		 
if(xstyleLoader.is())
    xName=xstylefamiliessupplier->getStyleFamilies();

xStyleLoader is NULL.

Svante, whatever Christian's answer will be: the filter code shouldn't crash in
that case. While xStyleLoader is checked for being NULL in the code above it is
used uncoditional below that:

Sequence < OUString > elementNames = xName->getElementNames();
Sequence<com::sun::star::beans::PropertyValue> 
    pValue=xstyleLoader->getStyleLoaderOptions();

and in

xstyleLoader->loadStylesFromURL(msTemplateName,pValue);

So this needs to be fixed in the filter anyway.
Comment 6 svante.schubert 2008-06-25 14:21:55 UTC
SUS->MBA: Thanks for your help, I will take care of this!
Comment 7 svante.schubert 2008-06-27 14:57:32 UTC
Here is the docu for the interface:
http://api.openoffice.org/docs/common/ref/com/sun/star/style/XStyleLoader.html

As discussed with CL, I will fix the crash and write CL a follow up
enhancement/issue/task..

Svante
Comment 8 svante.schubert 2009-01-19 15:41:12 UTC
Fixed the crash in XSLTFILTER12
Comment 9 svante.schubert 2009-02-02 15:39:13 UTC
As my daughter was born three days earlier than expected, I have to postpone
this CWS to the next OOo release. I will be in a parental absence till mid of March.

Sorry for the delay.
Svante
Comment 10 svante.schubert 2009-09-11 10:54:12 UTC
Closed as integrated in DEV300m55