From 2e164bea9e6a9a412ac3454d3f0493aed3bfb5cb Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Thu, 22 Aug 2024 03:45:13 +0300 Subject: [PATCH] Update wvWare wrapper --- CMakeLists.txt | 3 +-- src/odr/internal/html/wvWare_wrapper.cpp | 13 ++++++------- src/wvWare.c | 7 ++++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14079bf2..aa8e2095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,8 +211,7 @@ if(WITH_PDF2HTMLEX) endif(WITH_PDF2HTMLEX) if(WITH_WVWARE) find_package(wvware REQUIRED) - # target "meta" errors out if wvware is linked privately - target_link_libraries(odr PUBLIC wvware::wvware) + target_link_libraries(odr PRIVATE wvware::wvware) endif(WITH_WVWARE) if (EXISTS "${PROJECT_SOURCE_DIR}/.git") diff --git a/src/odr/internal/html/wvWare_wrapper.cpp b/src/odr/internal/html/wvWare_wrapper.cpp index 24441535..c1f72059 100644 --- a/src/odr/internal/html/wvWare_wrapper.cpp +++ b/src/odr/internal/html/wvWare_wrapper.cpp @@ -8,14 +8,13 @@ extern "C" { int convert(char *inputFile, char *outputDir, const char *password); -int no_graphics = 1; -int documentId = 0; - -char *s_WVDATADIR = NULL; -char *s_HTMLCONFIG = NULL; +extern int no_graphics; +extern int documentId; +extern char *s_WVDATADIR; +extern char *s_HTMLCONFIG; } -namespace odr::internal { +namespace odr::internal::html { Html wvWare_wrapper(const File &file, const std::string &output_path, const HtmlConfig &config) { @@ -61,4 +60,4 @@ Html wvWare_wrapper(const File &file, const std::string &output_path, FileType::legacy_word_document, config, {{"document", output_file_path}}}; } -} // namespace odr::internal +} // namespace odr::internal::html diff --git a/src/wvWare.c b/src/wvWare.c index 440e656c..556d9c83 100644 --- a/src/wvWare.c +++ b/src/wvWare.c @@ -48,9 +48,10 @@ #define wvTrace( args ) #endif -extern char *s_WVDATADIR; -extern char *s_HTMLCONFIG; -extern int documentId; +char *s_WVDATADIR = NULL; +char *s_HTMLCONFIG = NULL; +int documentId = 0; + #define static_reinit( variable, defaultValue ) { \ static int staticVarValue = 0; \ if (staticVarValue != documentId) { \