From: Andrea Zagli Date: Mon, 2 Jul 2018 18:30:08 +0000 (+0200) Subject: Aggiunto il test ooo_no_aprichiudi. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=3f4abd77333bc63380722ff94d8b711cb1b4d1d3;p=solipa%2Flibsolipa Aggiunto il test ooo_no_aprichiudi. --- diff --git a/.gitignore b/.gitignore index 95dbbab..c03364d 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ tests/mailui tests/log tests/ooo tests/ooo_nox +tests/ooo_no_aprichiudi tests/ooo_pycmd tests/progresswindow tests/utils diff --git a/tests/Makefile.am b/tests/Makefile.am index 3467a45..a806ce5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,6 +24,7 @@ mailui_LDADD = $(top_builddir)/src/libsolipa.la \ ooo_LDADD = $(top_builddir)/src/libsolipaooo.la ooo_nox_LDADD = $(top_builddir)/src/libsolipaooo.la +ooo_no_aprichiudi_LDADD = $(top_builddir)/src/libsolipaooo.la ooo_pycmd_LDADD = $(top_builddir)/src/libsolipaooo.la noinst_PROGRAMS = allegato \ @@ -34,6 +35,7 @@ noinst_PROGRAMS = allegato \ mailui \ ooo \ ooo_nox \ + ooo_no_aprichiudi \ ooo_pycmd \ progresswindow \ utils \ diff --git a/tests/ooo_no_aprichiudi.c b/tests/ooo_no_aprichiudi.c new file mode 100644 index 0000000..37be752 --- /dev/null +++ b/tests/ooo_no_aprichiudi.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2018 Andrea Zagli + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +SolipaOOO *ooo; + +int +main (int argc, char *argv[]) +{ + ooo = g_object_new (SOLIPA_OOO_TYPE, NULL); + + if (ooo == NULL) + { + g_error ("Unable to create SolipaOOO."); + } + + solipa_ooo_python_init (ooo); + + solipa_ooo_exec (ooo, + solipa_ooo_pycmd_header (ooo)); + + solipa_ooo_apri_documento (ooo, argv[1]); + + solipa_ooo_string_replace (ooo, "{prg::replace}", "\"blah blah blah ààà ììì òòò ÈÈÈ ÀÀÀ ÙÙÙ\""); + + if (argc >= 3) + { + solipa_ooo_salva_documento (ooo, argv[2]); + } + if (argc >= 4) + { + solipa_ooo_salva_documento_pdf (ooo, argv[3]); + } + + if (argc >= 3) + { + solipa_ooo_chiudi_documento (ooo); + } + + g_object_unref (ooo); + + return 0; +}