summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-11-24 22:58:01 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-11-24 23:21:37 +0100
commit7bf64a5af4088c0f6d4dbf7f493e94fa63e2a4b2 (patch)
tree1b5203554f998da6402ee482da1499f6568bf31a /sdext/source
parent774003e87946ca9dc63b1c1c550be968016d1e53 (diff)
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
Diffstat (limited to 'sdext/source')
-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
16 files changed, 54 insertions, 336 deletions
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