Kaydet (Commit) bf7d2ef1 authored tarafından David Tardon's avatar David Tardon

allow to build with released libepubgen

Change-Id: I12d297e8a3e57a3b24d85e4c537996cad0106125
üst fabafcfc
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Configuration for libepubgen.
*/
// Defined if libepubgen supports setting EPUB version (devel. only)
#undef LIBEPUBGEN_VERSION_SUPPORT
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -7724,6 +7724,24 @@ libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${
libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.0])
AS_IF([test "$SYSTEM_EPUBGEN" = "TRUE"], [
AC_MSG_CHECKING([whether libepubgen supports setting EPUB version])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <libepubgen/libepubgen.h>
], [
const libepubgen::EPUBTextGenerator generator(nullptr, EPUB_SPLIT_METHOD_NONE, 30);
])],
[
AC_MSG_RESULT([yes])
AC_DEFINE([LIBEPUBGEN_VERSION_SUPPORT])
],
[
AC_MSG_RESULT([no])
]
)
], [
AC_DEFINE([LIBEPUBGEN_VERSION_SUPPORT])
])
AS_IF([test "$COM" = "MSC"],
[libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
......@@ -12414,6 +12432,7 @@ AC_CONFIG_HEADERS([config_host/config_gio.h])
AC_CONFIG_HEADERS([config_host/config_global.h])
AC_CONFIG_HEADERS([config_host/config_java.h])
AC_CONFIG_HEADERS([config_host/config_lgpl.h])
AC_CONFIG_HEADERS([config_host/config_libepubgen.h])
AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
AC_CONFIG_HEADERS([config_host/config_locales.h])
AC_CONFIG_HEADERS([config_host/config_mpl.h])
......
......@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "config_libepubgen.h"
#include "EPUBExportFilter.hxx"
#include <libepubgen/EPUBTextGenerator.h>
......@@ -36,7 +38,11 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &rDe
// file, the flat ODF filter has access to the doc model, everything else
// is in-between.
EPUBPackage aPackage(mxContext, rDescriptor);
libepubgen::EPUBTextGenerator aGenerator(&aPackage, libepubgen::EPUB_SPLIT_METHOD_HEADING, /*version=*/30);
libepubgen::EPUBTextGenerator aGenerator(&aPackage, libepubgen::EPUB_SPLIT_METHOD_HEADING
#if defined(LIBEPUBGEN_VERSION_SUPPORT)
, /*version=*/30
#endif
);
uno::Reference<xml::sax::XDocumentHandler> xExportHandler(new exp::XMLImport(aGenerator));
uno::Reference<lang::XInitialization> xInitialization(mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.Writer.XMLOasisExporter", mxContext), uno::UNO_QUERY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment