Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:13.2
calligra
calligra-2.8.5-librevenge.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File calligra-2.8.5-librevenge.patch of Package calligra
--- calligra-2.8.5/cmake/modules/FindLibEtonyek.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibEtonyek.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -10,16 +10,16 @@ include(LibFindMacros) libfind_package(LIBETONYEK LibWpd) -libfind_pkg_check_modules(LIBETONYEK_PKGCONF libetonyek-0.0) +libfind_pkg_check_modules(LIBETONYEK_PKGCONF libetonyek-0.1) find_path(LIBETONYEK_INCLUDE_DIR NAMES libetonyek/libetonyek.h HINTS ${LIBETONYEK_PKGCONF_INCLUDE_DIRS} ${LIBETONYEK_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libetonyek-0.0 + PATH_SUFFIXES libetonyek-0.1 ) find_library(LIBETONYEK_LIBRARY - NAMES etonyek etonyek-0.0 + NAMES etonyek etonyek-0.1 HINTS ${LIBETONYEK_PKGCONF_LIBRARY_DIRS} ${LIBETONYEK_PKGCONF_LIBDIR} ) --- calligra-2.8.5/cmake/modules/FindLibOdfGen.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibOdfGen.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -9,16 +9,16 @@ # Redistribution and use is allowed according to the terms of the BSD license. include(LibFindMacros) -libfind_pkg_check_modules(LIBODFGEN_PKGCONF libodfgen-0.0) +libfind_pkg_check_modules(LIBODFGEN_PKGCONF libodfgen-0.1) find_path(LIBODFGEN_INCLUDE_DIR NAMES libodfgen/libodfgen.hxx HINTS ${LIBODFGEN_PKGCONF_INCLUDE_DIRS} ${LIBODFGEN_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libodfgen-0.0 + PATH_SUFFIXES libodfgen-0.1 ) find_library(LIBODFGEN_LIBRARY - NAMES odfgen-0.0 + NAMES odfgen-0.1 HINTS ${LIBODFGEN_PKGCONF_LIBRARY_DIRS} ${LIBODFGEN_PKGCONF_LIBDIR} ) --- calligra-2.8.5/cmake/modules/FindLibRevenge.cmake 1970-01-01 01:00:00.000000000 +0100 +++ calligra-2.8.5/cmake/modules/FindLibRevenge.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -0,0 +1,37 @@ +# - Try to find the librevenge +# Once done this will define +# +# LIBREVENGE_FOUND - system has LIBREVENGE +# LIBREVENGE_INCLUDE_DIRS - the LIBREVENGE include directory +# LIBREVENGE_LIBRARIES - Link these to use LIBREVENGE +# LIBREVENGE_DEFINITIONS - Compiler switches required for using LIBREVENGE +# + +include(LibFindMacros) +libfind_pkg_check_modules(REVENGE_PKGCONF librevenge-0.0) + +find_path(REVENGE_INCLUDE_DIR + NAMES librevenge/librevenge.h + HINTS ${REVENGE_PKGCONF_INCLUDE_DIRS} ${REVENGE_PKGCONF_INCLUDEDIR} + PATH_SUFFIXES librevenge-0.0 +) + +find_path(REVENGE_STREAM_INCLUDE_DIR + NAMES librevenge-stream/librevenge-stream.h + HINTS ${REVENGE_STREAM_PKGCONF_INCLUDE_DIRS} ${REVENGE_STREAM_PKGCONF_INCLUDEDIR} + PATH_SUFFIXES librevenge-0.0 +) + +find_library(REVENGE_LIBRARY + NAMES revenge librevenge revenge-0.0 librevenge-0.0 + HINTS ${REVENGE_STREAM_PKGCONF_LIBRARY_DIRS} ${REVENGE_STREAM_PKGCONF_LIBDIR} +) + +find_library(REVENGE_STREAM_LIBRARY + NAMES revenge-stream librevenge-stream revenge-stream-0.0 librevenge-stream-0.0 + HINTS ${REVENGE_PKGCONF_LIBRARY_DIRS} ${REVENGE_PKGCONF_LIBDIR} +) + +set(LIBREVENGE_PROCESS_LIBS REVENGE_LIBRARY REVENGE_STREAM_LIBRARY) +set(LIBREVENGE_PROCESS_INCLUDES REVENGE_INCLUDE_DIR REVENGE_STREAM_INCLUDE_DIR) +libfind_process(LIBREVENGE) --- calligra-2.8.5/cmake/modules/FindLibVisio.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibVisio.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -12,16 +12,16 @@ include(LibFindMacros) libfind_package(LIBWPD LibWpd) libfind_package(LIBWPG LibWpg) -libfind_pkg_check_modules(LIBVISIO_PKGCONF libvisio-0.0) +libfind_pkg_check_modules(LIBVISIO_PKGCONF libvisio-0.1) find_path(LIBVISIO_INCLUDE_DIR NAMES libvisio/libvisio.h HINTS ${LIBVISIO_PKGCONF_INCLUDE_DIRS} ${LIBVISIO_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libvisio-0.0 + PATH_SUFFIXES libvisio-0.1 ) find_library(LIBVISIO_LIBRARY - NAMES visio visio-0.0 + NAMES visio visio-0.1 HINTS ${LIBVISIO_PKGCONF_LIBRARY_DIRS} ${LIBVISIO_PKGCONF_LIBDIR} ) --- calligra-2.8.5/cmake/modules/FindLibWpd.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibWpd.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -8,31 +8,19 @@ # include(LibFindMacros) -libfind_pkg_check_modules(WPD_PKGCONF libwpd-0.9) -libfind_pkg_check_modules(WPD_STREAM_PKGCONF libwpd-stream-0.9) +libfind_pkg_check_modules(WPD_PKGCONF libwpd-0.10) find_path(WPD_INCLUDE_DIR NAMES libwpd/libwpd.h HINTS ${WPD_PKGCONF_INCLUDE_DIRS} ${WPD_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libwpd-0.9 -) - -find_path(WPD_STREAM_INCLUDE_DIR - NAMES libwpd-stream/libwpd-stream.h - HINTS ${WPD_STREAM_PKGCONF_INCLUDE_DIRS} ${WPD_STREAM_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libwpd-0.9 + PATH_SUFFIXES libwpd-0.10 ) find_library(WPD_LIBRARY - NAMES wpd libwpd wpd-0.9 libwpd-0.9 + NAMES wpd libwpd wpd-0.10 libwpd-0.10 HINTS ${WPD_PKGCONF_LIBRARY_DIRS} ${WPD_PKGCONF_LIBDIR} ) -find_library(WPD_STREAM_LIBRARY - NAMES wpd-stream libwpd-stream wpd-stream-0.9 libwpd-stream-0.9 - HINTS ${WPD_STREAM_PKGCONF_LIBRARY_DIRS} ${WPD_STREAM_PKGCONF_LIBDIR} -) - -set(LIBWPD_PROCESS_LIBS WPD_LIBRARY WPD_STREAM_LIBRARY) -set(LIBWPD_PROCESS_INCLUDES WPD_INCLUDE_DIR WPD_STREAM_INCLUDE_DIR) +set(LIBWPD_PROCESS_LIBS WPD_LIBRARY) +set(LIBWPD_PROCESS_INCLUDES WPD_INCLUDE_DIR) libfind_process(LIBWPD) --- calligra-2.8.5/cmake/modules/FindLibWpg.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibWpg.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -11,16 +11,16 @@ include(LibFindMacros) libfind_package(LIBWPG LibWpd) -libfind_pkg_check_modules(LIBWPG_PKGCONF libwpg-0.2) +libfind_pkg_check_modules(LIBWPG_PKGCONF libwpg-0.3) find_path(LIBWPG_INCLUDE_DIR NAMES libwpg/libwpg.h HINTS ${LIBWPG_PKGCONF_INCLUDE_DIRS} ${LIBWPG_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libwpg-0.2 + PATH_SUFFIXES libwpg-0.3 ) find_library(LIBWPG_LIBRARY - NAMES wpg wpg-0.2 + NAMES wpg wpg-0.3 HINTS ${LIBWPG_PKGCONF_LIBRARY_DIRS} ${LIBWPG_PKGCONF_LIBDIR} ) --- calligra-2.8.5/cmake/modules/FindLibWps.cmake 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/cmake/modules/FindLibWps.cmake 2014-07-22 10:16:56.424383665 +0200 @@ -10,16 +10,16 @@ include(LibFindMacros) libfind_package(LIBWPS LibWpd) -libfind_pkg_check_modules(LIBWPS_PKGCONF libwps-0.2) +libfind_pkg_check_modules(LIBWPS_PKGCONF libwps-0.3) find_path(LIBWPS_INCLUDE_DIR NAMES libwps/libwps.h HINTS ${LIBWPS_PKGCONF_INCLUDE_DIRS} ${LIBWPS_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES libwps-0.2 + PATH_SUFFIXES libwps-0.3 ) find_library(LIBWPS_LIBRARY - NAMES wps wps-0.2 + NAMES wps wps-0.3 HINTS ${LIBWPS_PKGCONF_LIBRARY_DIRS} ${LIBWPS_PKGCONF_LIBDIR} ) --- calligra-2.8.5/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/CMakeLists.txt 2014-07-22 10:16:56.424383665 +0200 @@ -661,6 +661,16 @@ macro_log_feature(OKULAR_FOUND "Okular" "Okular ODP Plugin" "http://okular.kde.org/" FALSE "" "Required to build the Okular OpenDocument Presenter plugin") ## +## Test for librevenge +## +macro_optional_find_package(LibRevenge) +macro_log_feature(LIBREVENGE_FOUND "LibRevenge" + "A base library for writing document import filters" + "http://sf.net/p/libwpd/librevenge/" FALSE "" + "Required by various import filters" +) + +## ## Test for libodfgen ## macro_optional_find_package(LibOdfGen) --- calligra-2.8.5/filters/flow/visio/import/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/flow/visio/import/CMakeLists.txt 2014-07-22 10:16:56.425383643 +0200 @@ -1,6 +1,7 @@ include_directories( ../../../libodfhandler/ ${LIBODFGEN_INCLUDE_DIRS} + ${LIBREVENGE_INCLUDE_DIRS} ${LIBVISIO_INCLUDE_DIRS} ${KOMAIN_INCLUDES} ) @@ -15,7 +16,7 @@ kde4_add_plugin(calligra_filter_vsdx2odg ${vsdx2odg_PART_SRCS}) -target_link_libraries(calligra_filter_vsdx2odg komain ${LIBODFGEN_LIBRARIES} ${LIBVISIO_LIBRARIES}) +target_link_libraries(calligra_filter_vsdx2odg komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBVISIO_LIBRARIES}) install(TARGETS calligra_filter_vsdx2odg DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES calligra_filter_vsdx2odg.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- calligra-2.8.5/filters/flow/visio/import/VSDXImport.cpp 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/flow/visio/import/VSDXImport.cpp 2014-07-22 10:16:56.425383643 +0200 @@ -17,7 +17,7 @@ #include "VSDXImport.h" #include <libvisio/libvisio.h> -#include <libodfgen/OdgGenerator.hxx> +#include <libodfgen/libodfgen.hxx> #include "OutputFileHelper.hxx" #include <KoFilterChain.h> @@ -39,7 +39,7 @@ ~OdgOutputFileHelper() {} private: - bool _isSupportedFormat(WPXInputStream *input, const char * /* password */) + bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */) { if (!libvisio::VisioDocument::isSupported(input)) { @@ -49,9 +49,10 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType) + bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType) { - OdgGenerator exporter(handler, streamType); + OdgGenerator exporter; + exporter.addDocumentHandler(handler, streamType); return libvisio::VisioDocument::parse(input, &exporter); } }; --- calligra-2.8.5/filters/flow/wpg/import/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/flow/wpg/import/CMakeLists.txt 2014-07-22 10:16:56.425383643 +0200 @@ -1,6 +1,7 @@ include_directories( ../../../libodfhandler/ ${LIBODFGEN_INCLUDE_DIRS} + ${LIBREVENGE_INCLUDE_DIRS} ${LIBVISIO_INCLUDE_DIRS} ${KOMAIN_INCLUDES} ) @@ -15,7 +16,7 @@ kde4_add_plugin(calligra_filter_wpg2odg ${wpg2odg_PART_SRCS}) -target_link_libraries(calligra_filter_wpg2odg komain ${LIBODFGEN_LIBRARIES} ${LIBWPG_LIBRARIES}) +target_link_libraries(calligra_filter_wpg2odg komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPG_LIBRARIES}) install(TARGETS calligra_filter_wpg2odg DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES calligra_filter_wpg2odg.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- calligra-2.8.5/filters/flow/wpg/import/WPGImport.cpp 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/flow/wpg/import/WPGImport.cpp 2014-07-22 10:16:56.425383643 +0200 @@ -17,7 +17,7 @@ #include "WPGImport.h" #include <libwpg/libwpg.h> -#include <libodfgen/OdgGenerator.hxx> +#include <libodfgen/libodfgen.hxx> #include "OutputFileHelper.hxx" #include <KoFilterChain.h> @@ -39,7 +39,7 @@ ~OdgOutputFileHelper() {} private: - bool _isSupportedFormat(WPXInputStream *input, const char * /* password */) + bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */) { if (!libwpg::WPGraphics::isSupported(input)) { @@ -49,9 +49,10 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType) + bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, OdfStreamType streamType) { - OdgGenerator exporter(handler, streamType); + OdgGenerator exporter; + exporter.addDocumentHandler(handler, streamType); return libwpg::WPGraphics::parse(input, &exporter); } }; --- calligra-2.8.5/filters/karbon/wpg/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/karbon/wpg/CMakeLists.txt 2014-07-22 10:16:56.425383643 +0200 @@ -1,11 +1,11 @@ -include_directories(${CMAKE_BINARY_DIR}/filters/ ${LIBWPD_INCLUDE_DIRS} ${LIBWPG_INCLUDE_DIR}/) +include_directories(${CMAKE_BINARY_DIR}/filters/ ${LIBREVENGE_INCLUDE_DIRS} ${LIBWPG_INCLUDE_DIR}/) set(wpg2svg_PART_SRCS WPGImport.cpp) kde4_add_plugin(calligra_filter_wpg2svg ${wpg2svg_PART_SRCS}) -target_link_libraries(calligra_filter_wpg2svg komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARIES} ${LIBWPD_LIBRARIES}) +target_link_libraries(calligra_filter_wpg2svg komain ${LIBWPG_LIBRARIES} ${LIBREVENGE_LIBRARIES}) install(TARGETS calligra_filter_wpg2svg DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES calligra_filter_wpg2svg.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- calligra-2.8.5/filters/karbon/wpg/WPGImport.cpp 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/karbon/wpg/WPGImport.cpp 2014-07-22 10:16:56.425383643 +0200 @@ -32,14 +32,12 @@ #include <QString> #include <QFile> +#include <librevenge/librevenge.h> +#include <librevenge-stream/librevenge-stream.h> + #include <libwpg/libwpg.h> -#if LIBWPG_VERSION_MINOR<2 -#include <libwpg/WPGStreamImplementation.h> -#else -#include <libwpd-stream/libwpd-stream.h> -#include <libwpd/libwpd.h> -#endif +#include <cassert> #include <iostream> K_PLUGIN_FACTORY(WPGImportFactory, registerPlugin<WPGImport>();) @@ -63,39 +61,29 @@ if (to != "image/svg+xml") return KoFilter::NotImplemented; -#if LIBWPG_VERSION_MINOR<2 - WPXInputStream* input = new libwpg::WPGFileStream(m_chain->inputFile().toLocal8Bit()); - if (input->isOLEStream()) { - WPXInputStream* olestream = input->getDocumentOLEStream(); - if (olestream) { - delete input; - input = olestream; - } - } - libwpg::WPGString output; -#else - WPXInputStream* input = new WPXFileStream(m_chain->inputFile().toLocal8Bit()); - if (input->isOLEStream()) { - WPXInputStream* olestream = input->getDocumentOLEStream("Anything"); + librevenge::RVNGInputStream* input = new librevenge::RVNGFileStream(m_chain->inputFile().toLocal8Bit()); + if (input->isStructured()) { + librevenge::RVNGInputStream* olestream = input->getSubStreamByName("Anything"); if (olestream) { delete input; input = olestream; } } - ::WPXString output; -#endif - if (!libwpg::WPGraphics::isSupported(input)) { kWarning() << "ERROR: Unsupported file format (unsupported version) or file is encrypted!"; delete input; return KoFilter::NotImplemented; } - if (!libwpg::WPGraphics::generateSVG(input, output)) { + ::librevenge::RVNGStringVector output; + librevenge::RVNGSVGDrawingGenerator generator(output, ""); + + if (!libwpg::WPGraphics::parse(input, &generator)) { kWarning() << "ERROR: SVG Generation failed!"; delete input; return KoFilter::ParsingError; } + assert(1 == output.size()); delete input; @@ -104,7 +92,8 @@ kWarning() << "ERROR: Could not open output file" << m_chain->outputFile(); return KoFilter::InternalError; } - outputFile.write(output.cstr()); + outputFile.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"); + outputFile.write(output[0].cstr()); outputFile.close(); return KoFilter::OK; --- calligra-2.8.5/filters/libodfhandler/DiskDocumentHandler.cxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/DiskDocumentHandler.cxx 2014-07-22 10:16:56.425383643 +0200 @@ -37,7 +37,7 @@ { } -void DiskOdfDocumentHandler::startElement(const char *psName, const WPXPropertyList &xPropList) +void DiskOdfDocumentHandler::startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList) { if (mbIsTagOpened) { @@ -46,11 +46,11 @@ } PUTSTRING("<"); PUTSTRING(psName); - WPXPropertyList::Iter i(xPropList); + librevenge::RVNGPropertyList::Iter i(xPropList); for (i.rewind(); i.next(); ) { - // filter out libwpd elements - if (strncmp(i.key(), "libwpd", 6) != 0) + // filter out librevenge properties + if (strncmp(i.key(), "librevenge", 10) != 0) { PUTSTRING(" "); PUTSTRING(i.key()); @@ -91,14 +91,15 @@ } } -void DiskOdfDocumentHandler::characters(const WPXString &sCharacters) +void DiskOdfDocumentHandler::characters(const librevenge::RVNGString &sCharacters) { if (mbIsTagOpened) { PUTSTRING(">"); mbIsTagOpened = false; } - WPXString sEscapedCharacters(sCharacters, true); + librevenge::RVNGString sEscapedCharacters; + sEscapedCharacters.appendEscapedXML(sCharacters); if (sEscapedCharacters.len() > 0) PUTSTRING(sEscapedCharacters.cstr()); } --- calligra-2.8.5/filters/libodfhandler/DiskDocumentHandler.hxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/DiskDocumentHandler.hxx 2014-07-22 10:16:56.425383643 +0200 @@ -23,7 +23,7 @@ #ifndef _DISKDOCUMENTHANDLER_H #define _DISKDOCUMENTHANDLER_H -#include <libodfgen/OdfDocumentHandler.hxx> +#include <libodfgen/libodfgen.hxx> #ifdef HAVE_CONFIG_H #include "config.h" @@ -45,9 +45,9 @@ #endif virtual void startDocument() {} virtual void endDocument(); - virtual void startElement(const char *psName, const WPXPropertyList &xPropList); + virtual void startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList); virtual void endElement(const char *psName); - virtual void characters(const WPXString &sCharacters); + virtual void characters(const librevenge::RVNGString &sCharacters); private: DiskOdfDocumentHandler(DiskOdfDocumentHandler const &); @@ -58,7 +58,7 @@ FemtoZip *mpOutput; #endif bool mbIsTagOpened; - WPXString msOpenedTagName; + librevenge::RVNGString msOpenedTagName; }; #endif --- calligra-2.8.5/filters/libodfhandler/OutputFileHelper.cxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/OutputFileHelper.cxx 2014-07-22 10:16:56.425383643 +0200 @@ -37,7 +37,7 @@ #include "DiskDocumentHandler.hxx" #include "StdOutHandler.hxx" -#include <libwpd-stream/WPXStreamImplementation.h> +#include <librevenge-stream/librevenge-stream.h> struct OutputFileHelperImpl { @@ -197,12 +197,12 @@ bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType) { - WPXFileStream input(inFileName); + librevenge::RVNGFileStream input(inFileName); if (!_isSupportedFormat(&input, m_impl->mpPassword)) return false; - input.seek(0, WPX_SEEK_SET); + input.seek(0, librevenge::RVNG_SEEK_SET); OdfDocumentHandler *pHandler; #ifdef USE_GSF_OUTPUT --- calligra-2.8.5/filters/libodfhandler/OutputFileHelper.hxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/OutputFileHelper.hxx 2014-07-22 10:16:56.425383643 +0200 @@ -22,9 +22,10 @@ #ifndef _OUTPUTFILEHELPER_HXX #define _OUTPUTFILEHELPER_HXX -#include <libodfgen/OdfDocumentHandler.hxx> +#include <libodfgen/libodfgen.hxx> + +#include <librevenge-stream/librevenge-stream.h> -class WPXInputStream; struct OutputFileHelperImpl; class OutputFileHelper @@ -38,8 +39,8 @@ bool writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType); private: - virtual bool _isSupportedFormat(WPXInputStream *input, const char *password) = 0; - virtual bool _convertDocument(WPXInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) = 0; + virtual bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char *password) = 0; + virtual bool _convertDocument(librevenge::RVNGInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) = 0; OutputFileHelperImpl *m_impl; private: --- calligra-2.8.5/filters/libodfhandler/StdOutHandler.cxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/StdOutHandler.cxx 2014-07-22 10:16:56.425383643 +0200 @@ -31,7 +31,7 @@ printf("<?xml version=\"1.0\"?>\n"); } -void StdOutHandler::startElement(const char *psName, const WPXPropertyList &xPropList) +void StdOutHandler::startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList) { if (mbIsTagOpened) { @@ -39,11 +39,11 @@ mbIsTagOpened = false; } printf("<%s", psName); - WPXPropertyList::Iter i(xPropList); + librevenge::RVNGPropertyList::Iter i(xPropList); for (i.rewind(); i.next(); ) { - // filter out libwpd elements - if (strncmp(i.key(), "libwpd", 6) != 0) + // filter out librevenge properties + if (strncmp(i.key(), "librevenge", 10) != 0) printf(" %s=\"%s\"", i.key(), i()->getStr().cstr()); } mbIsTagOpened = true; @@ -73,15 +73,14 @@ } } -void StdOutHandler::characters(const WPXString &sCharacters) +void StdOutHandler::characters(const librevenge::RVNGString &sCharacters) { if (mbIsTagOpened) { printf(">"); mbIsTagOpened = false; } - WPXString sEscapedCharacters(sCharacters, true); - printf("%s", sEscapedCharacters.cstr()); + printf("%s", librevenge::RVNGString::escapeXML(sCharacters).cstr()); } void StdOutHandler::endDocument() --- calligra-2.8.5/filters/libodfhandler/StdOutHandler.hxx 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/libodfhandler/StdOutHandler.hxx 2014-07-22 10:16:56.425383643 +0200 @@ -23,7 +23,7 @@ #ifndef _STDOUTHANDLER_H #define _STDOUTHANDLER_H -#include <libodfgen/OdfDocumentHandler.hxx> +#include <libodfgen/libodfgen.hxx> class StdOutHandler : public OdfDocumentHandler { @@ -31,12 +31,12 @@ StdOutHandler(); virtual void startDocument() {} virtual void endDocument(); - virtual void startElement(const char *psName, const WPXPropertyList &xPropList); + virtual void startElement(const char *psName, const librevenge::RVNGPropertyList &xPropList); virtual void endElement(const char *psName); - virtual void characters(const WPXString &sCharacters); + virtual void characters(const librevenge::RVNGString &sCharacters); private: bool mbIsTagOpened; - WPXString msOpenedTagName; + librevenge::RVNGString msOpenedTagName; }; #endif --- calligra-2.8.5/filters/words/wordperfect/import/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/words/wordperfect/import/CMakeLists.txt 2014-07-22 10:16:56.425383643 +0200 @@ -1,6 +1,7 @@ include_directories( ../../../libodfhandler/ ${LIBODFGEN_INCLUDE_DIRS} + ${LIBREVENGE_INCLUDE_DIRS} ${LIBWPD_INCLUDE_DIRS} ${LIBWPG_INCLUDE_DIRS} ${KOMAIN_INCLUDES} @@ -17,7 +18,7 @@ kde4_add_plugin(calligra_filter_wpd2odt ${wpd2odt_PART_SRCS}) target_link_libraries(calligra_filter_wpd2odt - komain ${LIBODFGEN_LIBRARIES} ${LIBWPD_LIBRARIES} ${LIBWPG_LIBRARIES}) + komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPD_LIBRARIES} ${LIBWPG_LIBRARIES}) install(TARGETS calligra_filter_wpd2odt DESTINATION ${PLUGIN_INSTALL_DIR}) --- calligra-2.8.5/filters/words/wordperfect/import/WPDImport.cpp 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/words/wordperfect/import/WPDImport.cpp 2014-07-22 10:16:56.426383621 +0200 @@ -18,8 +18,7 @@ #include <libwpd/libwpd.h> #include <libwpg/libwpg.h> -#include <libodfgen/OdtGenerator.hxx> -#include <libodfgen/OdgGenerator.hxx> +#include <libodfgen/libodfgen.hxx> #include <OutputFileHelper.hxx> #include <KoFilterChain.h> @@ -31,6 +30,7 @@ #include <QString> #include <QByteArray> +#include <cassert> #include <stdio.h> class OdtOutputFileHelper : public OutputFileHelper @@ -41,20 +41,20 @@ ~OdtOutputFileHelper() {}; private: - bool _isSupportedFormat(WPXInputStream *input, const char *password) + bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char *password) { - WPDConfidence confidence = WPDocument::isFileFormatSupported(input); - if (WPD_CONFIDENCE_EXCELLENT != confidence && WPD_CONFIDENCE_SUPPORTED_ENCRYPTION != confidence) + libwpd::WPDConfidence confidence = libwpd::WPDocument::isFileFormatSupported(input); + if (libwpd::WPD_CONFIDENCE_EXCELLENT != confidence && libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION != confidence) { fprintf(stderr, "ERROR: We have no confidence that you are giving us a valid WordPerfect document.\n"); return false; } - if (WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence && !password) + if (libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION == confidence && !password) { fprintf(stderr, "ERROR: The WordPerfect document is encrypted and you did not give us a password.\n"); return false; } - if (confidence == WPD_CONFIDENCE_SUPPORTED_ENCRYPTION && password && (WPD_PASSWORD_MATCH_OK != WPDocument::verifyPassword(input, password))) + if (confidence == libwpd::WPD_CONFIDENCE_SUPPORTED_ENCRYPTION && password && (libwpd::WPD_PASSWORD_MATCH_OK != libwpd::WPDocument::verifyPassword(input, password))) { fprintf(stderr, "ERROR: The WordPerfect document is encrypted and we either\n"); fprintf(stderr, "ERROR: don't know how to decrypt it or the given password is wrong.\n"); @@ -64,41 +64,47 @@ return true; } - static bool handleEmbeddedWPGObject(const WPXBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType) + static bool handleEmbeddedWPGObject(const librevenge::RVNGBinaryData &data, OdfDocumentHandler *pHandler, const OdfStreamType streamType) { - OdgGenerator exporter(pHandler, streamType); + OdgGenerator exporter; + exporter.addDocumentHandler(pHandler, streamType); libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT; - if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(data.getDataStream()))) + if (!libwpg::WPGraphics::isSupported(const_cast<librevenge::RVNGInputStream *>(data.getDataStream()))) fileFormat = libwpg::WPG_WPG1; - return libwpg::WPGraphics::parse(const_cast<WPXInputStream *>(data.getDataStream()), &exporter, fileFormat); + return libwpg::WPGraphics::parse(const_cast<librevenge::RVNGInputStream *>(data.getDataStream()), &exporter, fileFormat); } - static bool handleEmbeddedWPGImage(const WPXBinaryData &input, WPXBinaryData &output) + static bool handleEmbeddedWPGImage(const librevenge::RVNGBinaryData &input, librevenge::RVNGBinaryData &output) { - WPXString svgOutput; libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT; - if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(input.getDataStream()))) + if (!libwpg::WPGraphics::isSupported(const_cast<librevenge::RVNGInputStream *>(input.getDataStream()))) fileFormat = libwpg::WPG_WPG1; - if (!libwpg::WPGraphics::generateSVG(const_cast<WPXInputStream *>(input.getDataStream()), svgOutput, fileFormat)) + librevenge::RVNGStringVector svgOutput; + librevenge::RVNGSVGDrawingGenerator generator(svgOutput, ""); + if (!libwpg::WPGraphics::parse(const_cast<librevenge::RVNGInputStream *>(input.getDataStream()), &generator, fileFormat)) return false; + assert(1 == svgOutput.size()); output.clear(); - output.append((unsigned char *)svgOutput.cstr(), strlen(svgOutput.cstr())); + const librevenge::RVNGString svgPrefix("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"); + output.append((unsigned char *)svgPrefix.cstr(), svgPrefix.size()); + output.append((unsigned char *)svgOutput[0].cstr(), svgOutput[0].size()); return true; } - bool _convertDocument(WPXInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) + bool _convertDocument(librevenge::RVNGInputStream *input, const char *password, OdfDocumentHandler *handler, const OdfStreamType streamType) { - OdtGenerator collector(handler, streamType); + OdtGenerator collector; + collector.addDocumentHandler(handler, streamType); collector.registerEmbeddedObjectHandler("image/x-wpg", &handleEmbeddedWPGObject); collector.registerEmbeddedImageHandler("image/x-wpg", &handleEmbeddedWPGImage); - if (WPD_OK == WPDocument::parse(input, &collector, password)) + if (libwpd::WPD_OK == libwpd::WPDocument::parse(input, &collector, password)) return true; return false; } --- calligra-2.8.5/filters/words/works/import/CMakeLists.txt 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/words/works/import/CMakeLists.txt 2014-07-22 10:16:56.426383621 +0200 @@ -1,6 +1,7 @@ include_directories( ../../../libodfhandler/ ${LIBODFGEN_INCLUDE_DIRS} + ${LIBREVENGE_INCLUDE_DIRS} ${LIBWPS_INCLUDE_DIRS} ${KOMAIN_INCLUDES} ) @@ -15,7 +16,7 @@ kde4_add_plugin(calligra_filter_wps2odt ${wps2odt_PART_SRCS}) -target_link_libraries(calligra_filter_wps2odt komain ${LIBODFGEN_LIBRARIES} ${LIBWPS_LIBRARIES}) +target_link_libraries(calligra_filter_wps2odt komain ${LIBODFGEN_LIBRARIES} ${LIBREVENGE_LIBRARIES} ${LIBWPS_LIBRARIES}) install(TARGETS calligra_filter_wps2odt DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES calligra_filter_wps2odt.desktop DESTINATION ${SERVICES_INSTALL_DIR}) --- calligra-2.8.5/filters/words/works/import/WPSImport.cpp 2014-07-03 09:52:39.000000000 +0200 +++ calligra-2.8.5/filters/words/works/import/WPSImport.cpp 2014-07-22 10:16:56.426383621 +0200 @@ -16,9 +16,9 @@ #include "WPSImport.h" -#include <libwpd/libwpd.h> +#include <librevenge/librevenge.h> #include <libwps/libwps.h> -#include <libodfgen/OdtGenerator.hxx> +#include <libodfgen/libodfgen.hxx> #include "OutputFileHelper.hxx" #include <KoFilterChain.h> @@ -40,10 +40,11 @@ ~OdtOutputFileHelper() {}; private: - bool _isSupportedFormat(WPXInputStream *input, const char * /* password */) + bool _isSupportedFormat(librevenge::RVNGInputStream *input, const char * /* password */) { - WPSConfidence confidence = WPSDocument::isFileFormatSupported(input); - if (confidence == WPS_CONFIDENCE_NONE || confidence == WPS_CONFIDENCE_POOR) + libwps::WPSKind kind = libwps::WPS_TEXT; + libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(input, kind); + if ((libwps::WPS_TEXT != kind) || (confidence != libwps::WPS_CONFIDENCE_EXCELLENT)) { fprintf(stderr, "ERROR: We have no confidence that you are giving us a valid Microsoft Works document.\n"); return false; @@ -52,10 +53,11 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char * /* password */, OdfDocumentHandler *handler, const OdfStreamType streamType) + bool _convertDocument(librevenge::RVNGInputStream *input, const char * /* password */, OdfDocumentHandler *handler, const OdfStreamType streamType) { - OdtGenerator collector(handler, streamType); - if (WPS_OK == WPSDocument::parse(input, &collector)) + OdtGenerator collector; + collector.addDocumentHandler(handler, streamType); + if (libwps::WPS_OK == libwps::WPSDocument::parse(input, &collector)) return true; return false; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor