Issue 65317 - Files format is defected
Summary: Files format is defected
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.2
Hardware: PC Windows XP
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: needmoreinfo
Depends on:
Blocks:
 
Reported: 2006-05-12 08:48 UTC by starm
Modified: 2017-05-20 11:17 UTC (History)
1 user (show)

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


Attachments
Original file (12.45 KB, application/vnd.oasis.opendocument.text)
2006-05-17 13:50 UTC, starm
no flags Details
corrupted file after work (8.79 KB, application/vnd.oasis.opendocument.text)
2006-05-17 13:51 UTC, starm
no flags Details
document with macro to perform the mailmerge (8.20 KB, application/vnd.oasis.opendocument.text)
2006-05-22 08:54 UTC, stephan.wunderlich
no flags Details
document that contains the mailmerge fields (8.63 KB, application/vnd.oasis.opendocument.text)
2006-05-22 08:57 UTC, stephan.wunderlich
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description starm 2006-05-12 08:48:27 UTC
In different platform and OS (pc or server bi proc in windows XP or Linux) with
more than 1GB ram and proc > 3GHz, the same error became after many operations
on the same file. If I modified a files, for example change the textFields and
save the document, or if I run the mailmerge service, when I do a loop in this
little programs, original file is corrupt in many operations (2000 in windows
and 500 in Linux). OOo run a widget with an error who say that "style.xml or
content.xml can't be saved". After that, the document is corrupt and OOo is in
an error state.

Thanks.

Starm
Comment 1 stephan.wunderlich 2006-05-12 09:02:25 UTC
mmm ... looks more like a problem with the Writer than one with the UNO-API
Comment 2 michael.ruess 2006-05-12 10:04:12 UTC
Reassigned to ES.
Comment 3 eric.savary 2006-05-12 11:50:10 UTC
Please attach a sample document and give an exact step by step description of
what you modify in the document to reproduce this error.  
Comment 4 starm 2006-05-17 13:50:28 UTC
Created attachment 36541 [details]
Original file
Comment 5 starm 2006-05-17 13:51:18 UTC
Created attachment 36542 [details]
corrupted file after work
Comment 6 starm 2006-05-17 14:03:29 UTC
I open OOo connexion with a socket, if you want how I do this, go :
http://www.oooforum.org/forum/viewtopic.phtml?t=35602
First, I open the original document (odt), I change the properties of the fields
(databasename and datatablename), and I save it.
After, I call mailmerge service like this : 

Object mmservice = null;

        // Create an instance of the MailMerge service
        try
        {
            XMultiComponentFactory mxMCF = OOo.getMxMCF();
            XComponentContext xComponentContext = OOo.getMxComponentContext();
            mmservice =
mxMCF.createInstanceWithContext("com.sun.star.text.MailMerge", xComponentContext);
            if (mmservice == null)
            {
                FichierLog.ecrire("OOoFusion.realiserFusion", "mmservice null",
"I");
                throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"mmservice null", "fr");
            }
        }
        catch (Exception e)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " +
e.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0", "Exception -
" + e.getMessage(), "fr");
        }

        // Get the XPropertySet interface of the mmservice object
        XPropertySet oObjProps = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, mmservice);
        if (oObjProps == null)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "oObjProps null", "I");
            throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"oObjProps null", "fr");
        }

        try
        {
            // Set up the properties for the MailMerge command
            oObjProps.setPropertyValue("DataSourceName", mDataSourceName);

            oObjProps.setPropertyValue("Command", mTableName);

            oObjProps.setPropertyValue("CommandType", new
Integer(com.sun.star.sdb.CommandType.TABLE));

            oObjProps.setPropertyValue("OutputType", new Short((short) 2));

            oObjProps.setPropertyValue("DocumentURL", mFileURL);

            oObjProps.setPropertyValue("OutputURL", repEnvoi);

            oObjProps.setPropertyValue("FileNamePrefix", nomFichierEnvoi);

            oObjProps.setPropertyValue("ActiveConnection",cxDB.getXConnection());

            if (typeEnvoi.equalsIgnoreCase("pdf"))
            {
                // generation document au format pdf
                oObjProps.setPropertyValue("SaveFilter", "writer_pdf_Export");
            }
            else if (typeEnvoi.equalsIgnoreCase("doc"))
            {
                oObjProps.setPropertyValue("SaveFilter", "MS Word 97");
            }

            if (nbFichiersGeneres.equalsIgnoreCase("1"))
            {
                // generation d'un seul document
                oObjProps.setPropertyValue("SaveAsSingleFile", new Boolean(true));
            }
            else
            {
                oObjProps.setPropertyValue("SaveAsSingleFile", new Boolean(false));
            }

        }
        catch (UnknownPropertyException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"UnknownPropertyException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"UnknownPropertyException - " + e1.getMessage(), "fr");
        }
        catch (PropertyVetoException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "PropertyVetoException
- " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"PropertyVetoException - " + e1.getMessage(), "fr");
        }
        catch (IllegalArgumentException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"IllegalArgumentException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"IllegalArgumentException - " + e1.getMessage(), "fr");
        }
        catch (WrappedTargetException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"WrappedTargetException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"WrappedTargetException - " + e1.getMessage(), "fr");
        }

        // Get XJob interface from MailMerge service and call execute on it
        XJob job = (XJob) UnoRuntime.queryInterface(XJob.class, mmservice);
        if (job == null)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "job null", "I");
            throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"job null", "fr");
        }   

        try
        {
            Boolean res = (Boolean) job.execute(new NamedValue[0]);
            return res.booleanValue();
        }
        catch (IllegalArgumentException e3)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"IllegalArgumentException - " + e3.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"IllegalArgumentException - " + e3.getMessage(), "fr");
        }
        catch (Exception e3)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " +
e3.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0", "Exception -
" + e3.getMessage(), "fr");
        }

When I do this in a loop, nearly thousands times, OOo can't save the result file
. OOo run a widget with an error who say that "style.xml or
content.xml can't be saved". After that, the document is corrupt and OOo is in
an error state.
Comment 7 eric.savary 2006-05-17 14:09:25 UTC
ES->SW: looks yes a little bit like an API special task ;)
Comment 8 stephan.wunderlich 2006-05-22 08:54:55 UTC
Created attachment 36648 [details]
document with macro to perform the mailmerge
Comment 9 stephan.wunderlich 2006-05-22 08:57:27 UTC
Created attachment 36649 [details]
document that contains the mailmerge fields
Comment 10 stephan.wunderlich 2006-05-22 09:14:15 UTC
To reproduce the behaviour:

1. store the attached document "mailmerge_loop" and "baseDoc" to your local disc
2. open the document "mailmerge_loop" and adjust the pathes in it
3. store the changed document
4. open the file "baseDoc" and make a change to the document
5. without saving the document "baseDoc" start the macro attached to
"mailmerge_loop"

This macro attempts to do a mailmerge 1000 times. After 502 of these runs the
macro stops with an gerneral IO error followed by an IllegalArgumentException.

6. close the office

=> you are asked if you want to save the document "baseDoc"

7. press the save button

=> an error message appears telling you that the document can't be saved since
there is a problem with the styles.xml
Comment 11 Mathias_Bauer 2007-12-04 12:36:44 UTC
following release status meeting -> target 3.x
Comment 12 Marcus 2017-05-20 11:17:41 UTC
Reset assigne to the default "issues@openoffice.apache.org".