OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 156
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.generationDoc;
14
 package org.openconcerto.erp.generationDoc;
15
 
15
 
16
import static org.openconcerto.task.config.ComptaBasePropsConfiguration.getStreamStatic;
16
import static org.openconcerto.task.config.ComptaBasePropsConfiguration.getStreamStatic;
-
 
17
 
17
import org.openconcerto.erp.config.ComptaPropsConfiguration;
18
import org.openconcerto.erp.config.ComptaPropsConfiguration;
18
import org.openconcerto.erp.core.common.ui.PreviewFrame;
19
import org.openconcerto.erp.core.common.ui.PreviewFrame;
19
import org.openconcerto.erp.preferences.TemplateNXProps;
20
import org.openconcerto.erp.preferences.TemplateNXProps;
20
import org.openconcerto.openoffice.ODPackage;
21
import org.openconcerto.openoffice.ODPackage;
21
import org.jopendocument.link.Component;
22
import org.jopendocument.link.Component;
Line 214... Line 215...
214
        }
215
        }
215
        File fTmp = new File(this.destDirOO, this.destFileName + ".ods");
216
        File fTmp = new File(this.destDirOO, this.destFileName + ".ods");
216
        fTmp.renameTo(fDest);
217
        fTmp.renameTo(fDest);
217
 
218
 
218
        fDest = new File(this.destDirOO, this.destFileName + ".ods");
219
        fDest = new File(this.destDirOO, this.destFileName + ".ods");
219
        final InputStream stream = getStreamStatic(fODSP);
220
        try (final InputStream stream = getStreamStatic(fODSP)) {
220
        if (stream != null) {
221
            if (stream != null) {
221
            // Copie de l'odsp
222
                // Copie de l'odsp
222
            File odspOut = new File(this.destDirOO, this.destFileName + ".odsp");
223
                File odspOut = new File(this.destDirOO, this.destFileName + ".odsp");
223
            StreamUtils.copy(stream, odspOut);
224
                StreamUtils.copy(stream, odspOut);
224
            stream.close();
225
            }
225
 
-
 
226
        }
226
        }
227
        try {
227
        try {
228
            ssheet.saveAs(fDest);
228
            ssheet.saveAs(fDest);
229
        } catch (FileNotFoundException e) {
229
        } catch (FileNotFoundException e) {
230
            final File file = fDest;
230
            final File file = fDest;