From 79e5ee5f6949f4b8645ef32dba61705d02473c60 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 29 Nov 2012 11:27:45 +0100 Subject: Isolate PDF Import so it can be made optionally installable ...which can be attractive for installation sets that use --with-system-poppler but do not want the LO core package to depend on a poppler package. See the comment at the top of scp2/source/ooo/module_pdfimport.scp for details. The build-time --disable-pdfimport configure switch is gone, PDF Import is built unconditionally for all platforms but Android and iOS now. (The ENABLE_PDFIMPORT variable now uses TRUE/FALSE rather than YES/NO, to increase consistency across those variables.) Change-Id: I6509d0b2e770b276cd54540408fb1ec5a7dda058 --- configure.ac | 14 ++--- distro-configs/LibreOfficeAndroid.conf | 1 - distro-configs/LibreOfficeAndroidX86.conf | 1 - distro-configs/LibreOfficeLinux.conf | 1 - distro-configs/LibreOfficeMacOSX.conf | 1 - distro-configs/LibreOfficeOpenBSD.conf | 1 - distro-configs/LibreOfficeWin32.conf | 1 - distro-configs/LibreOfficeiOS.conf | 1 - distro-configs/OxygenOfficeLinux.conf | 1 - distro-configs/OxygenOfficeWin32.conf | 1 - filter/Configuration_filter.mk | 70 +++------------------ .../types/pdf_Portable_Document_Format_import.xcu | 29 --------- officecfg/registry/data/org/openoffice/Setup.xcu | 3 + postprocess/packcomponents/makefile.mk | 2 +- postprocess/packregistry/makefile.mk | 15 ++++- scp2/InstallModule_ooo.mk | 6 ++ scp2/source/ooo/file_library_ooo.scp | 13 ---- scp2/source/ooo/file_ooo.scp | 23 ------- scp2/source/ooo/module_hidden_ooo.scp | 3 - scp2/source/ooo/module_pdfimport.scp | 72 ++++++++++++++++++++++ sdext/Module_sdext.mk | 2 +- sdext/Package_pdfimport_xcu.mk | 1 + sdext/source/pdfimport/config/pdf_types.xcu | 35 +++++++++++ sdext/source/pdfimport/test/testdocs/makefile.mk | 2 +- sdext/source/pdfimport/xpdftest/makefile.mk | 2 +- 25 files changed, 144 insertions(+), 157 deletions(-) delete mode 100644 filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu create mode 100644 scp2/source/ooo/module_pdfimport.scp create mode 100644 sdext/source/pdfimport/config/pdf_types.xcu diff --git a/configure.ac b/configure.ac index ef57fbb52e67..c40e5232b387 100644 --- a/configure.ac +++ b/configure.ac @@ -565,11 +565,6 @@ AC_ARG_ENABLE(extensions, [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.]) ) -AC_ARG_ENABLE(pdfimport, - AS_HELP_STRING([--disable-pdfimport], - [Disable PDF import.]) -) - AC_ARG_ENABLE(scripting, AS_HELP_STRING([--disable-scripting], [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.]) @@ -4157,11 +4152,11 @@ if test "$cross_compiling" = "yes"; then ./configure \ --disable-graphite \ --disable-build-mozilla \ - --disable-pdfimport \ --disable-postgresql-sdbc \ --disable-zenity \ --with-parallelism="$with_parallelism" \ --without-doxygen \ + ENABLE_PDFIMPORT=FALSE \ $sub_conf_opts \ 2>&1 | sed -e 's/^/ /' test -f ./config_host.mk 2>/dev/null || exit @@ -9795,9 +9790,9 @@ AC_SUBST(ENABLE_MINIMIZER) # pdf import? AC_MSG_CHECKING([whether to build the PDF import]) -if test "x$enable_pdfimport" != "xno"; then +if test "$_os" != Android -a "$_os" != iOS -a "$ENABLE_PDFIMPORT" != FALSE; then AC_MSG_RESULT([yes]) - ENABLE_PDFIMPORT=YES + ENABLE_PDFIMPORT=TRUE dnl =================================================================== dnl Check for system poppler @@ -9825,8 +9820,7 @@ if test "x$enable_pdfimport" != "xno"; then fi else AC_MSG_RESULT([no]) - ENABLE_PDFIMPORT=NO - SCPDEFS="$SCPDEFS -DWITHOUT_PDFIMPORT" + ENABLE_PDFIMPORT=FALSE fi AC_SUBST(ENABLE_PDFIMPORT) AC_SUBST(SYSTEM_POPPLER) diff --git a/distro-configs/LibreOfficeAndroid.conf b/distro-configs/LibreOfficeAndroid.conf index 10b351c29e30..14b31dfd1af4 100644 --- a/distro-configs/LibreOfficeAndroid.conf +++ b/distro-configs/LibreOfficeAndroid.conf @@ -12,7 +12,6 @@ --disable-mozilla --disable-odk --disable-opengl ---disable-pdfimport --disable-postgresql-sdbc --disable-python --disable-randr diff --git a/distro-configs/LibreOfficeAndroidX86.conf b/distro-configs/LibreOfficeAndroidX86.conf index 4414b584f5b0..43f1c0be5262 100644 --- a/distro-configs/LibreOfficeAndroidX86.conf +++ b/distro-configs/LibreOfficeAndroidX86.conf @@ -12,7 +12,6 @@ --disable-mozilla --disable-odk --disable-opengl ---disable-pdfimport --disable-postgresql-sdbc --disable-python --disable-randr diff --git a/distro-configs/LibreOfficeLinux.conf b/distro-configs/LibreOfficeLinux.conf index 6f22043fde6e..0ffc31c96e1e 100644 --- a/distro-configs/LibreOfficeLinux.conf +++ b/distro-configs/LibreOfficeLinux.conf @@ -35,7 +35,6 @@ --enable-ext-presenter-minimizer --enable-ext-nlpsolver --enable-epm ---enable-pdfimport --enable-python=internal --enable-online-update --disable-unix-qstart-libpng diff --git a/distro-configs/LibreOfficeMacOSX.conf b/distro-configs/LibreOfficeMacOSX.conf index 2aa870e594d6..686f5fe424ae 100644 --- a/distro-configs/LibreOfficeMacOSX.conf +++ b/distro-configs/LibreOfficeMacOSX.conf @@ -9,6 +9,5 @@ --enable-ext-nlpsolver --enable-extension-integration --enable-online-update ---enable-pdfimport --without-system-postgresql --disable-gtk diff --git a/distro-configs/LibreOfficeOpenBSD.conf b/distro-configs/LibreOfficeOpenBSD.conf index 3862cfebfa51..52ba333fd8c4 100644 --- a/distro-configs/LibreOfficeOpenBSD.conf +++ b/distro-configs/LibreOfficeOpenBSD.conf @@ -15,7 +15,6 @@ --enable-ext-presenter-minimizer --enable-ext-report-builder --enable-ext-wiki-publisher ---enable-pdfimport --enable-python=system --with-alloc=system --with-ant-home=/usr/local/ant diff --git a/distro-configs/LibreOfficeWin32.conf b/distro-configs/LibreOfficeWin32.conf index c8f036ade9cd..7c92efe53288 100644 --- a/distro-configs/LibreOfficeWin32.conf +++ b/distro-configs/LibreOfficeWin32.conf @@ -14,4 +14,3 @@ --enable-ext-presenter-minimizer --enable-ext-nlpsolver --enable-online-update ---enable-pdfimport diff --git a/distro-configs/LibreOfficeiOS.conf b/distro-configs/LibreOfficeiOS.conf index 52fb60f8a9c4..6234d994529a 100644 --- a/distro-configs/LibreOfficeiOS.conf +++ b/distro-configs/LibreOfficeiOS.conf @@ -13,7 +13,6 @@ --disable-mozilla --disable-odk --disable-opengl ---disable-pdfimport --disable-postgresql-sdbc --disable-python --disable-randr diff --git a/distro-configs/OxygenOfficeLinux.conf b/distro-configs/OxygenOfficeLinux.conf index 0777056c04a8..0c428a6c3f34 100644 --- a/distro-configs/OxygenOfficeLinux.conf +++ b/distro-configs/OxygenOfficeLinux.conf @@ -51,7 +51,6 @@ --enable-ext-barcode --disable-ext-oooblogger --enable-ext-mysql-connector ---enable-pdfimport --enable-postgresql-sdbc --with-sun-templates --enable-neon diff --git a/distro-configs/OxygenOfficeWin32.conf b/distro-configs/OxygenOfficeWin32.conf index 22aa1374e045..a3a879d36ca1 100644 --- a/distro-configs/OxygenOfficeWin32.conf +++ b/distro-configs/OxygenOfficeWin32.conf @@ -37,5 +37,4 @@ --enable-graphite --enable-dependency-tracking --enable-mozilla ---enable-pdfimport --with-system-mozilla=mozilla diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index b629c0ba707d..5b41bdac1b3e 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -329,6 +329,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu,filter generic_Text \ writer_MIZI_Hwp_97 \ writer_StarOffice_XML_Writer_Template \ + pdf_Portable_Document_Format \ writer8_template \ writer8 \ writer_MS_Word_2003_XML \ @@ -338,15 +339,6 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu,filter writer_OOXML_Template \ writer_layout_dump_xml \ ) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_writer_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format \ -) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_writer_filters.xcu,filter/source/config/fragments/filters,\ HTML__StarWriter_ \ @@ -401,17 +393,9 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_web_types.xcu,filter/so writer_web_HTML_help \ writer_StarOffice_XML_Writer \ writer_web_StarOffice_XML_Writer_Web_Template \ - writerweb8_writer_template \ -) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_web_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_web_types.xcu,filter/source/config/fragments/types,\ pdf_Portable_Document_Format \ + writerweb8_writer_template \ ) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_web_filters.xcu,filter/source/config/fragments/filters,\ HTML \ @@ -440,17 +424,9 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_global_types.xcu,filter generic_Text \ writer_StarOffice_XML_Writer \ writer_globaldocument_StarOffice_XML_Writer_GlobalDocument \ - writerglobal8 \ -) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_global_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_global_types.xcu,filter/source/config/fragments/types,\ pdf_Portable_Document_Format \ + writerglobal8 \ ) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_global_filters.xcu,filter/source/config/fragments/filters,\ Text__encoded___StarWriter_GlobalDocument_ \ @@ -489,6 +465,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/s calc_SYLK \ calc_StarOffice_XML_Calc \ calc_StarOffice_XML_Calc_Template \ + pdf_Portable_Document_Format \ calc_dBase\ calc8 \ calc8_template \ @@ -499,15 +476,6 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/s calc_OOXML \ calc_OOXML_Template \ ) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_calc_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format \ -) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_calc_filters.xcu,filter/source/config/fragments/filters,\ DIF \ @@ -564,6 +532,7 @@ $(call filter_Configuration_add_ui_filters,fcfg_langpack,filter/source/config/fr $(call filter_Configuration_add_types,fcfg_langpack,fcfg_draw_types.xcu,filter/source/config/fragments/types,\ draw_StarOffice_XML_Draw \ draw_StarOffice_XML_Draw_Template \ + pdf_Portable_Document_Format \ draw8 \ draw8_template \ draw_WordPerfect_Graphics \ @@ -572,15 +541,6 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_draw_types.xcu,filter/s draw_CorelDraw_Document \ draw_Corel_Presentation_Exchange \ ) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_draw_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_draw_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format \ -) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_draw_filters.xcu,filter/source/config/fragments/filters,\ StarOffice_XML__Draw_ \ @@ -610,6 +570,7 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_impress_types.xcu,filte impress_MS_PowerPoint_97_Vorlage \ impress_StarOffice_XML_Impress \ impress_StarOffice_XML_Impress_Template \ + pdf_Portable_Document_Format \ pwp_PlaceWare \ impress8 \ impress8_template \ @@ -621,15 +582,6 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_impress_types.xcu,filte impress_OOXML_Presentation_Template \ impress_OOXML_Presentation_AutoPlay \ ) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_impress_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_impress_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format \ -) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_impress_filters.xcu,filter/source/config/fragments/filters,\ MS_PowerPoint_97 \ @@ -690,17 +642,9 @@ $(call filter_Configuration_add_types,fcfg_langpack,fcfg_math_types.xcu,filter/s math_MathML_XML_Math \ math_MathType_3x \ math_StarOffice_XML_Math \ - math8 \ -) -ifeq ($(ENABLE_PDFIMPORT),YES) -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_math_types.xcu,filter/source/config/fragments/types,\ - pdf_Portable_Document_Format_import \ -) -else -$(call filter_Configuration_add_types,fcfg_langpack,fcfg_math_types.xcu,filter/source/config/fragments/types,\ pdf_Portable_Document_Format \ + math8 \ ) -endif $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_math_filters.xcu,filter/source/config/fragments/filters,\ MathML_XML__Math_ \ diff --git a/filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu b/filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu deleted file mode 100644 index ab0ec52ec455..000000000000 --- a/filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu +++ /dev/null @@ -1,29 +0,0 @@ - - - org.libreoffice.comp.documents.PDFDetector - - pdf - application/pdf - true - draw_pdf_import - - PDF - Portable Document Format (Draw) - - - diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu index 2c25173b2c1b..05ddaac869ff 100644 --- a/officecfg/registry/data/org/openoffice/Setup.xcu +++ b/officecfg/registry/data/org/openoffice/Setup.xcu @@ -795,6 +795,9 @@ com.sun.PresenterScreen-* com.sun.star.PDFImport-* + diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk index a195b66b8ab0..2758f255e07f 100644 --- a/postprocess/packcomponents/makefile.mk +++ b/postprocess/packcomponents/makefile.mk @@ -302,7 +302,7 @@ my_components += \ my_components += component/extensions/source/plugin/pl .END -.IF "$(ENABLE_PDFIMPORT)" == "YES" +.IF "$(ENABLE_PDFIMPORT)" == "TRUE" my_components += component/sdext/source/pdfimport/pdfimport .END diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk index 5877fe6f9c63..f353ef29299f 100644 --- a/postprocess/packregistry/makefile.mk +++ b/postprocess/packregistry/makefile.mk @@ -342,9 +342,6 @@ MY_FILES_main += \ $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-jdbc.xcu MY_DRIVERS += hsqldb jdbc .END -.IF "$(ENABLE_PDFIMPORT)" == "YES" -MY_FILES_main += pdfimport/pdf_import_filter.xcu -.END .IF "$(ENABLE_TDEAB)" == "TRUE" MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-tdeab.xcu .END @@ -470,6 +467,16 @@ MY_FILES_ogltrans = \ $(MY_MOD)/org/openoffice/Office/Impress-ogltrans.xcu .END +.IF "$(ENABLE_PDFIMPORT)" == "TRUE" +MY_XCDS += $(MISC)/pdfimport.xcd +MY_OPTDEPS_pdfimport = calc draw impress math writer + # HACK: for all fcfg_X_types.xcu in filter/Configuration_filter.mk that + # include pdf_Portable_Document_Format (i.e., X in calc, draw, global, + # impress, math, web, writer), add optional dependencies on those XCDS that + # include those fcfg_X_types.xcu +MY_FILES_pdfimport = pdfimport/pdf_import_filter.xcu pdfimport/pdf_types.xcu +.END + .IF "$(GUIBASE)" == "WIN" MY_XCDS += $(MISC)/forcedefault.xcd MY_DEPS_forcedefault = main @@ -497,6 +504,8 @@ $(MISC)/%.xcd .ERRREMOVE : $(MISC)/%.list $(MISC)/%.list : makefile.mk - $(RM) $@ echo '' $(foreach,i,$(MY_DEPS_$(@:b)) '') \ + $(foreach,i,$(MY_OPTDEPS_$(@:b)) \ + '') \ $(foreach,i,$(MY_FILES_$(@:b)) '$i') '' > $@ $(MISC)/lang/Langpack-{$(alllangiso)}.xcd : $(SOLARXMLDIR)/$(MY_MOD)/$$(@:b).xcu diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk index 57676b3ba577..23fbb67dbcaf 100644 --- a/scp2/InstallModule_ooo.mk +++ b/scp2/InstallModule_ooo.mk @@ -230,4 +230,10 @@ $(eval $(call gb_InstallModule_add_localized_scpfiles,scp2/ooo,\ scp2/source/ooo/module_systemint \ )) +ifeq ($(ENABLE_PDFIMPORT),TRUE) +$(eval $(call gb_InstallModule_add_scpfiles,scp2/ooo,\ + scp2/source/ooo/module_pdfimport \ +)) +endif + # vim: set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index 090abbc5b18e..6141f0edf734 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -903,19 +903,6 @@ STD_LIB_FILE( gid_File_Lib_Log, log) STD_LIB_FILE( gid_File_Lib_Pdffilter, pdffilter) -#if !defined WITHOUT_PDFIMPORT -File gid_File_PDFImport - TXT_FILE_BODY; - Dir = SCP2_OOO_BIN_DIR; -#if defined UNX - Name = STRING(CONCAT2(pdfimport.uno,UNXSUFFIX)); -#else - Name = "pdfimport.uno.dll"; -#endif - Styles = (PACKED); -End -#endif - SPECIAL_LIB_FILE(gid_File_Lib_Deployment,deployment) SPECIAL_LIB_FILE(gid_File_Lib_DeploymentGui,deploymentgui) diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp index 9079a4f6247d..6b30e7212cff 100644 --- a/scp2/source/ooo/file_ooo.scp +++ b/scp2/source/ooo/file_ooo.scp @@ -115,29 +115,6 @@ File gid_File_Exe_Nsplugin End #endif -#if !defined WITHOUT_PDFIMPORT - -Directory gid_Dir_Share_Xpdfimport - ParentID = gid_Brand_Dir_Share; - DosName = "xpdfimport"; -End - -File gid_File_Dat_XpdfimportErrPdf - TXT_FILE_BODY; - Dir = gid_Dir_Share_Xpdfimport; - Name = "xpdfimport_err.pdf"; - Styles = (PACKED); -End - -File gid_File_Exe_Xpdfimport - BIN_FILE_BODY; - Dir = gid_Brand_Dir_Program; - Name = EXENAME(xpdfimport); - Styles = (PACKED); -End - -#endif - File gid_File_Bin_Gengal BIN_FILE_BODY; Dir = gid_Brand_Dir_Program; diff --git a/scp2/source/ooo/module_hidden_ooo.scp b/scp2/source/ooo/module_hidden_ooo.scp index 0949760eed0e..13bb7b7593a3 100644 --- a/scp2/source/ooo/module_hidden_ooo.scp +++ b/scp2/source/ooo/module_hidden_ooo.scp @@ -180,8 +180,6 @@ Module gid_Module_Root_Files_4 Default = YES; Styles = (HIDDEN_ROOT); Files = (gid_File_Dat_Root4, - gid_File_Dat_XpdfimportErrPdf, - gid_File_Exe_Xpdfimport, gid_File_Filter_Eme, gid_File_Filter_Sdfilt, gid_File_Filter_Svgio, @@ -237,7 +235,6 @@ Module gid_Module_Root_Files_4 gid_File_Lib_Oox, gid_File_Lib_Pcr, gid_File_Lib_Pdffilter, - gid_File_Lib_PdfImport, gid_File_Lib_Pk, gid_File_Lib_Pl, gid_File_Lib_Sf_Prothdlr, diff --git a/scp2/source/ooo/module_pdfimport.scp b/scp2/source/ooo/module_pdfimport.scp new file mode 100644 index 000000000000..897bd6cc193e --- /dev/null +++ b/scp2/source/ooo/module_pdfimport.scp @@ -0,0 +1,72 @@ +/* -*- 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/. + */ + +// This module is normally included unconditionally in the core installation, it +// provides various import filters for both plain PDF and hybrid PDF/ODF. For +// --with-system-poppler builds it can be advantageous though to package this +// module as an individual, optional part, so that the core installation does +// not feature a dependency on a poppler package. +// +// The +// /org.openoffice.TypeDetection.Types/Types/pdf_Portable_Document_Format +// configuration node contained in pdfimport.xcd needs to override a +// node with the same name but which lacks import functionality and +// which is duplicated across calc, draw, impress, math, writer .xcd +// files. For this to work, there is a hack in +// postprocess/packregistry/makefile.mk to make pdfimport.xcd depend +// on all those other .xcd files (optinally, as not all of the other +// .xcd files need to be present in a given installation). + +#include "macros.inc" + +Module gid_Module_Pdfimport + ParentID = gid_Module_Root_Brand; + Styles = (HIDDEN_ROOT); + Dirs = (gid_Dir_Share_Xpdfimport); + Files = ( + gid_File_Dat_XpdfimportErrPdf, + gid_File_Exe_Xpdfimport, + gid_File_Lib_PdfimportUno, + gid_File_Xcd_Pdfimport); +End + +Directory gid_Dir_Share_Xpdfimport + ParentID = gid_Brand_Dir_Share; + DosName = "xpdfimport"; +End + +File gid_File_Dat_XpdfimportErrPdf + TXT_FILE_BODY; + Dir = gid_Dir_Share_Xpdfimport; + Name = "xpdfimport_err.pdf"; + Styles = (PACKED); +End + +File gid_File_Exe_Xpdfimport + BIN_FILE_BODY; + Dir = gid_Brand_Dir_Program; + Name = EXENAME(xpdfimport); + Styles = (PACKED); +End + +File gid_File_Lib_PdfimportUno + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Program; + Name = SCP2_URE_DL_BARE("pdfimport.uno"); + Styles = (PACKED); +End + +File gid_File_Xcd_Pdfimport + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Registry; + Name = "pdfimport.xcd"; + Styles = (PACKED); +End + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sdext/Module_sdext.mk b/sdext/Module_sdext.mk index 2d506bea6049..726b1476e2fb 100644 --- a/sdext/Module_sdext.mk +++ b/sdext/Module_sdext.mk @@ -40,7 +40,7 @@ $(eval $(call gb_Module_add_targets,sdext,\ )) endif -ifeq ($(ENABLE_PDFIMPORT),YES) +ifeq ($(ENABLE_PDFIMPORT),TRUE) $(eval $(call gb_Module_add_targets,sdext,\ Executable_xpdfimport \ Library_pdfimport \ diff --git a/sdext/Package_pdfimport_xcu.mk b/sdext/Package_pdfimport_xcu.mk index 2dcf39cd5b7a..cbc09710be69 100644 --- a/sdext/Package_pdfimport_xcu.mk +++ b/sdext/Package_pdfimport_xcu.mk @@ -10,5 +10,6 @@ $(eval $(call gb_Package_Package,pdfimport_xcu,$(SRCDIR)/sdext)) $(eval $(call gb_Package_add_file,pdfimport_xcu,xml/pdfimport/pdf_import_filter.xcu,source/pdfimport/config/pdf_import_filter.xcu)) +$(eval $(call gb_Package_add_file,pdfimport_xcu,xml/pdfimport/pdf_types.xcu,source/pdfimport/config/pdf_types.xcu)) # vim: set noet sw=4 ts=4: diff --git a/sdext/source/pdfimport/config/pdf_types.xcu b/sdext/source/pdfimport/config/pdf_types.xcu new file mode 100644 index 000000000000..c3d538b9ec67 --- /dev/null +++ b/sdext/source/pdfimport/config/pdf_types.xcu @@ -0,0 +1,35 @@ + + + + + + + org.libreoffice.comp.documents.PDFDetector + + pdf + application/pdf + true + draw_pdf_import + + PDF - Portable Document Format (Draw) + + + + + diff --git a/sdext/source/pdfimport/test/testdocs/makefile.mk b/sdext/source/pdfimport/test/testdocs/makefile.mk index d5c3ac368e72..273ebb670d93 100644 --- a/sdext/source/pdfimport/test/testdocs/makefile.mk +++ b/sdext/source/pdfimport/test/testdocs/makefile.mk @@ -33,7 +33,7 @@ TESTFILES=\ verticaltext.pdf # --- Fake uno bootstrap ------------------------ -.IF "$(ENABLE_PDFIMPORT)" != "NO" +.IF "$(ENABLE_PDFIMPORT)" == "TRUE" $(BIN)$/pdfi_unittest_test.ini : makefile.mk rm -f $@ diff --git a/sdext/source/pdfimport/xpdftest/makefile.mk b/sdext/source/pdfimport/xpdftest/makefile.mk index 985a62094fc2..bb9fed8286c8 100644 --- a/sdext/source/pdfimport/xpdftest/makefile.mk +++ b/sdext/source/pdfimport/xpdftest/makefile.mk @@ -26,7 +26,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE: settings.mk -.IF "$(ENABLE_PDFIMPORT)" == "NO" +.IF "$(ENABLE_PDFIMPORT)" == "FALSE" @all: @echo "PDF Import extension disabled." .ENDIF -- cgit