[Libreoffice-commits] core.git: filter/CppunitTest_filter_psd_test.mk filter/Library_gie.mk filter/Module_filter.mk filter/qa filter/source include/vcl solenv/clang-format vcl/CppunitTest_vcl_filters_test.mk vcl/inc vcl/Library_vcl.mk vcl/qa vcl/source vcl/workben

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 17 04:54:34 UTC 2021


 filter/CppunitTest_filter_psd_test.mk                                |   38 ----------
 filter/Library_gie.mk                                                |    1 
 filter/Module_filter.mk                                              |    1 
 filter/source/config/fragments/internalgraphicfilters/psd_Import.xcu |   21 ++---
 include/vcl/graphicfilter.hxx                                        |    2 
 solenv/clang-format/excludelist                                      |    4 -
 vcl/CppunitTest_vcl_filters_test.mk                                  |    1 
 vcl/Library_vcl.mk                                                   |    1 
 vcl/inc/filter/PsdReader.hxx                                         |   26 ++++++
 vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx                    |   18 +---
 vcl/source/filter/FilterConfigCache.cxx                              |    6 -
 vcl/source/filter/graphicfilter.cxx                                  |   18 +++-
 vcl/source/filter/ipsd/ipsd.cxx                                      |    6 -
 vcl/workben/fftester.cxx                                             |   12 ---
 vcl/workben/psdfuzzer.cxx                                            |    5 -
 15 files changed, 72 insertions(+), 88 deletions(-)

New commits:
commit d338dc277d7dbe381d669728e30a1c2606a4814a
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 09:57:51 2021 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Feb 17 05:53:49 2021 +0100

    Move PSD reader from filter module into VCL
    
    Change-Id: I53b11be6e9eb0013f017b2da5745ff525ca79c54
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111017
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/filter/CppunitTest_filter_psd_test.mk b/filter/CppunitTest_filter_psd_test.mk
deleted file mode 100644
index 22a2531eb43f..000000000000
--- a/filter/CppunitTest_filter_psd_test.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- 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_CppunitTest_CppunitTest,filter_psd_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_psd_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_psd_test, \
-    filter/qa/cppunit/filters-psd-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_psd_test, \
-    gie \
-	sal \
-	test \
-	tl \
-	unotest \
-	vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_psd_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_psd_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_psd_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_psd_test,\
-    configmgr/source/configmgr \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_psd_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index d013b58ee489..29e7b131fae4 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -51,7 +51,6 @@ $(eval $(call gb_Library_use_libraries,gie,\
 $(eval $(call gb_Library_add_exception_objects,gie,\
     filter/source/graphicfilter/egif/egif \
     filter/source/graphicfilter/egif/giflzwc \
-    filter/source/graphicfilter/ipsd/ipsd \
     filter/source/graphicfilter/ipbm/ipbm \
     filter/source/graphicfilter/idxf/dxf2mtf \
     filter/source/graphicfilter/idxf/dxfblkrd \
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index dd81f672df66..82eade49ffa1 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -58,7 +58,6 @@ $(eval $(call gb_Module_add_check_targets,filter,\
     CppunitTest_filter_dxf_test \
     CppunitTest_filter_pcd_test \
     CppunitTest_filter_ppm_test \
-    CppunitTest_filter_psd_test \
     CppunitTest_filter_svg \
 ))
 endif
diff --git a/filter/source/config/fragments/internalgraphicfilters/psd_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/psd_Import.xcu
index ce2c3066b8da..f51b0fa59d48 100644
--- a/filter/source/config/fragments/internalgraphicfilters/psd_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/psd_Import.xcu
@@ -15,13 +15,14 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->
-    <node oor:name="psd_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>psd_Adobe_Photoshop</value></prop>
-        <prop oor:name="FormatName"><value>ipd</value></prop>
-        <prop oor:name="RealFilterName"><value>PSD - Adobe Photoshop</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">PSD - Adobe Photoshop</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="psd_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>psd_Adobe_Photoshop</value></prop>
+    <prop oor:name="FormatName"><value>SVPSD</value></prop>
+    <prop oor:name="RealFilterName"><value>PSD - Adobe Photoshop</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">PSD - Adobe Photoshop</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 65ced92ce29f..f33139ac94c8 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -85,6 +85,7 @@ namespace o3tl
 #define IMP_RAS                 "SVRAS"
 #define IMP_PCX                 "SVPCX"
 #define IMP_EPS                 "SVIEPS"
+#define IMP_PSD                 "SVPSD"
 #define EXP_BMP                 "SVBMP"
 #define EXP_SVMETAFILE          "SVMETAFILE"
 #define EXP_WMF                 "SVWMF"
@@ -373,6 +374,7 @@ public:
     static ErrCode readRAS(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readPCX(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readEPS(SvStream & rStream, Graphic & rGraphic);
+    static ErrCode readPSD(SvStream & rStream, Graphic & rGraphic);
 
 private:
     OUString        aFilterPath;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 0f2f0f98e794..1f1934221490 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3900,7 +3900,6 @@ filter/inc/strings.hxx
 filter/qa/cppunit/filters-dxf-test.cxx
 filter/qa/cppunit/filters-pcd-test.cxx
 filter/qa/cppunit/filters-ppm-test.cxx
-filter/qa/cppunit/filters-psd-test.cxx
 filter/qa/cppunit/msfilter-test.cxx
 filter/qa/cppunit/priority-test.cxx
 filter/qa/cppunit/xslt-test.cxx
@@ -3968,7 +3967,6 @@ filter/source/graphicfilter/idxf/dxfvec.hxx
 filter/source/graphicfilter/idxf/idxf.cxx
 filter/source/graphicfilter/ipbm/ipbm.cxx
 filter/source/graphicfilter/ipcd/ipcd.cxx
-filter/source/graphicfilter/ipsd/ipsd.cxx
 filter/source/msfilter/countryid.cxx
 filter/source/msfilter/dffpropset.cxx
 filter/source/msfilter/escherex.cxx
@@ -14816,6 +14814,7 @@ vcl/qa/cppunit/graphicfilter/filters-eps-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-met-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pcx-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pict-test.cxx
+vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-ras-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx
@@ -14932,6 +14931,7 @@ vcl/source/filter/igif/gifread.cxx
 vcl/source/filter/imet/ios2met.cxx
 vcl/source/filter/ipcx/ipcx.cxx
 vcl/source/filter/ipict/ipict.cxx
+vcl/source/filter/ipsd/ipsd.cxx
 vcl/source/filter/ipict/shape.cxx
 vcl/source/filter/ipict/shape.hxx
 vcl/source/filter/iras/iras.cxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index a84aec4c22ec..a62e3b109927 100644
--- a/vcl/CppunitTest_vcl_filters_test.mk
+++ b/vcl/CppunitTest_vcl_filters_test.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_filters_test, \
     vcl/qa/cppunit/graphicfilter/filters-met-test \
     vcl/qa/cppunit/graphicfilter/filters-pcx-test \
     vcl/qa/cppunit/graphicfilter/filters-pict-test \
+    vcl/qa/cppunit/graphicfilter/filters-psd-test \
     vcl/qa/cppunit/graphicfilter/filters-ras-test \
     vcl/qa/cppunit/graphicfilter/filters-test \
     vcl/qa/cppunit/graphicfilter/filters-tiff-test \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 14decf45643f..578d55eb46ee 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -442,6 +442,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/imet/ios2met \
     vcl/source/filter/ipcx/ipcx \
     vcl/source/filter/ipict/ipict \
+    vcl/source/filter/ipsd/ipsd \
     vcl/source/filter/ipict/shape \
     vcl/source/filter/ipdf/pdfread \
     vcl/source/filter/ipdf/pdfdocument \
diff --git a/vcl/inc/filter/PsdReader.hxx b/vcl/inc/filter/PsdReader.hxx
new file mode 100644
index 000000000000..a257f04d4334
--- /dev/null
+++ b/vcl/inc/filter/PsdReader.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This 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 .
+ */
+
+#pragma once
+
+#include <vcl/graph.hxx>
+
+VCL_DLLPUBLIC bool ImportPsdGraphic(SvStream& rStream, Graphic& rGraphic);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/cppunit/data/psd/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/psd/fail/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/psd/fail/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/psd/fail/.gitignore
diff --git a/filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd b/vcl/qa/cppunit/graphicfilter/data/psd/fail/CVE-2007-3741-1.psd
similarity index 100%
rename from filter/qa/cppunit/data/psd/fail/CVE-2007-3741-1.psd
rename to vcl/qa/cppunit/graphicfilter/data/psd/fail/CVE-2007-3741-1.psd
diff --git a/filter/qa/cppunit/data/psd/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/psd/indeterminate/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/psd/indeterminate/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/psd/indeterminate/.gitignore
diff --git a/filter/qa/cppunit/data/psd/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/psd/pass/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/psd/pass/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/psd/pass/.gitignore
diff --git a/filter/qa/cppunit/data/psd/pass/blank-square.psd b/vcl/qa/cppunit/graphicfilter/data/psd/pass/blank-square.psd
similarity index 100%
rename from filter/qa/cppunit/data/psd/pass/blank-square.psd
rename to vcl/qa/cppunit/graphicfilter/data/psd/pass/blank-square.psd
diff --git a/filter/qa/cppunit/data/psd/pass/hang-1.psd b/vcl/qa/cppunit/graphicfilter/data/psd/pass/hang-1.psd
similarity index 100%
rename from filter/qa/cppunit/data/psd/pass/hang-1.psd
rename to vcl/qa/cppunit/graphicfilter/data/psd/pass/hang-1.psd
diff --git a/filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd b/vcl/qa/cppunit/graphicfilter/data/psd/pass/rhbz899670-1.psd
similarity index 100%
rename from filter/qa/cppunit/data/psd/pass/rhbz899670-1.psd
rename to vcl/qa/cppunit/graphicfilter/data/psd/pass/rhbz899670-1.psd
diff --git a/filter/qa/cppunit/filters-psd-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx
similarity index 80%
rename from filter/qa/cppunit/filters-psd-test.cxx
rename to vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx
index 7a3447a1b1ec..4ff25b18636a 100644
--- a/filter/qa/cppunit/filters-psd-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-psd-test.cxx
@@ -12,15 +12,9 @@
 #include <vcl/FilterConfigItem.hxx>
 #include <tools/stream.hxx>
 #include <vcl/graph.hxx>
+#include <filter/PsdReader.hxx>
 
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT bool SAL_CALL
-        ipdGraphicImport(SvStream & rStream, Graphic & rGraphic,
-        FilterConfigItem*);
-}
-
-using namespace ::com::sun::star;
+using namespace css;
 
 /* Implementation of Filters test */
 
@@ -51,17 +45,17 @@ bool PsdFilterTest::load(const OUString &,
 {
     SvFileStream aFileStream(rURL, StreamMode::READ);
     Graphic aGraphic;
-    return ipdGraphicImport(aFileStream, aGraphic, nullptr);
+    return ImportPsdGraphic(aFileStream, aGraphic);
 }
 
 void PsdFilterTest::testCVEs()
 {
+#ifndef DISABLE_CVE_TESTS
     testDir(OUString(),
-        m_directories.getURLFromSrc(u"/filter/qa/cppunit/data/psd/"));
+        m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/psd/"));
+#endif
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(PsdFilterTest);
 
-CPPUNIT_PLUGIN_IMPLEMENT();
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index 43655cd23a59..e3752a24a7c6 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -43,7 +43,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameLi
 {
     IMP_BMP, IMP_GIF, IMP_PNG, IMP_JPEG, IMP_XBM, IMP_XPM,
     EXP_BMP, EXP_JPEG, EXP_PNG, IMP_MOV, IMP_TIFF, EXP_TIFF,
-    IMP_TGA, IMP_PICT, IMP_MET, IMP_RAS, IMP_PCX, nullptr
+    IMP_TGA, IMP_PICT, IMP_MET, IMP_RAS, IMP_PCX, IMP_PSD, nullptr
 };
 
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
@@ -55,7 +55,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameL
 
 const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
 {
-    "egi", "icd", "ipd", "ipb", "epb", "epg",
+    "egi", "icd", "ipb", "epb", "epg",
     "epp", nullptr
 };
 
@@ -235,7 +235,7 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
     "png","2","SVEPNG",
     "pct","1","SVPICT",
     "pcd","1","icd",
-    "psd","1","ipd",
+    "psd","1","SVPSD",
     "pcx","1","SVPCX",
     "pbm","1","ipb",
     "pgm","1","ipb",
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 0917a69705a1..c7eefd4ddf73 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -56,6 +56,7 @@
 #include <filter/PcxReader.hxx>
 #include <filter/EpsReader.hxx>
 #include <filter/EpsWriter.hxx>
+#include <filter/PsdReader.hxx>
 #include <osl/module.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/Size.hpp>
@@ -649,7 +650,6 @@ ImpFilterLibCacheEntry::ImpFilterLibCacheEntry( const OUString& rPathname, const
 extern "C" bool icdGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 extern "C" bool idxGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 extern "C" bool ipbGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-extern "C" bool ipdGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 
 #endif
 
@@ -664,8 +664,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("idxGraphicImport"));
         else if (maFormatName == "ipb")
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipbGraphicImport"));
-        else if (maFormatName == "ipd")
-            mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipdGraphicImport"));
  #else
         if (maFormatName ==  "icd")
             mpfnImport = icdGraphicImport;
@@ -673,8 +671,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = idxGraphicImport;
         else if (maFormatName ==  "ipb")
             mpfnImport = ipbGraphicImport;
-        else if (maFormatName ==  "ipd")
-            mpfnImport = ipdGraphicImport;
  #endif
     }
 
@@ -1741,6 +1737,14 @@ ErrCode GraphicFilter::readEPS(SvStream & rStream, Graphic & rGraphic)
         return ERRCODE_GRFILTER_FILTERERROR;
 }
 
+ErrCode GraphicFilter::readPSD(SvStream & rStream, Graphic & rGraphic)
+{
+    if (ImportPsdGraphic(rStream, rGraphic))
+        return ERRCODE_NONE;
+    else
+        return ERRCODE_GRFILTER_FILTERERROR;
+}
+
 ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream,
                                      sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags,
                                      const css::uno::Sequence< css::beans::PropertyValue >* /*pFilterData*/,
@@ -1878,6 +1882,10 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
         {
             nStatus = readEPS(rIStream, rGraphic);
         }
+        else if (aFilterName.equalsIgnoreAsciiCase(IMP_PSD))
+        {
+            nStatus = readPSD(rIStream, rGraphic);
+        }
         else
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
     }
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/vcl/source/filter/ipsd/ipsd.cxx
similarity index 99%
rename from filter/source/graphicfilter/ipsd/ipsd.cxx
rename to vcl/source/filter/ipsd/ipsd.cxx
index 91599bf3352b..6b96d742dae2 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/vcl/source/filter/ipsd/ipsd.cxx
@@ -26,6 +26,8 @@
 #include <tools/helpers.hxx>
 #include <tools/stream.hxx>
 #include <memory>
+#include <filter/PsdReader.hxx>
+
 
 class FilterConfigItem;
 
@@ -760,11 +762,9 @@ bool PSDReader::ImplReadBody()
 
 //================== GraphicImport - the exported function ================
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-ipdGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
+bool ImportPsdGraphic(SvStream& rStream, Graphic& rGraphic)
 {
     PSDReader aPSDReader(rStream);
-
     return aPSDReader.ReadPSD(rGraphic);
 }
 
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index c6c2754d4dc6..fe030475e3f8 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -49,6 +49,7 @@
 #include <filter/RasReader.hxx>
 #include <filter/PcxReader.hxx>
 #include <filter/EpsReader.hxx>
+#include <filter/PsdReader.hxx>
 #include <osl/file.hxx>
 #include <osl/module.hxx>
 #include <tools/stream.hxx>
@@ -216,18 +217,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         }
         else if (strcmp(argv[2], "psd") == 0)
         {
-            static PFilterCall pfnImport(nullptr);
-            if (!pfnImport)
-            {
-                osl::Module aLibrary;
-                aLibrary.loadRelative(&thisModule, "libgielo.so");
-                pfnImport = reinterpret_cast<PFilterCall>(
-                    aLibrary.getFunctionSymbol("ipdGraphicImport"));
-                aLibrary.release();
-            }
             Graphic aGraphic;
             SvFileStream aFileStream(out, StreamMode::READ);
-            ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr));
+            ret = static_cast<int>(ImportPsdGraphic(aFileStream, aGraphic));
         }
         else if (strcmp(argv[2], "eps") == 0)
         {
diff --git a/vcl/workben/psdfuzzer.cxx b/vcl/workben/psdfuzzer.cxx
index a1bb1823d483..652fd1cd33fb 100644
--- a/vcl/workben/psdfuzzer.cxx
+++ b/vcl/workben/psdfuzzer.cxx
@@ -10,6 +10,7 @@
 #include <tools/stream.hxx>
 #include <vcl/FilterConfigItem.hxx>
 #include "commonfuzzer.hxx"
+#include <filter/PsdReader.hxx>
 
 #include <config_features.h>
 #include <osl/detail/component-mapping.h>
@@ -39,8 +40,6 @@ extern "C" void* lo_get_custom_widget_func(const char*)
     return nullptr;
 }
 
-extern "C" bool ipdGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
-
 extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
 {
     TypicalFuzzerInitialize(argc, argv);
@@ -51,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 {
     SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
     Graphic aGraphic;
-    (void)ipdGraphicImport(aStream, aGraphic, nullptr);
+    (void)ImportPsdGraphic(aStream, aGraphic);
     return 0;
 }
 


More information about the Libreoffice-commits mailing list