[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - filter/CppunitTest_filter_eps_test.mk filter/inc 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
Sun Feb 14 15:11:52 UTC 2021


Rebased ref, commits from common ancestor:
commit d2d58f7b3527d4c66b6409b6de244f4255f3b52d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 00:08:02 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Mon Feb 15 00:11:01 2021 +0900

    Move EPS reader and writer from filter module into VCL
    
    Change-Id: I1646f72d6a1db176e4520f8f64321646a26f054e

diff --git a/filter/CppunitTest_filter_eps_test.mk b/filter/CppunitTest_filter_eps_test.mk
deleted file mode 100644
index 8adbf42b88fc..000000000000
--- a/filter/CppunitTest_filter_eps_test.mk
+++ /dev/null
@@ -1,43 +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_eps_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_eps_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_eps_test, \
-    filter/qa/cppunit/filters-eps-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_eps_test, \
-	gie \
-	sal \
-	test \
-	tl \
-	unotest \
-	vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_eps_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_eps_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_eps_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_eps_test,\
-    configmgr/source/configmgr \
-    emfio/emfio \
-    i18npool/util/i18npool \
-    ucb/source/core/ucb1 \
-    ucb/source/ucp/file/ucpfile1 \
-    uui/util/uui \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_eps_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index 54a1e1fb00db..d013b58ee489 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -50,9 +50,7 @@ $(eval $(call gb_Library_use_libraries,gie,\
 
 $(eval $(call gb_Library_add_exception_objects,gie,\
     filter/source/graphicfilter/egif/egif \
-    filter/source/graphicfilter/eps/eps \
     filter/source/graphicfilter/egif/giflzwc \
-    filter/source/graphicfilter/ieps/ieps \
     filter/source/graphicfilter/ipsd/ipsd \
     filter/source/graphicfilter/ipbm/ipbm \
     filter/source/graphicfilter/idxf/dxf2mtf \
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 548e6f27c690..dd81f672df66 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -56,7 +56,6 @@ $(eval $(call gb_Module_add_check_targets,filter,\
 ifneq ($(DISABLE_CVE_TESTS),TRUE)
 $(eval $(call gb_Module_add_check_targets,filter,\
     CppunitTest_filter_dxf_test \
-    CppunitTest_filter_eps_test \
     CppunitTest_filter_pcd_test \
     CppunitTest_filter_ppm_test \
     CppunitTest_filter_psd_test \
diff --git a/filter/inc/strings.hrc b/filter/inc/strings.hrc
index 406ff9123d32..3f1eaeac78ac 100644
--- a/filter/inc/strings.hrc
+++ b/filter/inc/strings.hrc
@@ -55,8 +55,6 @@
 #define T602FILTER_STR_CANCEL_BUTTON            NC_("T602FILTER_STR_CANCEL_BUTTON", "Cancel")
 #define T602FILTER_STR_OK_BUTTON                NC_("T602FILTER_STR_OK_BUTTON", "OK")
 
-#define KEY_VERSION_CHECK                       NC_("KEY_VERSION_CHECK", "Warning: Not all of the imported EPS graphics could be saved at level1\nas some are at a higher level!")
-
 #define PDF_PROGRESS_BAR                        NC_("PDF_PROGRESS_BAR", "Export as PDF")
 
 //strings used in encryption UI
diff --git a/filter/source/config/fragments/internalgraphicfilters/eps_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/eps_Export.xcu
index ad5d989af762..b89453e45d1b 100644
--- a/filter/source/config/fragments/internalgraphicfilters/eps_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/eps_Export.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="eps_Export" oor:op="replace"  >
-        <prop oor:name="Type"><value>eps_Encapsulated_PostScript</value></prop>
-        <prop oor:name="FormatName"><value>eps</value></prop>
-        <prop oor:name="RealFilterName"/>
-        <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">EPS - Encapsulated PostScript</value>
-        </prop>
-        <prop oor:name="Flags"><value>EXPORT</value></prop>
-    </node>
+
+<node oor:name="eps_Export" oor:op="replace"  >
+    <prop oor:name="Type"><value>eps_Encapsulated_PostScript</value></prop>
+    <prop oor:name="FormatName"><value>SVEEPS</value></prop>
+    <prop oor:name="RealFilterName"/>
+    <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">EPS - Encapsulated PostScript</value>
+    </prop>
+    <prop oor:name="Flags"><value>EXPORT</value></prop>
+</node>
diff --git a/filter/source/config/fragments/internalgraphicfilters/eps_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/eps_Import.xcu
index f2f190173e03..327834368dcb 100644
--- a/filter/source/config/fragments/internalgraphicfilters/eps_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/eps_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="eps_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>eps_Encapsulated_PostScript</value></prop>
-        <prop oor:name="FormatName"><value>ips</value></prop>
-        <prop oor:name="RealFilterName"><value>EPS - Encapsulated PostScript</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">EPS - Encapsulated PostScript</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="eps_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>eps_Encapsulated_PostScript</value></prop>
+    <prop oor:name="FormatName"><value>SVIEPS</value></prop>
+    <prop oor:name="RealFilterName"><value>EPS - Encapsulated PostScript</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">EPS - Encapsulated PostScript</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 27855d9ab752..44852bfb746c 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -83,6 +83,7 @@ namespace o3tl
 #define IMP_MET                 "SVMET"
 #define IMP_RAS                 "SVRAS"
 #define IMP_PCX                 "SVPCX"
+#define IMP_EPS                 "SVIEPS"
 #define EXP_BMP                 "SVBMP"
 #define EXP_SVMETAFILE          "SVMETAFILE"
 #define EXP_WMF                 "SVWMF"
@@ -92,6 +93,7 @@ namespace o3tl
 #define EXP_PDF                 "SVEPDF"
 #define EXP_PNG                 "SVEPNG"
 #define EXP_TIFF                "SVTIFF"
+#define EXP_EPS                 "SVEEPS"
 
 
 #define BMP_SHORTNAME           u"BMP"
@@ -355,6 +357,7 @@ public:
     ErrCode readMET(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType);
     ErrCode readRAS(SvStream & rStream, Graphic & rGraphic);
     ErrCode readPCX(SvStream & rStream, Graphic & rGraphic);
+    ErrCode readEPS(SvStream & rStream, Graphic & rGraphic);
 
 private:
     OUString        aFilterPath;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 25582176f3ed..89e402cc68d8 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3891,7 +3891,6 @@ external/unixODBC/inc/odbc/sqltypes.h
 external/unixODBC/inc/odbc/sqlucode.h
 filter/inc/strings.hxx
 filter/qa/cppunit/filters-dxf-test.cxx
-filter/qa/cppunit/filters-eps-test.cxx
 filter/qa/cppunit/filters-pcd-test.cxx
 filter/qa/cppunit/filters-ppm-test.cxx
 filter/qa/cppunit/filters-psd-test.cxx
@@ -3924,7 +3923,6 @@ filter/source/graphic/GraphicExportFilter.hxx
 filter/source/graphicfilter/egif/egif.cxx
 filter/source/graphicfilter/egif/giflzwc.cxx
 filter/source/graphicfilter/egif/giflzwc.hxx
-filter/source/graphicfilter/eps/eps.cxx
 filter/source/graphicfilter/icgm/actimpr.cxx
 filter/source/graphicfilter/icgm/bitmap.cxx
 filter/source/graphicfilter/icgm/bitmap.hxx
@@ -3961,7 +3959,6 @@ filter/source/graphicfilter/idxf/dxftblrd.hxx
 filter/source/graphicfilter/idxf/dxfvec.cxx
 filter/source/graphicfilter/idxf/dxfvec.hxx
 filter/source/graphicfilter/idxf/idxf.cxx
-filter/source/graphicfilter/ieps/ieps.cxx
 filter/source/graphicfilter/ipbm/ipbm.cxx
 filter/source/graphicfilter/ipcd/ipcd.cxx
 filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -14812,6 +14809,7 @@ vcl/qa/cppunit/dndtest.cxx
 vcl/qa/cppunit/errorhandler.cxx
 vcl/qa/cppunit/font.cxx
 vcl/qa/cppunit/fontmetric.cxx
+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
@@ -14922,7 +14920,9 @@ vcl/source/filter/FilterConfigCache.hxx
 vcl/source/filter/FilterConfigItem.cxx
 vcl/source/filter/graphicfilter.cxx
 vcl/source/filter/graphicfilter2.cxx
+vcl/source/filter/eps/eps.cxx
 vcl/source/filter/etiff/etiff.cxx
+vcl/source/filter/ieps/ieps.cxx
 vcl/source/filter/igif/decode.cxx
 vcl/source/filter/igif/decode.hxx
 vcl/source/filter/igif/gifread.cxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index 87a5da8e9284..a84aec4c22ec 100644
--- a/vcl/CppunitTest_vcl_filters_test.mk
+++ b/vcl/CppunitTest_vcl_filters_test.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_CppunitTest_CppunitTest,vcl_filters_test))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,vcl_filters_test, \
+    vcl/qa/cppunit/graphicfilter/filters-eps-test \
     vcl/qa/cppunit/graphicfilter/filters-met-test \
     vcl/qa/cppunit/graphicfilter/filters-pcx-test \
     vcl/qa/cppunit/graphicfilter/filters-pict-test \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 81dae94cf21f..3642efc7978c 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -427,6 +427,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/components/dtranscomp \
     vcl/source/components/factory \
     vcl/source/components/fontident \
+    vcl/source/filter/eps/eps \
     vcl/source/filter/etiff/etiff \
     vcl/source/filter/FilterConfigCache \
     vcl/source/filter/FilterConfigItem \
@@ -435,6 +436,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/GraphicNativeTransform \
     vcl/source/filter/GraphicNativeMetadata \
     vcl/source/filter/GraphicFormatDetector \
+    vcl/source/filter/ieps/ieps \
     vcl/source/filter/igif/decode \
     vcl/source/filter/igif/gifread \
     vcl/source/filter/imet/ios2met \
diff --git a/vcl/inc/filter/EpsReader.hxx b/vcl/inc/filter/EpsReader.hxx
new file mode 100644
index 000000000000..8cc945ee8e74
--- /dev/null
+++ b/vcl/inc/filter/EpsReader.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 ImportEpsGraphic(SvStream& rStream, Graphic& rGraphic);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/filter/EpsWriter.hxx b/vcl/inc/filter/EpsWriter.hxx
new file mode 100644
index 000000000000..8cb002a57c66
--- /dev/null
+++ b/vcl/inc/filter/EpsWriter.hxx
@@ -0,0 +1,28 @@
+/* -*- 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>
+#include <vcl/FilterConfigItem.hxx>
+
+VCL_DLLPUBLIC bool ExportEpsGraphic(SvStream& rStream, Graphic& rGraphic,
+                                    FilterConfigItem* pFilterConfigItem);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc
index 56437a7325e8..11ba428d5798 100644
--- a/vcl/inc/strings.hrc
+++ b/vcl/inc/strings.hrc
@@ -137,6 +137,8 @@
 
 #define STR_SEPARATOR                                NC_("STR_SEPARATOR", "Separator")
 
+#define KEY_VERSION_CHECK                            NC_("KEY_VERSION_CHECK", "Warning: Not all of the imported EPS graphics could be saved at level1\nas some are at a higher level!")
+
 #endif // INCLUDED_VCL_INC_STRINGS_HRC
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/cppunit/data/eps/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/eps/fail/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/eps/fail/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/eps/fail/.gitignore
diff --git a/filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps b/vcl/qa/cppunit/graphicfilter/data/eps/fail/CVE-2009-4195-1.eps
similarity index 100%
rename from filter/qa/cppunit/data/eps/fail/CVE-2009-4195-1.eps
rename to vcl/qa/cppunit/graphicfilter/data/eps/fail/CVE-2009-4195-1.eps
diff --git a/filter/qa/cppunit/data/eps/fail/short-1.eps b/vcl/qa/cppunit/graphicfilter/data/eps/fail/short-1.eps
similarity index 100%
rename from filter/qa/cppunit/data/eps/fail/short-1.eps
rename to vcl/qa/cppunit/graphicfilter/data/eps/fail/short-1.eps
diff --git a/filter/qa/cppunit/data/eps/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/eps/indeterminate/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/eps/indeterminate/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/eps/indeterminate/.gitignore
diff --git a/filter/qa/cppunit/data/eps/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/eps/pass/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/eps/pass/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/eps/pass/.gitignore
diff --git a/filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps b/vcl/qa/cppunit/graphicfilter/data/eps/pass/CVE-2013-4979-1.eps
similarity index 100%
rename from filter/qa/cppunit/data/eps/pass/CVE-2013-4979-1.eps
rename to vcl/qa/cppunit/graphicfilter/data/eps/pass/CVE-2013-4979-1.eps
diff --git a/filter/qa/cppunit/data/eps/pass/fdo13433-4.eps b/vcl/qa/cppunit/graphicfilter/data/eps/pass/fdo13433-4.eps
similarity index 100%
rename from filter/qa/cppunit/data/eps/pass/fdo13433-4.eps
rename to vcl/qa/cppunit/graphicfilter/data/eps/pass/fdo13433-4.eps
diff --git a/filter/qa/cppunit/filters-eps-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-eps-test.cxx
similarity index 80%
rename from filter/qa/cppunit/filters-eps-test.cxx
rename to vcl/qa/cppunit/graphicfilter/filters-eps-test.cxx
index d3f7a18220d5..34d7bab5d43d 100644
--- a/filter/qa/cppunit/filters-eps-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-eps-test.cxx
@@ -12,15 +12,9 @@
 #include <vcl/FilterConfigItem.hxx>
 #include <tools/stream.hxx>
 #include <vcl/graph.hxx>
+#include <filter/EpsReader.hxx>
 
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT bool SAL_CALL
-        ipsGraphicImport(SvStream & rStream, Graphic & rGraphic,
-        FilterConfigItem*);
-}
-
-using namespace ::com::sun::star;
+using namespace css;
 
 /* Implementation of Filters test */
 
@@ -51,17 +45,17 @@ bool EpsFilterTest::load(const OUString &,
 {
     SvFileStream aFileStream(rURL, StreamMode::READ);
     Graphic aGraphic;
-    return ipsGraphicImport(aFileStream, aGraphic, nullptr);
+    return ImportEpsGraphic(aFileStream, aGraphic);
 }
 
 void EpsFilterTest::testCVEs()
 {
+#ifndef DISABLE_CVE_TESTS
     testDir(OUString(),
-        m_directories.getURLFromSrc(u"/filter/qa/cppunit/data/eps/"));
+        m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/eps/"));
+#endif
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(EpsFilterTest);
 
-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 2263c36b6dbe..43655cd23a59 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -49,7 +49,8 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameLi
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
 {
     IMP_SVMETAFILE, IMP_WMF, IMP_EMF, IMP_SVG, IMP_PDF,
-    EXP_SVMETAFILE, EXP_WMF, EXP_EMF, EXP_SVG, EXP_PDF, nullptr
+    EXP_SVMETAFILE, EXP_WMF, EXP_EMF, EXP_SVG, EXP_PDF,
+    IMP_EPS, EXP_EPS, nullptr
 };
 
 const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
@@ -221,8 +222,8 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
     "bmp","1","SVBMP",
     "bmp","2","SVBMP",
     "dxf","1","idx",
-    "eps","1","ips",
-    "eps","2","eps",
+    "eps","1","SVIEPS",
+    "eps","2","SVEEPS",
     "gif","1","SVIGIF",
     "gif","2","egi",
     "jpg","1","SVIJPEG",
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/vcl/source/filter/eps/eps.cxx
similarity index 99%
rename from filter/source/graphicfilter/eps/eps.cxx
rename to vcl/source/filter/eps/eps.cxx
index 04fc15559a06..1f8719bea423 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/vcl/source/filter/eps/eps.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <filter/EpsWriter.hxx>
 #include <tools/stream.hxx>
 #include <tools/poly.hxx>
 #include <tools/fract.hxx>
@@ -2665,12 +2666,10 @@ bool PSWriter::ImplGetBoundingBox( double* nNumb, sal_uInt8* pSource, sal_uInt32
 
 //================== GraphicExport - the exported function ===================
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-epsGraphicExport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem )
+bool ExportEpsGraphic(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem)
 {
     PSWriter aPSWriter;
-    return aPSWriter.WritePS( rGraphic, rStream, pFilterConfigItem );
+    return aPSWriter.WritePS(rGraphic, rStream, pFilterConfigItem);
 }
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 158327bb1c57..27d9090d35d9 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -54,6 +54,8 @@
 #include <filter/MetReader.hxx>
 #include <filter/RasReader.hxx>
 #include <filter/PcxReader.hxx>
+#include <filter/EpsReader.hxx>
+#include <filter/EpsWriter.hxx>
 #include <osl/module.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/Size.hpp>
@@ -648,7 +650,6 @@ extern "C" bool icdGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterCo
 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 );
-extern "C" bool ipsGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 
 #endif
 
@@ -665,8 +666,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipbGraphicImport"));
         else if (maFormatName == "ipd")
             mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipdGraphicImport"));
-        else if (maFormatName == "ips")
-            mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("ipsGraphicImport"));
  #else
         if (maFormatName ==  "icd")
             mpfnImport = icdGraphicImport;
@@ -676,8 +675,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
             mpfnImport = ipbGraphicImport;
         else if (maFormatName ==  "ipd")
             mpfnImport = ipdGraphicImport;
-        else if (maFormatName ==  "ips")
-            mpfnImport = ipsGraphicImport;
  #endif
     }
 
@@ -1158,7 +1155,6 @@ void GraphicFilter::MakeGraphicsAvailableThreaded(std::vector<Graphic*>& graphic
     }
 }
 
-
 Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 sizeLimit,
                                              const Size* pSizeHint)
 {
@@ -1413,7 +1409,7 @@ void GraphicFilter::preload()
     sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, ';');
     ImpFilterLibCache& rCache = Cache::get();
     static const std::initializer_list<std::u16string_view> aFilterNames = {
-        u"icd", u"idx", u"ipb", u"ipd", u"ips",
+        u"icd", u"idx", u"ipb", u"ipd"
     };
 
     // Load library for each filter.
@@ -1743,6 +1739,14 @@ ErrCode GraphicFilter::readPCX(SvStream & rStream, Graphic & rGraphic)
         return ERRCODE_GRFILTER_FILTERERROR;
 }
 
+ErrCode GraphicFilter::readEPS(SvStream & rStream, Graphic & rGraphic)
+{
+    if (ImportEpsGraphic(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*/,
@@ -1876,6 +1880,10 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
         {
             nStatus = readPCX(rIStream, rGraphic);
         }
+        else if (aFilterName.equalsIgnoreAsciiCase(IMP_EPS))
+        {
+            nStatus = readEPS(rIStream, rGraphic);
+        }
         else
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
     }
@@ -1987,7 +1995,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObje
 #ifdef DISABLE_DYNLOADING
 
 extern "C" bool egiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-extern "C" bool epsGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
 
 #endif
 
@@ -2184,6 +2191,14 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
                 if( rOStm.GetError() )
                     nStatus = ERRCODE_GRFILTER_IOERROR;
             }
+            else if (aFilterName.equalsIgnoreAsciiCase(EXP_EPS))
+            {
+                if (!ExportEpsGraphic(rOStm, aGraphic, &aConfigItem))
+                    nStatus = ERRCODE_GRFILTER_FORMATERROR;
+
+                if (rOStm.GetError())
+                    nStatus = ERRCODE_GRFILTER_IOERROR;
+            }
             else if ( aFilterName.equalsIgnoreAsciiCase( EXP_PNG ) )
             {
                 vcl::PNGWriter aPNGWriter( aGraphic.GetBitmapEx(), pFilterData );
@@ -2317,16 +2332,12 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
                 PFilterCall pFunc = nullptr;
                 if (aExternalFilterName == "egi")
                     pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("egiGraphicExport"));
-                else if (aExternalFilterName == "eps")
-                    pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("epsGraphicExport"));
                  // Execute dialog in DLL
  #else
                 --nIdx; // Just one iteration
                 PFilterCall pFunc = NULL;
                 if (aExternalFilterName == "egi")
                     pFunc = egiGraphicExport;
-                else if (aExternalFilterName == "eps")
-                    pFunc = epsGraphicExport;
  #endif
                 if( pFunc )
                 {
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/vcl/source/filter/ieps/ieps.cxx
similarity index 99%
rename from filter/source/graphicfilter/ieps/ieps.cxx
rename to vcl/source/filter/ieps/ieps.cxx
index ed294f9ec1fb..946fbf30b3d7 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/vcl/source/filter/ieps/ieps.cxx
@@ -18,6 +18,7 @@
  */
 
 
+#include <filter/EpsReader.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/graph.hxx>
@@ -578,8 +579,7 @@ static void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
 //================== GraphicImport - the exported function ================
 
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
+bool ImportEpsGraphic( SvStream & rStream, Graphic & rGraphic)
 {
     if ( rStream.GetError() )
         return false;
diff --git a/vcl/workben/epsfuzzer.cxx b/vcl/workben/epsfuzzer.cxx
index effb05193aa1..1de2c63afe7c 100644
--- a/vcl/workben/epsfuzzer.cxx
+++ b/vcl/workben/epsfuzzer.cxx
@@ -10,6 +10,7 @@
 #include <tools/stream.hxx>
 #include <vcl/FilterConfigItem.hxx>
 #include "commonfuzzer.hxx"
+#include <filter/EpsReader.hxx>
 
 #include <config_features.h>
 #include <osl/detail/component-mapping.h>
@@ -48,8 +49,6 @@ extern "C" void* lo_get_custom_widget_func(const char*)
     return nullptr;
 }
 
-extern "C" bool ipsGraphicImport(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem);
-
 extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
 {
     TypicalFuzzerInitialize(argc, argv);
@@ -60,7 +59,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)ipsGraphicImport(aStream, aGraphic, nullptr);
+    (void)ImportEpsGraphic(aStream, aGraphic);
     return 0;
 }
 
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 893565e457d3..c6c2754d4dc6 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -48,6 +48,7 @@
 #include <filter/MetReader.hxx>
 #include <filter/RasReader.hxx>
 #include <filter/PcxReader.hxx>
+#include <filter/EpsReader.hxx>
 #include <osl/file.hxx>
 #include <osl/module.hxx>
 #include <tools/stream.hxx>
@@ -230,18 +231,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         }
         else if (strcmp(argv[2], "eps") == 0)
         {
-            static PFilterCall pfnImport(nullptr);
-            if (!pfnImport)
-            {
-                osl::Module aLibrary;
-                aLibrary.loadRelative(&thisModule, "libgielo.so");
-                pfnImport = reinterpret_cast<PFilterCall>(
-                    aLibrary.getFunctionSymbol("ipsGraphicImport"));
-                aLibrary.release();
-            }
             Graphic aGraphic;
             SvFileStream aFileStream(out, StreamMode::READ);
-            ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr));
+            ret = static_cast<int>(ImportEpsGraphic(aFileStream, aGraphic));
         }
         else if (strcmp(argv[2], "pct") == 0)
         {


More information about the Libreoffice-commits mailing list