Skip to content

Commit

Permalink
Update wvWare wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Aug 22, 2024
1 parent 3e4f52b commit 2e164be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 6 additions & 7 deletions src/odr/internal/html/wvWare_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
7 changes: 4 additions & 3 deletions src/wvWare.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) { \
Expand Down

0 comments on commit 2e164be

Please sign in to comment.