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
diff --git a/configure.ac b/configure.ac
index ef57fbb..c40e523 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 10b351c..14b31df 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 4414b58..43f1c0b 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 6f22043..0ffc31c 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 2aa870e..686f5fe 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 3862cfe..52ba333f 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 c8f036a..7c92efe 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 52fb60f..6234d99 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 0777056..0c428a6c 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 22aa137..a3a879d 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 b629c0b..5b41bda 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 \
	pdf_Portable_Document_Format \
	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 \
)
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 \
	pdf_Portable_Document_Format \
	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 \
)
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 \
	pdf_Portable_Document_Format \
	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 \
)
endif

$(call filter_Configuration_add_filters,fcfg_langpack,fcfg_math_filters.xcu,filter/source/config/fragments/filters,\
	MathML_XML__Math_ \
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index 2c25173..05ddaac 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -795,6 +795,9 @@
              <value>
                <it>com.sun.PresenterScreen-*</it>
                <it>com.sun.star.PDFImport-*</it>
                    <!-- arguably, dropping PDFImport extensions should be
                         conditional on having in-core PDF import actually built
                         and installed -->
              </value>
            </prop>
          </node>
diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk
index a195b66..2758f25 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 5877fe6..f353ef2 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 '<list>' $(foreach,i,$(MY_DEPS_$(@:b)) '<dependency file="$i"/>') \
        $(foreach,i,$(MY_OPTDEPS_$(@:b)) \
            '<dependency file="$i" optional="true"/>') \
        $(foreach,i,$(MY_FILES_$(@:b)) '<filename>$i</filename>') '</list>' > $@

$(MISC)/lang/Langpack-{$(alllangiso)}.xcd : $(SOLARXMLDIR)/$(MY_MOD)/$$(@:b).xcu
diff --git a/scp2/InstallModule_ooo.mk b/scp2/InstallModule_ooo.mk
index 57676b3..23fbb67d 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 090abbc5..6141f0e 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 9079a4f..6b30e72 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 0949760..13bb7b7 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 0000000..897bd6c
--- /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 2d506be..726b147 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 2dcf39c..cbc0971 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/filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu b/sdext/source/pdfimport/config/pdf_types.xcu
similarity index 80%
rename from filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu
rename to sdext/source/pdfimport/config/pdf_types.xcu
index ab0ec52..c3d538b 100644
--- a/filter/source/config/fragments/types/pdf_Portable_Document_Format_import.xcu
+++ b/sdext/source/pdfimport/config/pdf_types.xcu
@@ -1,3 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
<!--
 * This file is part of the LibreOffice project.
 *
@@ -15,6 +17,8 @@
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.TypeDetection" oor:name="Types">
    <node oor:name="Types">
    <node oor:name="pdf_Portable_Document_Format" oor:op="replace" >
        <prop oor:name="DetectService"><value>org.libreoffice.comp.documents.PDFDetector</value></prop>
        <prop oor:name="URLPattern"/>
@@ -27,3 +31,5 @@
        </prop>
        <prop oor:name="ClipboardFormat"/>
    </node>
    </node>
</oor:component-data>
diff --git a/sdext/source/pdfimport/test/testdocs/makefile.mk b/sdext/source/pdfimport/test/testdocs/makefile.mk
index d5c3ac3..273ebb6 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 985a620..bb9fed82 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