Kaydet (Commit) 7bf64a5a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Turn PDF import from bundled extension to plain code

No need for dirty hacks linking in basegfx objects statically any more.

To avoid unnecessary confusion between the newly plain code and any instance of
the old extension still installed (per-user or shared), I renamed all relevant
UNO implementation identifiers from com.sun.star.comp.documents.* to
org.libreoffice.comp.documents.*.  Also, existing installations of the extension
are explicitly not migrated to new user profiles.

The xpdfimport executable is now in program/, its xpdfimport_err.pdf in
share/xpdfimport/.  To simplify finding the _err.pdf from xpdfimport, its full
pathname is now given as additional second argument to xpdfimport.  To find
xpdfimport executable from CppunitTest, CppunitTest creates a symlink from
solver's unittest/installation/program to solver's bin, so that
"$BRAND_BASE_DIR/program/xpdfimport" works there (as CppunitTest now sets
BRAND_BASE_DIR to solver's unittest/installation).

The sdext/source/pdfipmort/dialogs/ Basic stuff appeared to be unused (even
though it was included in the .oxt) and has been removed.

The --disable-ext-pdfimport configure switch is renamed to --disable-pdfimport.
Having it still conditional requires some pdf_Portable_Document_Format vs.
pdf_Portable_Document_Format_import foo in module filter.

Change-Id: Iee58c2f6187142a418decc9ea3a5df10eb7e0523
üst 774003e8
......@@ -139,8 +139,6 @@ CXX_FOR_BUILD=ccache g++
--disable-build-mozilla
--disable-directx
--disable-ext-nlpsolver
--disable-ext-pdfimport
--disable-ext-presenter-console
--disable-ext-presenter-minimizer
--disable-ext-report-builder
--disable-ext-scripting-beanshell
......@@ -149,6 +147,7 @@ CXX_FOR_BUILD=ccache g++
--disable-ext-wiki-publisher
--disable-mozilla
--disable-nss-module
--disable-pdfimport
--disable-zenity
--enable-python=system
--with-system-altlinuxhyph
......
......@@ -569,6 +569,7 @@ $(eval $(call gb_Helper_register_libraries,UNOLIBS_OOO, \
nullcanvas \
OGLTrans \
passwordcontainer \
pdfimport \
pythonloader \
postgresql-sdbc \
postgresql-sdbc-impl \
......@@ -637,7 +638,6 @@ $(eval $(call gb_Helper_register_libraries,UNOVERLIBS, \
))
$(eval $(call gb_Helper_register_libraries,EXTENSIONLIBS, \
pdfimport \
SunPresentationMinimizer \
))
......
......@@ -569,6 +569,11 @@ 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.])
......@@ -627,11 +632,6 @@ AC_ARG_ENABLE(ext-oooblogger,
[Enable the OOo Blogger extension.])
)
AC_ARG_ENABLE(ext-pdfimport,
AS_HELP_STRING([--disable-ext-pdfimport],
[Disable the PDF Import extension.])
)
AC_ARG_ENABLE(ext-presenter-minimizer,
AS_HELP_STRING([--disable-ext-presenter-minimizer],
[Disable the Presentation Minimizer extension.])
......@@ -1383,7 +1383,7 @@ AC_ARG_WITH(system-openldap,
AC_ARG_WITH(system-poppler,
AS_HELP_STRING([--with-system-poppler],
[Use system poppler. (only needed for pdfimport extension)]),,
[Use system poppler (only needed for PDF import).]),,
[with_system_poppler="$with_system_libs"])
AC_ARG_WITH(system-apache-commons,
......@@ -9824,9 +9824,9 @@ else
fi
AC_SUBST(ENABLE_MINIMIZER)
# pdf import extension?
AC_MSG_CHECKING([whether to build the PDF Import extension])
if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" != "xno"; then
# pdf import?
AC_MSG_CHECKING([whether to build the PDF import])
if test "x$enable_pdfimport" != "xno"; then
AC_MSG_RESULT([yes])
ENABLE_PDFIMPORT=YES
......@@ -9857,7 +9857,7 @@ if test "x$enable_ext_pdfimport" != "xno" -a "x$enable_extension_integration" !=
else
AC_MSG_RESULT([no])
ENABLE_PDFIMPORT=NO
SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_PDFIMPORT"
SCPDEFS="$SCPDEFS -DWITHOUT_PDFIMPORT"
fi
AC_SUBST(ENABLE_PDFIMPORT)
AC_SUBST(SYSTEM_POPPLER)
......
--host=arm-linux-androideabi
--disable-cairo-canvas
--disable-ext-pdfimport
--disable-ext-presenter-console
--disable-ext-presenter-minimizer
--disable-ext-report-builder
--disable-gconf
......@@ -14,6 +12,7 @@
--disable-odk
--disable-opengl
--disable-postgresql-sdbc
--disable-pdfimport
--disable-python
--disable-randr
--disable-randr-link
......
--host=i686-linux-androideabi
--disable-cairo-canvas
--disable-cups
--disable-ext-pdfimport
--disable-ext-presenter-console
--disable-ext-presenter-minimizer
--disable-ext-report-builder
--disable-gconf
......@@ -14,6 +12,7 @@
--disable-mozilla
--disable-odk
--disable-opengl
--disable-pdfimport
--disable-postgresql-sdbc
--disable-python
--disable-randr
......
......@@ -33,10 +33,9 @@
--enable-ext-wiki-publisher
--enable-ext-report-builder
--enable-ext-presenter-minimizer
--enable-ext-presenter-console
--enable-ext-pdfimport
--enable-ext-nlpsolver
--enable-epm
--enable-pdfimport
--enable-python=internal
--enable-online-update
--disable-unix-qstart-libpng
......
......@@ -4,12 +4,11 @@
--enable-scripting-beanshell
--enable-scripting-javascript
--enable-ext-presenter-minimizer
--enable-ext-presenter-console
--enable-ext-pdfimport
--enable-ext-wiki-publisher
--enable-ext-report-builder
--enable-ext-nlpsolver
--enable-extension-integration
--enable-online-update
--enable-pdfimport
--without-system-postgresql
--disable-gtk
......@@ -13,10 +13,9 @@
--enable-gstreamer-0-10
--enable-lockdown
--enable-ext-presenter-minimizer
--enable-ext-pdfimport
--enable-ext-presenter-console
--enable-ext-report-builder
--enable-ext-wiki-publisher
--enable-pdfimport
--enable-python=system
--with-alloc=system
--with-ant-home=/usr/local/ant
......
......@@ -12,7 +12,6 @@
--enable-ext-wiki-publisher
--enable-ext-report-builder
--enable-ext-presenter-minimizer
--enable-ext-presenter-console
--enable-ext-pdfimport
--enable-ext-nlpsolver
--enable-online-update
--enable-pdfimport
--build=i386-apple-darwin10.7.0
--host=arm-apple-darwin10
--disable-cairo-canvas
--disable-ext-pdfimport
--disable-ext-presenter-console
--disable-ext-presenter-minimizer
--disable-ext-report-builder
--disable-extension-integration
......@@ -15,6 +13,7 @@
--disable-mozilla
--disable-odk
--disable-opengl
--disable-pdfimport
--disable-postgresql-sdbc
--disable-python
--disable-randr
......
......@@ -38,8 +38,6 @@
--enable-ext-wiki-publisher
--enable-ext-report-builder
--enable-ext-presenter-minimizer
--enable-ext-presenter-console
--enable-ext-pdfimport
--enable-scripting-beanshell
--enable-scripting-javascript
--enable-ext-google-docs
......@@ -53,6 +51,7 @@
--enable-ext-barcode
--disable-ext-oooblogger
--enable-ext-mysql-connector
--enable-pdfimport
--enable-postgresql-sdbc
--with-sun-templates
--enable-neon
......
......@@ -16,8 +16,6 @@
--enable-ext-wiki-publisher
--enable-ext-report-builder
--enable-ext-presenter-minimizer
--enable-ext-presenter-console
--enable-ext-pdfimport
--enable-scripting-beanshell
--enable-scripting-javascript
--enable-ext-google-docs
......@@ -39,4 +37,5 @@
--enable-graphite
--enable-dependency-tracking
--enable-mozilla
--enable-pdfimport
--with-system-mozilla=mozilla
......@@ -329,7 +329,6 @@ $(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 \
......@@ -339,6 +338,15 @@ $(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_ \
......@@ -393,9 +401,17 @@ $(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 \
......@@ -424,9 +440,17 @@ $(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_ \
......@@ -465,7 +489,6 @@ $(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 \
......@@ -476,6 +499,15 @@ $(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 \
......@@ -532,7 +564,6 @@ $(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 \
......@@ -541,6 +572,15 @@ $(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_ \
......@@ -570,7 +610,6 @@ $(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 \
......@@ -582,6 +621,15 @@ $(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 \
......@@ -642,9 +690,17 @@ $(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_ \
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
<!--
* This file is part of the LibreOffice project.
*
......@@ -17,10 +15,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>com.sun.star.comp.documents.PDFDetector</value></prop>
<prop oor:name="DetectService"><value>org.libreoffice.comp.documents.PDFDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pdf</value></prop>
<prop oor:name="MediaType"><value>application/pdf</value></prop>
......@@ -31,5 +27,3 @@
</prop>
<prop oor:name="ClipboardFormat"/>
</node>
</node>
</oor:component-data>
......@@ -794,6 +794,7 @@
<prop oor:name="ExcludedExtensions">
<value>
<it>com.sun.PresenterScreen-*</it>
<it>com.sun.star.PDFImport-*</it>
</value>
</prop>
</node>
......
......@@ -303,6 +303,10 @@ my_components += \
my_components += component/extensions/source/plugin/pl
.END
.IF "$(ENABLE_PDFIMPORT)" == "YES"
my_components += component/sdext/source/pdfimport/pdfimport
.END
.IF "$(OS)" == "WNT"
my_components += component/xmlsecurity/util/xsec_xmlsec.windows
.ELIF "$(OS)" != "ANDROID" && "$(OS)" != "IOS" #FIXME, get nss&xmlsec building
......
......@@ -341,6 +341,9 @@ 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
......
......@@ -66,17 +66,6 @@ End
#endif
/* ** PDF Import ** */
#ifndef WITHOUT_EXTENSION_PDFIMPORT
Directory gid_Brand_Dir_Share_Extensions_PDF_Import
ParentID = gid_Brand_Dir_Share_Extensions;
DosName = "pdfimport";
End
#endif
/* ** Numbertext ** */
#ifdef WITH_EXTENSION_NUMBERTEXT
......
......@@ -72,19 +72,6 @@ End
#endif
/* ** PDF Import ** */
#ifndef WITHOUT_EXTENSION_PDFIMPORT
File gid_File_Oxt_PDF_Import
TXT_FILE_BODY;
Styles = (PACKED, ARCHIVE);
Dir = gid_Brand_Dir_Share_Extensions_PDF_Import;
Name = "pdfimport.oxt";
End
#endif
/* ** Numbertext ** */
#ifdef WITH_EXTENSION_NUMBERTEXT
......
......@@ -87,21 +87,6 @@ Module gid_Module_Optional_Extensions_MEDIAWIKI
End
#endif
/* ** PDF Import ** */
#ifndef WITHOUT_EXTENSION_PDFIMPORT
Module gid_Module_Optional_Extensions_PDFIMPORT
PackageInfo = "packinfo_extensions.txt";
MOD_NAME_DESC(MODULE_OPTIONAL_EXTENSIONS_PDFIMPORT);
ParentID = gid_Module_Optional_Extensions;
Files = (
gid_File_Oxt_PDF_Import );
Minimal = NO;
Default = YES;
Styles = ( );
End
#endif
/* ** Numbertext ** */
#ifdef WITH_EXTENSION_NUMBERTEXT
......
......@@ -51,12 +51,6 @@ en-US = "MediaWiki Publisher"
[STR_DESC_MODULE_OPTIONAL_EXTENSIONS_MEDIAWIKI]
en-US = "MediaWiki Publisher"
[STR_NAME_MODULE_OPTIONAL_EXTENSIONS_PDFIMPORT]
en-US = "PDF Import"
[STR_DESC_MODULE_OPTIONAL_EXTENSIONS_PDFIMPORT]
en-US = "PDF Import"
[STR_NAME_MODULE_OPTIONAL_EXTENSIONS_NUMBERTEXT]
en-US = "Numbertext"
......
......@@ -903,6 +903,19 @@ 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)
......
......@@ -115,6 +115,29 @@ 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;
......
......@@ -180,6 +180,8 @@ 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,
......@@ -235,6 +237,7 @@ 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,
......
......@@ -27,11 +27,6 @@
$(eval $(call gb_CppunitTest_CppunitTest,sdext_pdfimport))
$(eval $(call gb_CppunitTest_add_defs,sdext_pdfimport,\
-DPDFIMPORT_EXECUTABLE_LOCATION=\"$(call gb_Helper_make_url,\
$(dir $(call gb_Executable_get_target,xpdfimport)))\" \
))
$(eval $(call gb_CppunitTest_use_api,sdext_pdfimport,\
offapi \
udkapi \
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Extension_Extension,pdfimport,sdext/source/pdfimport))
$(eval $(call gb_Extension_add_file,pdfimport,components.rdb,$(call gb_Rdb_get_target,pdfimport)))
$(eval $(call gb_Extension_add_libraries,pdfimport,\
pdfimport \
))
$(eval $(call gb_Extension_add_executables,pdfimport,\
xpdfimport \
))
$(eval $(call gb_Extension_add_files,pdfimport,,\
$(SRCDIR)/sdext/source/pdfimport/config/pdf_import_filter.xcu \
$(SRCDIR)/sdext/source/pdfimport/config/pdf_types.xcu \
$(SRCDIR)/sdext/source/pdfimport/dialogs/xpdfimport_err.pdf \
))
$(eval $(call gb_Extension_add_files,pdfimport,basic,\
$(SRCDIR)/sdext/source/pdfimport/dialogs/dialog.xlb \
$(SRCDIR)/sdext/source/pdfimport/dialogs/impress.png \
$(SRCDIR)/sdext/source/pdfimport/dialogs/Module1.xba \
$(SRCDIR)/sdext/source/pdfimport/dialogs/script.xlb \
$(SRCDIR)/sdext/source/pdfimport/dialogs/TargetChooser.xdl \
$(SRCDIR)/sdext/source/pdfimport/dialogs/writer.png \
))
$(eval $(call gb_Extension_add_files,pdfimport,images,\
$(SRCDIR)/icon-themes/galaxy/desktop/res/extension_32.png \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -37,6 +37,7 @@ $(eval $(call gb_Library_set_include,pdfimport,\
))
$(eval $(call gb_Library_use_libraries,pdfimport,\
basegfx \
cppu \
cppuhelper \
sal \
......@@ -46,8 +47,6 @@ $(eval $(call gb_Library_use_static_libraries,pdfimport,\
pdfimport_s \
))
$(eval $(call gb_Library_use_library_objects,pdfimport,basegfx))
$(eval $(call gb_Library_use_externals,pdfimport,\
zlib \
))
......
......@@ -42,18 +42,18 @@ endif
ifeq ($(ENABLE_PDFIMPORT),YES)
$(eval $(call gb_Module_add_targets,sdext,\
CustomTarget_pdfimport \
Executable_pdf2xml \
Executable_pdfunzip \
Executable_xpdfimport \
Extension_pdfimport \
Library_pdfimport \
Rdb_pdfimport \
Package_pdfimport_xcu \
Package_pdfimport_xpdfimport \
StaticLibrary_pdfimport_s \
))
$(eval $(call gb_Module_add_check_targets,sdext,\
CppunitTest_pdfimport \
CustomTarget_pdfimport \
Executable_pdf2xml \
Executable_pdfunzip \
))
endif
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(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))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
$(eval $(call gb_Package_Package,pdfimport_xcu,$(SRCDIR)/sdext))
$(eval $(call gb_Package_add_file,pdfimport_xcu,bin/xpdfimport_err.pdf,source/pdfimport/dialogs/xpdfimport_err.pdf))
# vim: set noet sw=4 ts=4:
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_Rdb_Rdb,pdfimport))
$(eval $(call gb_Rdb_add_components,pdfimport,\
sdext/source/pdfimport/pdfimport \
))
# vim:set shiftwidth=4 softtabstop=4 expandtab:
......@@ -55,7 +55,6 @@ $(eval $(call gb_StaticLibrary_set_include,pdfimport_s,\
$(eval $(call gb_StaticLibrary_add_defs,pdfimport_s,\
-DBASEGFX_STATIC_LIBRARY \
-DBOOST_SPIRIT_USE_OLD_NAMESPACE \
-DPDFI_IMPL_IDENTIFIER=\"com.sun.star.PDFImport-$(PLATFORMID)\" \
))
$(eval $(call gb_StaticLibrary_add_exception_objects,pdfimport_s,\
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
<!--
* 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 file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-components;platform=@PLATFORM@"
manifest:full-path="components.rdb"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.star.executable"
manifest:full-path="xpdfimport@EXEC_EXTENSION@"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
manifest:full-path="pdf_import_filter.xcu"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
manifest:full-path="pdf_types.xcu"/>
<manifest:file-entry manifest:media-type="application/vnd.sun.star.basic-library"
manifest:full-path="basic/"/>
</manifest:manifest>
......@@ -43,7 +43,7 @@
<prop oor:name="UIComponent"/>
<prop oor:name="UserData" oor:type="oor:string-list">
<!-- converter service, ,import service,export service, , ,bool for pretty printing on or off -->
<value oor:separator=",">com.sun.star.comp.documents.DrawPDFImport,,com.sun.star.comp.Draw.XMLOasisImporter,,,,true</value>
<value oor:separator=",">org.libreoffice.comp.documents.DrawPDFImport,,com.sun.star.comp.Draw.XMLOasisImporter,,,,true</value>
</prop>
</node>
......@@ -72,7 +72,7 @@
<prop oor:name="UIComponent"/>
<prop oor:name="UserData" oor:type="oor:string-list">
<!-- converter service, ,import service,export service, , ,bool for pretty printing on or off -->
<value oor:separator=",">com.sun.star.comp.documents.ImpressPDFImport,,com.sun.star.comp.Impress.XMLOasisImporter,,,,true</value>
<value oor:separator=",">org.libreoffice.comp.documents.ImpressPDFImport,,com.sun.star.comp.Impress.XMLOasisImporter,,,,true</value>
</prop>
</node>
......@@ -101,7 +101,7 @@
<prop oor:name="UIComponent"/>
<prop oor:name="UserData" oor:type="oor:string-list">
<!-- converter service, ,import service,export service, , ,bool for pretty printing on or off -->
<value oor:separator=",">com.sun.star.comp.documents.WriterPDFImport,,com.sun.star.comp.Writer.XMLOasisImporter,,,,true</value>
<value oor:separator=",">org.libreoffice.comp.documents.WriterPDFImport,,com.sun.star.comp.Writer.XMLOasisImporter,,,,true</value>
</prop>
</node>
......@@ -113,7 +113,7 @@
<value>0</value>
</prop>
<prop oor:name="FilterService" oor:type="xs:string">
<value>com.sun.star.comp.documents.HybridPDFImport</value>
<value>org.libreoffice.comp.documents.HybridPDFImport</value>
</prop>
<prop oor:name="Flags" oor:type="oor:string-list">
<value>3RDPARTYFILTER ALIEN IMPORT NOTINFILEDIALOG NOTINCHOOSER</value>
......@@ -140,7 +140,7 @@
<value>0</value>
</prop>
<prop oor:name="FilterService" oor:type="xs:string">
<value>com.sun.star.comp.documents.HybridPDFImport</value>
<value>org.libreoffice.comp.documents.HybridPDFImport</value>
</prop>
<prop oor:name="Flags" oor:type="oor:string-list">
<value>3RDPARTYFILTER ALIEN IMPORT NOTINFILEDIALOG NOTINCHOOSER</value>
......@@ -167,7 +167,7 @@
<value>0</value>
</prop>
<prop oor:name="FilterService" oor:type="xs:string">
<value>com.sun.star.comp.documents.HybridPDFImport</value>
<value>org.libreoffice.comp.documents.HybridPDFImport</value>
</prop>
<prop oor:name="Flags" oor:type="oor:string-list">
<value>3RDPARTYFILTER ALIEN IMPORT NOTINFILEDIALOG NOTINCHOOSER</value>
......@@ -194,7 +194,7 @@
<value>0</value>
</prop>
<prop oor:name="FilterService" oor:type="xs:string">
<value>com.sun.star.comp.documents.HybridPDFImport</value>
<value>org.libreoffice.comp.documents.HybridPDFImport</value>
</prop>
<prop oor:name="Flags" oor:type="oor:string-list">
<value>3RDPARTYFILTER ALIEN IMPORT NOTINFILEDIALOG NOTINCHOOSER</value>
......
The PDF Import Extension allows you to import and modify PDF documents. Best results with 100% layout accuracy can be achieved with the "PDF/ODF hybrid file" format, which this extension also enables. A hybrid PDF/ODF file is a PDF file that contains an embedded ODF source file. Hybrid PDF/ODF files will be opened in LibreOffice as an ODF file without any layout changes.
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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 file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<description
xmlns="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dep="http://openoffice.org/extensions/description/2006">
<identifier value="com.sun.star.PDFImport-@PLATFORM@" />
<dependencies>
<OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
</dependencies>
<version value="1.0.6" />
<platform value="@PLATFORM@" />
<publisher>
<name xlink:href="http://www.documentfoundation.org" lang="en-US">The Document Foundation</name>
</publisher>
<display-name>
<name lang="en-US">PDF Import</name>
</display-name>
<icon>
<default xlink:href="images/extension_32.png" />
</icon>
<extension-description>
<src xlink:href="description-en-US.txt" lang="en-US" />
</extension-description>
</description>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<!--
* 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 file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module1" script:language="StarBasic">REM ***** BASIC *****
Sub Main
End Sub</script:module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<!--
* 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 file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="TargetChooser" dlg:left="136" dlg:top="72" dlg:width="201" dlg:height="119" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:menulist dlg:id="ListBox" dlg:tab-index="0" dlg:left="80" dlg:top="18" dlg:width="113" dlg:height="14" dlg:spin="true" dlg:linecount="3">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:SelectionChanged" script:language="UNO"/>
</dlg:menulist>
<dlg:text dlg:id="ComboLabel" dlg:left="74" dlg:top="7" dlg:width="82" dlg:height="9" dlg:value="Import %FILENAME as"/>
<dlg:fixedline dlg:id="FixedLine1" dlg:left="-2" dlg:top="93" dlg:width="204" dlg:height="2"/>
<dlg:button dlg:id="HelpButton" dlg:tab-index="1" dlg:left="4" dlg:top="100" dlg:width="50" dlg:height="14" dlg:value="Help" dlg:button-type="help"/>
<dlg:button dlg:id="ImportButton" dlg:tab-index="2" dlg:left="93" dlg:top="100" dlg:width="50" dlg:height="14" dlg:default="true" dlg:value="Import" dlg:button-type="ok"/>
<dlg:button dlg:id="CancelButton" dlg:tab-index="3" dlg:left="146" dlg:top="100" dlg:width="50" dlg:height="14" dlg:value="Cancel" dlg:button-type="cancel"/>
<dlg:img dlg:id="ImpressImage" dlg:left="4" dlg:top="8" dlg:width="60" dlg:height="70" dlg:src="file:///x:/thb/pdf.png"/>
<dlg:text dlg:id="InfoWriter" dlg:left="80" dlg:top="38" dlg:width="114" dlg:height="42" dlg:value="Choose &apos;Text Document&apos; to edit major parts of the text. The document might look different because of reformatting." dlg:multiline="true"/>
<dlg:text dlg:id="InfoImpress" dlg:left="80" dlg:top="38" dlg:width="114" dlg:height="42" dlg:value="Choose &apos;Presentation&apos; to edit the slides of a presentation in PDF format." dlg:multiline="true"/>
<dlg:text dlg:id="InfoDraw" dlg:left="80" dlg:top="38" dlg:width="114" dlg:height="42" dlg:value="Choose &apos;Drawing&apos; to edit minor details of the PDF document. This option is best to preserve the layout." dlg:multiline="true"/>
<dlg:text dlg:id="ListBoxWriter" dlg:left="0" dlg:top="0" dlg:width="114" dlg:height="9" dlg:value="Item 1"/>
<dlg:text dlg:id="ListBoxImpress" dlg:left="0" dlg:top="10" dlg:width="114" dlg:height="9" dlg:value="Item 2"/>
<dlg:text dlg:id="ListBoxDraw" dlg:left="0" dlg:top="20" dlg:width="114" dlg:height="9" dlg:value="Item 3"/>
</dlg:bulletinboard>
</dlg:window>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PDFImport" library:readonly="false" library:passwordprotected="false">
<library:element library:name="TargetChooser"/>
</library:library>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="PDFImport" library:readonly="false" library:passwordprotected="false">
<library:element library:name="Module1"/>
</library:library>
......@@ -10,19 +10,19 @@
<component xmlns="http://openoffice.org/2010/uno-components"
loader="com.sun.star.loader.SharedLibrary"
prefix="pdfimport">
<implementation name="com.sun.star.comp.documents.HybridPDFImport">
<implementation name="org.libreoffice.comp.documents.HybridPDFImport">
<service name="com.sun.star.document.ImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.documents.WriterPDFImport">
<implementation name="org.libreoffice.comp.documents.WriterPDFImport">
<service name="com.sun.star.document.ImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.documents.DrawPDFImport">
<implementation name="org.libreoffice.comp.documents.DrawPDFImport">
<service name="com.sun.star.document.ImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.documents.ImpressPDFImport">
<implementation name="org.libreoffice.comp.documents.ImpressPDFImport">
<service name="com.sun.star.document.ImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.documents.PDFDetector">
<implementation name="org.libreoffice.comp.documents.PDFDetector">
<service name="com.sun.star.document.ImportFilter"/>
</implementation>
</component>
......@@ -99,11 +99,11 @@ namespace
static const ComponentDescription* lcl_getComponents()
{
static const ComponentDescription aDescriptions[] = {
ComponentDescription( "com.sun.star.document.ImportFilter", "com.sun.star.comp.documents.HybridPDFImport", Create_PDFIHybridAdaptor ),
ComponentDescription( "com.sun.star.document.ImportFilter", "com.sun.star.comp.documents.WriterPDFImport", Create_PDFIRawAdaptor_Writer ),
ComponentDescription( "com.sun.star.document.ImportFilter", "com.sun.star.comp.documents.DrawPDFImport", Create_PDFIRawAdaptor_Draw ),
ComponentDescription( "com.sun.star.document.ImportFilter", "com.sun.star.comp.documents.ImpressPDFImport", Create_PDFIRawAdaptor_Impress ),
ComponentDescription( "com.sun.star.document.ImportFilter", "com.sun.star.comp.documents.PDFDetector", Create_PDFDetector ),
ComponentDescription( "com.sun.star.document.ImportFilter", "org.libreoffice.comp.documents.HybridPDFImport", Create_PDFIHybridAdaptor ),
ComponentDescription( "com.sun.star.document.ImportFilter", "org.libreoffice.comp.documents.WriterPDFImport", Create_PDFIRawAdaptor_Writer ),
ComponentDescription( "com.sun.star.document.ImportFilter", "org.libreoffice.comp.documents.DrawPDFImport", Create_PDFIRawAdaptor_Draw ),
ComponentDescription( "com.sun.star.document.ImportFilter", "org.libreoffice.comp.documents.ImpressPDFImport", Create_PDFIRawAdaptor_Impress ),
ComponentDescription( "com.sun.star.document.ImportFilter", "org.libreoffice.comp.documents.PDFDetector", Create_PDFDetector ),
ComponentDescription()
};
return aDescriptions;
......
......@@ -32,12 +32,7 @@
#include <rtl/math.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/basemutex.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/processfactory.hxx>
#include "cppunit/TestAssert.h"
#include "cppunit/TestFixture.h"
......@@ -45,15 +40,11 @@
#include "cppunit/plugin/TestPlugIn.h"
#include <test/bootstrapfixture.hxx>
#include <com/sun/star/deployment/XPackageInformationProvider.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XColorSpace.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/BlendMode.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/tools/canvastools.hxx>
......@@ -461,92 +452,6 @@ namespace
bool m_bDashedLineSeen;
};
/*
This is a (hackish) way to set correct path to the xpdfimport executable
during build. Because $OUTDIR/bin is not in $PATH, it will not be found
directly. We also know that xpdf_ImportFromFile() tries to get the path
through the extension mechanism, but there are no registered extensions
available when this test is run. So we create a phony
PackageInformationProvider that pretends such extension exists and passes
out the path we need .-)
*/
typedef cppu::WeakComponentImplHelper1<deployment::XPackageInformationProvider> PackageInformationProvider_Base;
class PackageInformationProvider
: private cppu::BaseMutex
, public PackageInformationProvider_Base
{
public:
PackageInformationProvider()
: PackageInformationProvider_Base(m_aMutex)
{
}
private:
virtual rtl::OUString SAL_CALL getPackageLocation(rtl::OUString const&)
throw()
{
rtl::OUString const aLocation(PDFIMPORT_EXECUTABLE_LOCATION);
return aLocation;
}
virtual uno::Sequence<uno::Sequence<rtl::OUString> > SAL_CALL isUpdateAvailable(rtl::OUString const&)
throw()
{
// dummy impl.
uno::Sequence<uno::Sequence<rtl::OUString> > const aSeq;
return aSeq;
}
virtual uno::Sequence<uno::Sequence<rtl::OUString> > SAL_CALL getExtensionList()
throw()
{
// dummy impl.
uno::Sequence<uno::Sequence<rtl::OUString> > const aSeq;
return aSeq;
}
};
typedef cppu::WeakComponentImplHelper1<uno::XComponentContext> ComponentContext_Base;
class ComponentContext
: private cppu::BaseMutex
, public ComponentContext_Base
{
public:
explicit ComponentContext(uno::Reference<uno::XComponentContext> const& xParent)
: ComponentContext_Base(m_aMutex)
, m_xParent(xParent)
{
assert(m_xParent.is());
}
private:
virtual uno::Any SAL_CALL getValueByName(rtl::OUString const& rName)
throw()
{
if ( rName == "/singletons/com.sun.star.deployment.PackageInformationProvider" )
{
uno::Reference<deployment::XPackageInformationProvider> const xProvider(new PackageInformationProvider());
uno::Any aComponent;
aComponent <<= xProvider;
return aComponent;
}
return m_xParent->getValueByName(rName);
}
virtual uno::Reference<lang::XMultiComponentFactory> SAL_CALL getServiceManager()
throw()
{
return m_xParent->getServiceManager();
}
private:
uno::Reference<uno::XComponentContext> m_xParent;
};
class PDFITest : public test::BootstrapFixture
{
public:
......@@ -557,7 +462,7 @@ namespace
pSink,
uno::Reference< task::XInteractionHandler >(),
rtl::OUString(),
impl_getComponentContext() );
getComponentContext() );
// make destruction explicit, a bunch of things are
// checked in the destructor
......@@ -566,7 +471,7 @@ namespace
void testOdfDrawExport()
{
pdfi::PDFIRawAdaptor aAdaptor( impl_getComponentContext() );
pdfi::PDFIRawAdaptor aAdaptor( getComponentContext() );
aAdaptor.setTreeVisitorFactory( createDrawTreeVisitorFactory() );
::rtl::OUString tempFileURL;
......@@ -581,7 +486,7 @@ namespace
void testOdfWriterExport()
{
pdfi::PDFIRawAdaptor aAdaptor( impl_getComponentContext() );
pdfi::PDFIRawAdaptor aAdaptor( getComponentContext() );
aAdaptor.setTreeVisitorFactory( createWriterTreeVisitorFactory() );
::rtl::OUString tempFileURL;
......@@ -599,13 +504,6 @@ namespace
CPPUNIT_TEST(testOdfWriterExport);
CPPUNIT_TEST(testOdfDrawExport);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<uno::XComponentContext> impl_getComponentContext()
{
uno::Reference<uno::XComponentContext> const xCtxt(new ComponentContext(getComponentContext()));
return xCtxt;
}
};
}
......
......@@ -23,9 +23,11 @@
#include "pdfihelper.hxx"
#include "osl/file.h"
#include "osl/file.hxx"
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/diagnose.h"
#include "rtl/bootstrap.hxx"
#include "rtl/ustring.hxx"
#include "rtl/ustrbuf.hxx"
#include "rtl/strbuf.hxx"
......@@ -35,7 +37,6 @@
#include "com/sun/star/io/XInputStream.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/awt/FontDescriptor.hpp"
#include "com/sun/star/deployment/PackageInformationProvider.hpp"
#include "com/sun/star/beans/XMaterialHolder.hpp"
#include "com/sun/star/rendering/PathCapType.hpp"
#include "com/sun/star/rendering/PathJoinType.hpp"
......@@ -65,10 +66,6 @@
#include <string.h> // memcmp
#ifndef PDFI_IMPL_IDENTIFIER
# error define implementation name for pdfi extension, please!
#endif
using namespace com::sun::star;
namespace pdfi
......@@ -981,30 +978,40 @@ bool xpdf_ImportFromFile( const ::rtl::OUString& rUR
::rtl::OUString aSysUPath;
if( osl_getSystemPathFromFileURL( rURL.pData, &aSysUPath.pData ) != osl_File_E_None )
{
SAL_WARN(
"sdext.pdfimport",
"getSystemPathFromFileURL(" << rURL << ") failed");
return false;
}
rtl::OUString aDocName( rURL.copy( rURL.lastIndexOf( sal_Unicode('/') )+1 ) );
// check for encryption, if necessary get password
rtl::OUString aPwd( rPwd );
bool bIsEncrypted = false;
if( checkEncryption( aSysUPath, xIHdl, aPwd, bIsEncrypted, aDocName ) == false )
{
SAL_INFO(
"sdext.pdfimport",
"checkEncryption(" << aSysUPath << ") failed");
return false;
}
// Retrieve package location URL, xpdfimport executable is located there:
OUString location(
deployment::PackageInformationProvider::get(xContext)->
getPackageLocation(PDFI_IMPL_IDENTIFIER));
if (location.isEmpty()) {
// Determine xpdfimport executable URL:
OUString converterURL("$BRAND_BASE_DIR/program/xpdfimport");
rtl::Bootstrap::expandMacros(converterURL); //TODO: detect failure
// Determine pathname of xpdfimport_err.pdf:
OUString errPathname("$BRAND_BASE_DIR/share/xpdfimport/xpdfimport_err.pdf");
rtl::Bootstrap::expandMacros(errPathname); //TODO: detect failure
if (osl::FileBase::getSystemPathFromFileURL(errPathname, errPathname)
!= osl::FileBase::E_None)
{
SAL_WARN(
"sdext.pdfimport",
"getPackageLocation(" PDFI_IMPL_IDENTIFIER ") failed");
"getSystemPathFromFileURL(" << errPathname << ") failed");
return false;
}
rtl::OUStringBuffer converterURL(location);
if (!location.endsWith("/")) {
converterURL.append('/');
}
converterURL.append("xpdfimport");
// spawn separate process to keep LGPL/GPL code apart.
// ---------------------------------------------------
......@@ -1024,15 +1031,15 @@ bool xpdf_ImportFromFile( const ::rtl::OUString& rUR
nEnv = 1;
#endif
rtl_uString* args[] = { aSysUPath.pData };
sal_Int32 nArgs = 1;
rtl_uString* args[] = { aSysUPath.pData, errPathname.pData };
sal_Int32 nArgs = 2;
oslProcess aProcess;
oslFileHandle pIn = NULL;
oslFileHandle pOut = NULL;
oslFileHandle pErr = NULL;
const oslProcessError eErr =
osl_executeProcess_WithRedirectedIO(converterURL.makeStringAndClear().pData,
osl_executeProcess_WithRedirectedIO(converterURL.pData,
args,
nArgs,
osl_Process_SEARCHPATH|osl_Process_HIDDEN,
......@@ -1044,7 +1051,13 @@ bool xpdf_ImportFromFile( const ::rtl::OUString& rUR
try
{
if( eErr!=osl_Process_E_None )
{
SAL_WARN(
"sdext.pdfimport",
"executeProcess of " << converterURL << " failed with "
<< +eErr);
return false;
}
if( pIn )
{
......
......@@ -80,7 +80,7 @@ int main(int argc, char **argv)
}
#endif
if( argc < 2 )
if( argc != 3 )
return 1;
// read config file
......@@ -113,11 +113,7 @@ int main(int argc, char **argv)
// PDFDoc takes over ownership for all strings below
GooString* pFileName = new GooString(argv[1]);
GooString* pTempErrFileName = new GooString("_err.pdf");
GooString* pTempErrFileNamePath = new GooString(argv[0]);
GooString* pErrFileName = new GooString(pTempErrFileNamePath,pTempErrFileName);
GooString* pErrFileName = new GooString(argv[2]);
// check for password string(s)
GooString* pOwnerPasswordStr( aPwBuf[0] != 0
......
......@@ -79,36 +79,6 @@ destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
Start
module = "gid_Module_Optional_Extensions_PRESENTER_SCREEN"
solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-extension-presenter-screen"
solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")"
packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-extension-presenter-screen"
requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07"
linuxpatchrequires = ""
copyright = "2012 The Document Foundation"
solariscopyright = "solariscopyrightfile"
vendor = "The Document Foundation"
description = "Presenter Screen extension for %PRODUCTNAME %PRODUCTVERSION"
destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
Start
module = "gid_Module_Optional_Extensions_PDFIMPORT"
solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-extension-pdf-import"
solarisrequires = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION"), %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07 (Name="Core module for %PRODUCTNAME %PRODUCTVERSION")"
packagename = "%BASISPACKAGEPREFIX%PRODUCTVERSION-extension-pdf-import"
requires = "%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07"
linuxpatchrequires = ""
copyright = "2012 The Document Foundation"
solariscopyright = "solariscopyrightfile"
vendor = "The Document Foundation"
description = "PDF import extension for %PRODUCTNAME %PRODUCTVERSION"
destpath = "/opt"
packageversion = "%PACKAGEVERSION"
End
Start
module = "gid_Module_Optional_Extensions_NumberText"
solarispackagename = "%BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-extension-numbertext"
......
......@@ -305,8 +305,14 @@ $(call gb_CppunitTest__use_configuration,$(1),xcsxcu,$(OUTDIR)/unittest/registry
endef
gb_CppunitTest__program_symlink = $(OUTDIR)/unittest/installation/program
$(gb_CppunitTest__program_symlink) :
mkdir -p $(dir $@)
ln -s ../../bin $@
define gb_CppunitTest_use_executable
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_Executable_get_target,$(2))
$(call gb_CppunitTest_get_target,$(1)) :| $(gb_CppunitTest__program_symlink)
endef
define gb_CppunitTest__forward_to_Linktarget
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment