summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
Diffstat (limited to 'sdext')
-rw-r--r--sdext/CppunitTest_pdfimport.mk5
-rw-r--r--sdext/Extension_pdfimport.mk59
-rw-r--r--sdext/Library_pdfimport.mk3
-rw-r--r--sdext/Module_sdext.mk10
-rw-r--r--sdext/Package_pdfimport_xcu.mk14
-rw-r--r--sdext/Package_pdfimport_xpdfimport.mk14
-rw-r--r--sdext/Rdb_pdfimport.mk34
-rw-r--r--sdext/StaticLibrary_pdfimport_s.mk1
-rw-r--r--sdext/source/pdfimport/META-INF/manifest.xml31
-rw-r--r--sdext/source/pdfimport/config/pdf_import_filter.xcu14
-rw-r--r--sdext/source/pdfimport/config/pdf_types.xcu35
-rw-r--r--sdext/source/pdfimport/description-en-US.txt1
-rw-r--r--sdext/source/pdfimport/description.xml50
-rw-r--r--sdext/source/pdfimport/dialogs/Module1.xba24
-rw-r--r--sdext/source/pdfimport/dialogs/TargetChooser.xdl38
-rw-r--r--sdext/source/pdfimport/dialogs/dialog.xlb5
-rw-r--r--sdext/source/pdfimport/dialogs/impress.pngbin11117 -> 0 bytes
-rw-r--r--sdext/source/pdfimport/dialogs/script.xlb5
-rw-r--r--sdext/source/pdfimport/dialogs/writer.pngbin10176 -> 0 bytes
-rw-r--r--sdext/source/pdfimport/pdfimport.component10
-rw-r--r--sdext/source/pdfimport/services.cxx10
-rw-r--r--sdext/source/pdfimport/test/tests.cxx108
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx51
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx8
24 files changed, 88 insertions, 442 deletions
diff --git a/sdext/CppunitTest_pdfimport.mk b/sdext/CppunitTest_pdfimport.mk
index f81f930d44a4..9b82dadd865b 100644
--- a/sdext/CppunitTest_pdfimport.mk
+++ b/sdext/CppunitTest_pdfimport.mk
@@ -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 \
diff --git a/sdext/Extension_pdfimport.mk b/sdext/Extension_pdfimport.mk
deleted file mode 100644
index a97ddff3e13e..000000000000
--- a/sdext/Extension_pdfimport.mk
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- 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:
diff --git a/sdext/Library_pdfimport.mk b/sdext/Library_pdfimport.mk
index 11f4f07473c7..ed23a80ce83d 100644
--- a/sdext/Library_pdfimport.mk
+++ b/sdext/Library_pdfimport.mk
@@ -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 \
))
diff --git a/sdext/Module_sdext.mk b/sdext/Module_sdext.mk
index 779b3bf6b6d7..2d506bea6049 100644
--- a/sdext/Module_sdext.mk
+++ b/sdext/Module_sdext.mk
@@ -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
diff --git a/sdext/Package_pdfimport_xcu.mk b/sdext/Package_pdfimport_xcu.mk
new file mode 100644
index 000000000000..2dcf39cd5b7a
--- /dev/null
+++ b/sdext/Package_pdfimport_xcu.mk
@@ -0,0 +1,14 @@
+# -*- 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:
diff --git a/sdext/Package_pdfimport_xpdfimport.mk b/sdext/Package_pdfimport_xpdfimport.mk
new file mode 100644
index 000000000000..b8dabd890a40
--- /dev/null
+++ b/sdext/Package_pdfimport_xpdfimport.mk
@@ -0,0 +1,14 @@
+# -*- 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:
diff --git a/sdext/Rdb_pdfimport.mk b/sdext/Rdb_pdfimport.mk
deleted file mode 100644
index 65334272ae97..000000000000
--- a/sdext/Rdb_pdfimport.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- 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:
diff --git a/sdext/StaticLibrary_pdfimport_s.mk b/sdext/StaticLibrary_pdfimport_s.mk
index 52724a92f03c..5a78ecb79ead 100644
--- a/sdext/StaticLibrary_pdfimport_s.mk
+++ b/sdext/StaticLibrary_pdfimport_s.mk
@@ -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,\
diff --git a/sdext/source/pdfimport/META-INF/manifest.xml b/sdext/source/pdfimport/META-INF/manifest.xml
deleted file mode 100644
index 2c23a785a584..000000000000
--- a/sdext/source/pdfimport/META-INF/manifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?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>
diff --git a/sdext/source/pdfimport/config/pdf_import_filter.xcu b/sdext/source/pdfimport/config/pdf_import_filter.xcu
index 2e2591072f78..e4001c5c3a04 100644
--- a/sdext/source/pdfimport/config/pdf_import_filter.xcu
+++ b/sdext/source/pdfimport/config/pdf_import_filter.xcu
@@ -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>
diff --git a/sdext/source/pdfimport/config/pdf_types.xcu b/sdext/source/pdfimport/config/pdf_types.xcu
deleted file mode 100644
index 4b3c489b3cd7..000000000000
--- a/sdext/source/pdfimport/config/pdf_types.xcu
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.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 .
- -->
-<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="URLPattern"/>
- <prop oor:name="Extensions"><value>pdf</value></prop>
- <prop oor:name="MediaType"><value>application/pdf</value></prop>
- <prop oor:name="Preferred"><value>true</value></prop>
- <prop oor:name="PreferredFilter"><value>draw_pdf_import</value></prop>
- <prop oor:name="UIName">
- <value>PDF - Portable Document Format (Draw)</value>
- </prop>
- <prop oor:name="ClipboardFormat"/>
- </node>
- </node>
-</oor:component-data>
diff --git a/sdext/source/pdfimport/description-en-US.txt b/sdext/source/pdfimport/description-en-US.txt
deleted file mode 100644
index 0cde58a8ad50..000000000000
--- a/sdext/source/pdfimport/description-en-US.txt
+++ /dev/null
@@ -1 +0,0 @@
-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.
diff --git a/sdext/source/pdfimport/description.xml b/sdext/source/pdfimport/description.xml
deleted file mode 100644
index 0d1af2749113..000000000000
--- a/sdext/source/pdfimport/description.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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>
diff --git a/sdext/source/pdfimport/dialogs/Module1.xba b/sdext/source/pdfimport/dialogs/Module1.xba
deleted file mode 100644
index 3424c168ebf7..000000000000
--- a/sdext/source/pdfimport/dialogs/Module1.xba
+++ /dev/null
@@ -1,24 +0,0 @@
-<?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
diff --git a/sdext/source/pdfimport/dialogs/TargetChooser.xdl b/sdext/source/pdfimport/dialogs/TargetChooser.xdl
deleted file mode 100644
index 1602870d0ea3..000000000000
--- a/sdext/source/pdfimport/dialogs/TargetChooser.xdl
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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
diff --git a/sdext/source/pdfimport/dialogs/dialog.xlb b/sdext/source/pdfimport/dialogs/dialog.xlb
deleted file mode 100644
index e025c4b13f7f..000000000000
--- a/sdext/source/pdfimport/dialogs/dialog.xlb
+++ /dev/null
@@ -1,5 +0,0 @@
-<?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
diff --git a/sdext/source/pdfimport/dialogs/impress.png b/sdext/source/pdfimport/dialogs/impress.png
deleted file mode 100644
index 8951bae55c26..000000000000
--- a/sdext/source/pdfimport/dialogs/impress.png
+++ /dev/null
Binary files differ
diff --git a/sdext/source/pdfimport/dialogs/script.xlb b/sdext/source/pdfimport/dialogs/script.xlb
deleted file mode 100644
index 370d9dfe973c..000000000000
--- a/sdext/source/pdfimport/dialogs/script.xlb
+++ /dev/null
@@ -1,5 +0,0 @@
-<?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>
diff --git a/sdext/source/pdfimport/dialogs/writer.png b/sdext/source/pdfimport/dialogs/writer.png
deleted file mode 100644
index f4d0ecd792a2..000000000000
--- a/sdext/source/pdfimport/dialogs/writer.png
+++ /dev/null
Binary files differ
diff --git a/sdext/source/pdfimport/pdfimport.component b/sdext/source/pdfimport/pdfimport.component
index 5debd2583ffa..ed5d32dccb2d 100644
--- a/sdext/source/pdfimport/pdfimport.component
+++ b/sdext/source/pdfimport/pdfimport.component
@@ -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>
diff --git a/sdext/source/pdfimport/services.cxx b/sdext/source/pdfimport/services.cxx
index 6261e6f03be2..9b186757cfb7 100644
--- a/sdext/source/pdfimport/services.cxx
+++ b/sdext/source/pdfimport/services.cxx
@@ -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;
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index 547561916352..226c1d8cc6a2 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -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;
- }
};
}
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index 4d6f30299907..a90ba8d1e2e6 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -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 )
{
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 3b9488565d56..afaec25d9dcf 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -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