[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 22 commits - compilerplugins/clang desktop/source drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library_drawinglayer.mk drawinglayer/Module_drawinglayer.mk drawinglayer/source emfio/CppunitTest_emfio_emf.mk emfio/Library_emfio.mk filter/CppunitTest_filter_dxf_test.mk filter/CppunitTest_filter_eps_test.mk filter/CppunitTest_filter_met_test.mk filter/CppunitTest_filter_pcd_test.mk filter/CppunitTest_filter_pcx_test.mk filter/CppunitTest_filter_ppm_test.mk filter/CppunitTest_filter_psd_test.mk filter/CppunitTest_filter_ras_test.mk filter/inc filter/Library_gie.mk filter/Library_pdffilter.mk filter/Library_svgfilter.mk filter/Module_filter.mk filter/qa filter/source include/basegfx include/drawinglayer include/o3tl include/svx include/vcl o3tl/qa Repository.mk sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sd/CppunitTest_sd_uimpress .mk sd/Library_sd.mk sd/source sfx2/Library_sfx.mk solenv/clang-format svgio/CppunitTest_svgio.mk svgio/Library_svgio.mk svx/CppunitTest_svx_unit.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/qa svx/source sw/CppunitTest_sw_uwriter.mk sw/Library_sw.mk sw/Library_swui.mk sw/source 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 03:07:57 UTC 2021


Rebased ref, commits from common ancestor:
commit 98ad3d34efe79b865cee9c885ffc7bc77c5beb0d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 16 10:35:11 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:07:11 2021 +0900

    vcl: move def. of peekGraphicFormat into GraphicFormatDetector
    
    Change-Id: I3b89009324f21b54ccf00f16eb47f9967a6b4e1f

diff --git a/vcl/inc/graphic/GraphicFormatDetector.hxx b/vcl/inc/graphic/GraphicFormatDetector.hxx
index b38561f790c3..f2f0393caeee 100644
--- a/vcl/inc/graphic/GraphicFormatDetector.hxx
+++ b/vcl/inc/graphic/GraphicFormatDetector.hxx
@@ -23,10 +23,19 @@
 #include <tools/stream.hxx>
 #include <vector>
 
-VCL_DLLPUBLIC bool peekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
-
 namespace vcl
 {
+/***
+ * This function is has two modes:
+ * - determine the file format when bTest = false
+ *   returns true, success
+ *   out rFormatExtension - on success: file format string
+ * - verify file format when bTest = true
+ *   returns false, if file type can't be verified
+ *           true, if the format is verified or the format is not known
+ */
+VCL_DLLPUBLIC bool peekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
+
 class VCL_DLLPUBLIC GraphicFormatDetector
 {
 public:
diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
index 1fb2fe0cb4ee..264a0e8cd48d 100644
--- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
+++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
@@ -83,7 +83,7 @@ void GraphicFormatDetectorTest::testDetectMET()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("MET"), rFormatExtension);
 }
 
@@ -98,7 +98,7 @@ void GraphicFormatDetectorTest::testDetectBMP()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("BMP"), rFormatExtension);
 }
 
@@ -113,7 +113,7 @@ void GraphicFormatDetectorTest::testDetectWMF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("WMF"), rFormatExtension);
 }
 
@@ -128,7 +128,7 @@ void GraphicFormatDetectorTest::testDetectPCX()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PCX"), rFormatExtension);
 }
 
@@ -143,7 +143,7 @@ void GraphicFormatDetectorTest::testDetectJPG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("JPG"), rFormatExtension);
 }
 
@@ -158,7 +158,7 @@ void GraphicFormatDetectorTest::testDetectPNG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PNG"), rFormatExtension);
 }
 
@@ -173,7 +173,7 @@ void GraphicFormatDetectorTest::testDetectGIF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("GIF"), rFormatExtension);
 }
 
@@ -188,7 +188,7 @@ void GraphicFormatDetectorTest::testDetectPSD()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PSD"), rFormatExtension);
 }
 
@@ -203,7 +203,7 @@ void GraphicFormatDetectorTest::testDetectTGA()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension("TGA"); // detection is based on extension only
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("TGA"), rFormatExtension);
 }
 
@@ -218,7 +218,7 @@ void GraphicFormatDetectorTest::testDetectTIF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("TIF"), rFormatExtension);
 }
 
@@ -233,7 +233,7 @@ void GraphicFormatDetectorTest::testDetectXBM()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("XBM"), rFormatExtension);
 }
 
@@ -248,7 +248,7 @@ void GraphicFormatDetectorTest::testDetectXPM()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("XPM"), rFormatExtension);
 }
 
@@ -263,7 +263,7 @@ void GraphicFormatDetectorTest::testDetectSVG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("SVG"), rFormatExtension);
 }
 
@@ -278,7 +278,7 @@ void GraphicFormatDetectorTest::testDetectSVGZ()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("SVG"), rFormatExtension);
 }
 
@@ -293,7 +293,7 @@ void GraphicFormatDetectorTest::testDetectPDF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PDF"), rFormatExtension);
 }
 
@@ -308,7 +308,7 @@ void GraphicFormatDetectorTest::testDetectEPS()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(vcl::peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("EPS"), rFormatExtension);
 }
 
diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx
index e5a1eb5f9a79..3ef78d475f59 100644
--- a/vcl/source/filter/GraphicFormatDetector.cxx
+++ b/vcl/source/filter/GraphicFormatDetector.cxx
@@ -28,6 +28,255 @@
 
 namespace vcl
 {
+bool peekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest)
+{
+    vcl::GraphicFormatDetector aDetector(rStream, rFormatExtension);
+    if (!aDetector.detect())
+        return false;
+
+    // The following variable is used when bTest == true. It remains false
+    // if the format (rFormatExtension) has not yet been set.
+    bool bSomethingTested = false;
+
+    // Now the different formats are checked. The order *does* matter. e.g. a MET file
+    // could also go through the BMP test, however, a BMP file can hardly go through the MET test.
+    // So MET should be tested prior to BMP. However, theoretically a BMP file could conceivably
+    // go through the MET test. These problems are of course not only in MET and BMP.
+    // Therefore, in the case of a format check (bTest == true)  we only test *exactly* this
+    // format. Everything else could have fatal consequences, for example if the user says it is
+    // a BMP file (and it is a BMP) file, and the file would go through the MET test ...
+
+    if (!bTest || rFormatExtension.startsWith("MET"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkMET())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("BMP"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkBMP())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("WMF") || rFormatExtension.startsWith("EMF"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkWMForEMF())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PCX"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPCX())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("TIF"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkTIF())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("GIF"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkGIF())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PNG"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPNG())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("JPG"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkJPG())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("SVM"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkSVM())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PCD"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPCD())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PSD"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPSD())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("EPS"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkEPS())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("DXF"))
+    {
+        if (aDetector.checkDXF())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PCT"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPCT())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PBM") || rFormatExtension.startsWith("PGM")
+        || rFormatExtension.startsWith("PPM"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkPBMorPGMorPPM())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("RAS"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkRAS())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest)
+    {
+        bSomethingTested = true;
+        if (aDetector.checkXPM())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+    else if (rFormatExtension.startsWith("XPM"))
+    {
+        return true;
+    }
+
+    if (!bTest)
+    {
+        if (aDetector.checkXBM())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+    else if (rFormatExtension.startsWith("XBM"))
+    {
+        return true;
+    }
+
+    if (!bTest)
+    {
+        if (aDetector.checkSVG())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+    else if (rFormatExtension.startsWith("SVG"))
+    {
+        return true;
+    }
+
+    if (!bTest || rFormatExtension.startsWith("TGA"))
+    {
+        bSomethingTested = true;
+        if (aDetector.checkTGA())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("MOV"))
+    {
+        if (aDetector.checkMOV())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    if (!bTest || rFormatExtension.startsWith("PDF"))
+    {
+        if (aDetector.checkPDF())
+        {
+            rFormatExtension = aDetector.msDetectedFormat;
+            return true;
+        }
+    }
+
+    return bTest && !bSomethingTested;
+}
+
 namespace
 {
 bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen)
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 7ee49825cda1..62ea4fcf081c 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -181,277 +181,13 @@ bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen)
     return false;
 }
 
-/***
- * This function is has two modes:
- * - determine the file format when bTest = false
- *   returns true, success
- *   out rFormatExtension - on success: file format string
- * - verify file format when bTest = true
- *   returns false, if file type can't be verified
- *           true, if the format is PROBABLY verified
- *                 or WHEN THE FORMAT IS NOT KNOWN!
- */
-bool peekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, bool bTest )
-{
-    vcl::GraphicFormatDetector aDetector(rStream, rFormatExtension);
-    if (!aDetector.detect())
-        return false;
-
-    // The following variable is used when bTest == true. It remains false
-    // if the format (rFormatExtension) has not yet been set.
-    bool bSomethingTested = false;
-
-    // Now the different formats are checked. The order *does* matter. e.g. a MET file
-    // could also go through the BMP test, however, a BMP file can hardly go through the MET test.
-    // So MET should be tested prior to BMP. However, theoretically a BMP file could conceivably
-    // go through the MET test. These problems are of course not only in MET and BMP.
-    // Therefore, in the case of a format check (bTest == true)  we only test *exactly* this
-    // format. Everything else could have fatal consequences, for example if the user says it is
-    // a BMP file (and it is a BMP) file, and the file would go through the MET test ...
-
-    if (!bTest || rFormatExtension.startsWith("MET"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkMET())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("BMP"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkBMP())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest ||
-        rFormatExtension.startsWith("WMF") ||
-        rFormatExtension.startsWith("EMF"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkWMForEMF())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PCX"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPCX())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("TIF"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkTIF())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("GIF"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkGIF())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PNG"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPNG())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("JPG"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkJPG())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("SVM"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkSVM())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PCD"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPCD())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PSD"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPSD())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("EPS"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkEPS())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("DXF"))
-    {
-        if (aDetector.checkDXF())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PCT"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPCT())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest ||
-        rFormatExtension.startsWith("PBM") ||
-        rFormatExtension.startsWith("PGM") ||
-        rFormatExtension.startsWith("PPM"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkPBMorPGMorPPM())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("RAS"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkRAS())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest)
-    {
-        bSomethingTested = true;
-        if (aDetector.checkXPM())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-
-    }
-    else if (rFormatExtension.startsWith("XPM"))
-    {
-        return true;
-    }
-
-    if (!bTest)
-    {
-        if (aDetector.checkXBM())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-    else if (rFormatExtension.startsWith("XBM"))
-    {
-        return true;
-    }
-
-    if (!bTest)
-    {
-        if (aDetector.checkSVG())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-    else if (rFormatExtension.startsWith("SVG"))
-    {
-        return true;
-    }
-
-    if (!bTest || rFormatExtension.startsWith("TGA"))
-    {
-        bSomethingTested = true;
-        if (aDetector.checkTGA())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("MOV"))
-    {
-        if (aDetector.checkMOV())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    if (!bTest || rFormatExtension.startsWith("PDF"))
-    {
-        if (aDetector.checkPDF())
-        {
-            rFormatExtension = aDetector.msDetectedFormat;
-            return true;
-        }
-    }
-
-    return bTest && !bSomethingTested;
-}
-
 ErrCode GraphicFilter::ImpTestOrFindFormat( const OUString& rPath, SvStream& rStream, sal_uInt16& rFormat )
 {
     // determine or check the filter/format by reading into it
     if( rFormat == GRFILTER_FORMAT_DONTKNOW )
     {
         OUString aFormatExt;
-        if( peekGraphicFormat( rStream, aFormatExt, false ) )
+        if (vcl::peekGraphicFormat(rStream, aFormatExt, false))
         {
             rFormat = pConfig->GetImportFormatNumberForExtension( aFormatExt );
             if( rFormat != GRFILTER_FORMAT_DONTKNOW )
@@ -471,7 +207,7 @@ ErrCode GraphicFilter::ImpTestOrFindFormat( const OUString& rPath, SvStream& rSt
     {
         OUString aTmpStr( pConfig->GetImportFormatExtension( rFormat ) );
         aTmpStr = aTmpStr.toAsciiUpperCase();
-        if( !peekGraphicFormat( rStream, aTmpStr, true ) )
+        if (!vcl::peekGraphicFormat(rStream, aTmpStr, true))
             return ERRCODE_GRFILTER_FORMATERROR;
         if ( pConfig->GetImportFormatExtension( rFormat ).equalsIgnoreAsciiCase( "pcd" ) )
         {
commit feabda968dfef5245efd1915ffedc4e4eb524921
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Feb 16 09:16:55 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:07:11 2021 +0900

    vcl: condense the description and rename the peek format function
    
    remove "Imp" from ImpPeekGraphicFormat function name and condense
    the description of the function.
    
    Change-Id: Ie7cc42645318c0035f082ae68087ca3c7077d365

diff --git a/vcl/inc/graphic/GraphicFormatDetector.hxx b/vcl/inc/graphic/GraphicFormatDetector.hxx
index e914ee64a3ca..b38561f790c3 100644
--- a/vcl/inc/graphic/GraphicFormatDetector.hxx
+++ b/vcl/inc/graphic/GraphicFormatDetector.hxx
@@ -23,7 +23,7 @@
 #include <tools/stream.hxx>
 #include <vector>
 
-VCL_DLLPUBLIC bool ImpPeekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
+VCL_DLLPUBLIC bool peekGraphicFormat(SvStream& rStream, OUString& rFormatExtension, bool bTest);
 
 namespace vcl
 {
diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
index f4f4698b28a9..1fb2fe0cb4ee 100644
--- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
+++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx
@@ -83,7 +83,7 @@ void GraphicFormatDetectorTest::testDetectMET()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("MET"), rFormatExtension);
 }
 
@@ -98,7 +98,7 @@ void GraphicFormatDetectorTest::testDetectBMP()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("BMP"), rFormatExtension);
 }
 
@@ -113,7 +113,7 @@ void GraphicFormatDetectorTest::testDetectWMF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("WMF"), rFormatExtension);
 }
 
@@ -128,7 +128,7 @@ void GraphicFormatDetectorTest::testDetectPCX()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PCX"), rFormatExtension);
 }
 
@@ -143,7 +143,7 @@ void GraphicFormatDetectorTest::testDetectJPG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("JPG"), rFormatExtension);
 }
 
@@ -158,7 +158,7 @@ void GraphicFormatDetectorTest::testDetectPNG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PNG"), rFormatExtension);
 }
 
@@ -173,7 +173,7 @@ void GraphicFormatDetectorTest::testDetectGIF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("GIF"), rFormatExtension);
 }
 
@@ -188,7 +188,7 @@ void GraphicFormatDetectorTest::testDetectPSD()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PSD"), rFormatExtension);
 }
 
@@ -203,7 +203,7 @@ void GraphicFormatDetectorTest::testDetectTGA()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension("TGA"); // detection is based on extension only
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("TGA"), rFormatExtension);
 }
 
@@ -218,7 +218,7 @@ void GraphicFormatDetectorTest::testDetectTIF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("TIF"), rFormatExtension);
 }
 
@@ -233,7 +233,7 @@ void GraphicFormatDetectorTest::testDetectXBM()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("XBM"), rFormatExtension);
 }
 
@@ -248,7 +248,7 @@ void GraphicFormatDetectorTest::testDetectXPM()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("XPM"), rFormatExtension);
 }
 
@@ -263,7 +263,7 @@ void GraphicFormatDetectorTest::testDetectSVG()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("SVG"), rFormatExtension);
 }
 
@@ -278,7 +278,7 @@ void GraphicFormatDetectorTest::testDetectSVGZ()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("SVG"), rFormatExtension);
 }
 
@@ -293,7 +293,7 @@ void GraphicFormatDetectorTest::testDetectPDF()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("PDF"), rFormatExtension);
 }
 
@@ -308,7 +308,7 @@ void GraphicFormatDetectorTest::testDetectEPS()
     aFileStream.Seek(aDetector.mnStreamPosition);
 
     OUString rFormatExtension;
-    CPPUNIT_ASSERT(ImpPeekGraphicFormat(aFileStream, rFormatExtension, false));
+    CPPUNIT_ASSERT(peekGraphicFormat(aFileStream, rFormatExtension, false));
     CPPUNIT_ASSERT_EQUAL(OUString("EPS"), rFormatExtension);
 }
 
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 782fa735da8a..7ee49825cda1 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -181,34 +181,17 @@ bool isPCT(SvStream& rStream, sal_uLong nStreamPos, sal_uLong nStreamLen)
     return false;
 }
 
-/*************************************************************************
- *
- *    ImpPeekGraphicFormat()
- *
- *    Description:
- *        This function is two-fold:
- *        1.) Start reading file, determine the file format:
- *            Input parameters:
- *              rPath            - file path
- *              rFormatExtension - content matter
- *              bTest            - set false
- *            Output parameters:
- *              Return value     - true if success
- *              rFormatExtension - on success: normal file extension in capitals
- *        2.) Start reading file, verify file format
- *            Input parameters:
- *              rPath            - file path
- *              rFormatExtension - normal file extension in capitals
- *              bTest            - set true
- *            Output parameters:
- *              Return value    - false, if cannot verify the file type
- *                                  passed to the function
- *                                 true, when the format is PROBABLY verified or
- *                                 WHEN THE FORMAT IS NOT KNOWN!
- *
- *************************************************************************/
-
-bool ImpPeekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, bool bTest )
+/***
+ * This function is has two modes:
+ * - determine the file format when bTest = false
+ *   returns true, success
+ *   out rFormatExtension - on success: file format string
+ * - verify file format when bTest = true
+ *   returns false, if file type can't be verified
+ *           true, if the format is PROBABLY verified
+ *                 or WHEN THE FORMAT IS NOT KNOWN!
+ */
+bool peekGraphicFormat( SvStream& rStream, OUString& rFormatExtension, bool bTest )
 {
     vcl::GraphicFormatDetector aDetector(rStream, rFormatExtension);
     if (!aDetector.detect())
@@ -468,7 +451,7 @@ ErrCode GraphicFilter::ImpTestOrFindFormat( const OUString& rPath, SvStream& rSt
     if( rFormat == GRFILTER_FORMAT_DONTKNOW )
     {
         OUString aFormatExt;
-        if( ImpPeekGraphicFormat( rStream, aFormatExt, false ) )
+        if( peekGraphicFormat( rStream, aFormatExt, false ) )
         {
             rFormat = pConfig->GetImportFormatNumberForExtension( aFormatExt );
             if( rFormat != GRFILTER_FORMAT_DONTKNOW )
@@ -488,7 +471,7 @@ ErrCode GraphicFilter::ImpTestOrFindFormat( const OUString& rPath, SvStream& rSt
     {
         OUString aTmpStr( pConfig->GetImportFormatExtension( rFormat ) );
         aTmpStr = aTmpStr.toAsciiUpperCase();
-        if( !ImpPeekGraphicFormat( rStream, aTmpStr, true ) )
+        if( !peekGraphicFormat( rStream, aTmpStr, true ) )
             return ERRCODE_GRFILTER_FORMATERROR;
         if ( pConfig->GetImportFormatExtension( rFormat ).equalsIgnoreAsciiCase( "pcd" ) )
         {
commit 5a1d5f7c758a46518f2c3a596e2750474dee499d
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 17:49:34 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:07:09 2021 +0900

    vcl: clean-up code used for loading of external graphic filters
    
    All graphic filters have been moved into vcl, so there is no need
    to load an external library that contained graphic filters, so
    this code can be removed.
    
    Change-Id: Iac4f8dd78464e142f50837a55edd2d25720b8c13

diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index 411d44a5801d..482b8fed2ca0 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -55,39 +55,18 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameL
     IMP_EPS, EXP_EPS, nullptr
 };
 
-const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
-{
-   nullptr
-};
-
 void FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString& rUserDataEntry )
 {
-    bIsPixelFormat = bIsInternalFilter = false;
+    bIsPixelFormat = false;
     sFilterName = rUserDataEntry;
     const char** pPtr;
-    for ( pPtr = InternalPixelFilterNameList; *pPtr && !bIsInternalFilter; pPtr++ )
+    for ( pPtr = InternalPixelFilterNameList; *pPtr; pPtr++ )
     {
         if ( sFilterName.equalsIgnoreAsciiCaseAscii( *pPtr ) )
         {
-            bIsInternalFilter = true;
             bIsPixelFormat = true;
         }
     }
-    for ( pPtr = InternalVectorFilterNameList; *pPtr && !bIsInternalFilter; pPtr++ )
-    {
-        if ( sFilterName.equalsIgnoreAsciiCaseAscii( *pPtr ) )
-            bIsInternalFilter = true;
-    }
-    if ( !bIsInternalFilter )
-    {
-        for ( pPtr = ExternalPixelFilterNameList; *pPtr && !bIsPixelFormat; pPtr++ )
-        {
-            if ( sFilterName.equalsIgnoreAsciiCaseAscii( *pPtr ) )
-                bIsPixelFormat = true;
-        }
-        sExternalFilterName = sFilterName;
-        sFilterName = SVLIBRARY("gie");
-    }
 }
 
 OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName()
@@ -400,21 +379,6 @@ OUString FilterConfigCache::GetImportFilterTypeName( sal_uInt16 nFormat )
     return OUString();
 }
 
-OUString FilterConfigCache::GetExternalFilterName(sal_uInt16 nFormat, bool bExport)
-{
-    if (bExport)
-    {
-        if (nFormat < aExport.size())
-            return aExport[nFormat].sExternalFilterName;
-    }
-    else
-    {
-        if (nFormat < aImport.size())
-            return aImport[nFormat].sExternalFilterName;
-    }
-    return OUString();
-}
-
 OUString FilterConfigCache::GetImportWildcard(sal_uInt16 nFormat, sal_Int32 nEntry)
 {
     OUString aWildcard( GetImportFormatExtension( nFormat, nEntry ) );
@@ -423,11 +387,6 @@ OUString FilterConfigCache::GetImportWildcard(sal_uInt16 nFormat, sal_Int32 nEnt
     return aWildcard;
 }
 
-bool FilterConfigCache::IsImportInternalFilter( sal_uInt16 nFormat )
-{
-    return (nFormat < aImport.size()) && aImport[ nFormat ].bIsInternalFilter;
-}
-
 OUString FilterConfigCache::GetExportFilterName( sal_uInt16 nFormat )
 {
     if( nFormat < aExport.size() )
@@ -526,11 +485,6 @@ OUString FilterConfigCache::GetExportWildcard( sal_uInt16 nFormat, sal_Int32 nEn
     return aWildcard;
 }
 
-bool FilterConfigCache::IsExportInternalFilter( sal_uInt16 nFormat )
-{
-    return (nFormat < aExport.size()) && aExport[ nFormat ].bIsInternalFilter;
-}
-
 bool FilterConfigCache::IsExportPixelFormat( sal_uInt16 nFormat )
 {
     return (nFormat < aExport.size()) && aExport[ nFormat ].bIsPixelFormat;
diff --git a/vcl/source/filter/FilterConfigCache.hxx b/vcl/source/filter/FilterConfigCache.hxx
index 4860bbc6f38b..e6b0258bf803 100644
--- a/vcl/source/filter/FilterConfigCache.hxx
+++ b/vcl/source/filter/FilterConfigCache.hxx
@@ -32,7 +32,6 @@ class FilterConfigCache
         OUString sType;
         std::vector< OUString > lExtensionList;
         OUString sUIName;
-        OUString sExternalFilterName;
 
         OUString sMediaType;
         OUString sFilterType;
@@ -41,7 +40,6 @@ class FilterConfigCache
 
         // user data
         OUString        sFilterName;
-        bool        bIsInternalFilter   : 1;
         bool        bIsPixelFormat      : 1;
 
         void            CreateFilterName( const OUString& rUserDataEntry );
@@ -49,7 +47,6 @@ class FilterConfigCache
 
         static const char* InternalPixelFilterNameList[];
         static const char* InternalVectorFilterNameList[];
-        static const char* ExternalPixelFilterNameList[];
     };
 
 
@@ -77,7 +74,6 @@ public:
     OUString    GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry );
     OUString    GetImportFilterType( sal_uInt16 nFormat );
     OUString    GetImportFilterTypeName( sal_uInt16 nFormat );
-    OUString    GetExternalFilterName(sal_uInt16 nFormat, bool bExport);
 
 
     bool    IsImportInternalFilter( sal_uInt16 nFormat );
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 64d96c6c107b..782fa735da8a 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -599,131 +599,6 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
     return aGraphic;
 }
 
-static OUString ImpCreateFullFilterPath( const OUString& rPath, std::u16string_view rFilterName )
-{
-    OUString aPathURL;
-
-    ::osl::FileBase::getFileURLFromSystemPath( rPath, aPathURL );
-    aPathURL += "/";
-
-    OUString aSystemPath;
-    ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath );
-    aSystemPath += rFilterName;
-
-    return aSystemPath;
-}
-
-namespace {
-
-class ImpFilterLibCache;
-
-struct ImpFilterLibCacheEntry
-{
-    ImpFilterLibCacheEntry* mpNext;
-#ifndef DISABLE_DYNLOADING
-    osl::Module             maLibrary;
-#endif
-    OUString                maFiltername;
-    OUString                maFormatName;
-    PFilterCall             mpfnImport;
-
-    ImpFilterLibCacheEntry(const OUString& rPathname, const OUString& rFiltername, const OUString& rFormatName);
-    bool                    operator==( std::u16string_view rFiltername ) const { return maFiltername == rFiltername; }
-
-    PFilterCall             GetImportFunction();
-};
-
-}
-
-ImpFilterLibCacheEntry::ImpFilterLibCacheEntry( const OUString& rPathname, const OUString& rFiltername, const OUString& rFormatName ) :
-        mpNext          ( nullptr ),
-#ifndef DISABLE_DYNLOADING
-        maLibrary       ( rPathname ),
-#endif
-        maFiltername    ( rFiltername ),
-        maFormatName    ( rFormatName ),
-        mpfnImport      ( nullptr )
-{
-#ifdef DISABLE_DYNLOADING
-    (void) rPathname;
-#endif
-}
-
-PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
-{
-    return nullptr;
-}
-
-namespace {
-
-class ImpFilterLibCache
-{
-    ImpFilterLibCacheEntry* mpFirst;
-    ImpFilterLibCacheEntry* mpLast;
-
-public:
-                            ImpFilterLibCache();
-                            ~ImpFilterLibCache();
-
-    ImpFilterLibCacheEntry* GetFilter( const OUString& rFilterPath, const OUString& rFiltername, const OUString& rFormatName );
-};
-
-}
-
-ImpFilterLibCache::ImpFilterLibCache() :
-    mpFirst     ( nullptr ),
-    mpLast      ( nullptr )
-{
-}
-
-ImpFilterLibCache::~ImpFilterLibCache()
-{
-    ImpFilterLibCacheEntry* pEntry = mpFirst;
-    while( pEntry )
-    {
-        ImpFilterLibCacheEntry* pNext = pEntry->mpNext;
-        delete pEntry;
-        pEntry = pNext;
-    }
-}
-
-ImpFilterLibCacheEntry* ImpFilterLibCache::GetFilter(const OUString& rFilterPath, const OUString& rFilterName, const OUString& rFormatName)
-{
-    ImpFilterLibCacheEntry* pEntry = mpFirst;
-
-    while( pEntry )
-    {
-        if( *pEntry == rFilterName && pEntry->maFormatName == rFormatName )
-            break;
-        else
-            pEntry = pEntry->mpNext;
-    }
-    if( !pEntry )
-    {
-        OUString aPhysicalName( ImpCreateFullFilterPath( rFilterPath, rFilterName ) );
-        pEntry = new ImpFilterLibCacheEntry(aPhysicalName, rFilterName, rFormatName );
-#ifndef DISABLE_DYNLOADING
-        if ( pEntry->maLibrary.is() )
-#endif
-        {
-            if( !mpFirst )
-                mpFirst = mpLast = pEntry;
-            else
-                mpLast = mpLast->mpNext = pEntry;
-        }
-#ifndef DISABLE_DYNLOADING
-        else
-        {
-            delete pEntry;
-            pEntry = nullptr;
-        }
-#endif
-    }
-    return pEntry;
-};
-
-namespace { struct Cache : public rtl::Static<ImpFilterLibCache, Cache> {}; }
-
 GraphicFilter::GraphicFilter( bool bConfig )
     : bUseConfig(bConfig)
 {
@@ -1149,13 +1024,11 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
         nStreamLength = sizeLimit;
 
     OUString aFilterName = pConfig->GetImportFilterName(nFormat);
-    OUString aExternalFilterName = pConfig->GetExternalFilterName(nFormat, false);
 
     std::unique_ptr<sal_uInt8[]> pGraphicContent;
     sal_Int32 nGraphicContentSize = 0;
 
     // read graphic
-    if (pConfig->IsImportInternalFilter(nFormat))
     {
         if (aFilterName.equalsIgnoreAsciiCase(IMP_GIF))
         {
@@ -1294,30 +1167,6 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
         }
     }
-    else
-    {
-        ImpFilterLibCacheEntry* pFilter = nullptr;
-
-        if (!aFilterPath.isEmpty())
-        {
-            // find first filter in filter paths
-            ImpFilterLibCache &rCache = Cache::get();
-            sal_Int32 nIdx{0};
-            do {
-                pFilter = rCache.GetFilter(aFilterPath.getToken(0, ';', nIdx), aFilterName, aExternalFilterName);
-            } while (nIdx>=0 && pFilter==nullptr);
-        }
-
-        if( !pFilter )
-            nStatus = ERRCODE_GRFILTER_FILTERERROR;
-        else
-        {
-            PFilterCall pFunc = pFilter->GetImportFunction();
-
-            if (!pFunc)
-                nStatus = ERRCODE_GRFILTER_FILTERERROR;
-        }
-    }
 
     if (nStatus == ERRCODE_NONE && eLinkType != GfxLinkType::NONE)
     {
@@ -1735,7 +1584,6 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
                                      WmfExternal const *pExtHeader )
 {
     OUString aFilterName;
-    OUString aExternalFilterName;
     sal_uLong  nStreamBegin;
     ErrCode nStatus;
     GfxLinkType eLinkType = GfxLinkType::NONE;
@@ -1777,7 +1625,6 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
             *pDeterminedFormat = nFormat;
 
         aFilterName = pConfig->GetImportFilterName( nFormat );
-        aExternalFilterName = pConfig->GetExternalFilterName(nFormat, false);
     }
     else
     {
@@ -1788,7 +1635,6 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
     }
 
     // read graphic
-    if ( pConfig->IsImportInternalFilter( nFormat ) )
     {
         if (aFilterName.equalsIgnoreAsciiCase(IMP_GIF))
         {
@@ -1885,35 +1731,6 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
         else
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
     }
-    else
-    {
-        ImpFilterLibCacheEntry* pFilter = nullptr;
-
-        if (!aFilterPath.isEmpty())
-        {
-            // find first filter in filter paths
-            ImpFilterLibCache &rCache = Cache::get();
-            sal_Int32 nIdx{0};
-            do {
-                pFilter = rCache.GetFilter(aFilterPath.getToken(0, ';', nIdx), aFilterName, aExternalFilterName);
-            } while (nIdx>=0 && pFilter==nullptr);
-        }
-
-        if( !pFilter )
-            nStatus = ERRCODE_GRFILTER_FILTERERROR;
-        else
-        {
-            PFilterCall pFunc = pFilter->GetImportFunction();
-
-            if( !pFunc )
-                nStatus = ERRCODE_GRFILTER_FILTERERROR;
-            else
-            {
-                if( !(*pFunc)( rIStream, rGraphic, nullptr ) )
-                    nStatus = ERRCODE_GRFILTER_FORMATERROR;
-            }
-        }
-    }
 
     if( nStatus == ERRCODE_NONE && ( eLinkType != GfxLinkType::NONE ) && !rGraphic.GetReaderContext() && !bLinkSet )
     {
@@ -2049,7 +1866,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
         nStatus = ERRCODE_GRFILTER_IOERROR;
     if( ERRCODE_NONE == nStatus )
     {
-        if ( pConfig->IsExportInternalFilter( nFormat ) )
         {
             if( aFilterName.equalsIgnoreAsciiCase( EXP_BMP ) )
             {
commit fa27ca526aaea40c5f4cb584fc73b5d1bb7febf2
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 12:30:25 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:06:13 2021 +0900

    Move GIF writer from filter module into VCL
    
    Change-Id: I8db3ca0f7953b44791bda47534220902931fab8d

diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx
index 95c8184009d7..c72ccc9dd488 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -189,9 +189,6 @@ bool ConstParams::CheckTraverseFunctionDecl(FunctionDecl * functionDecl)
             || name.startswith("Read_F_")
                 // UNO component entry points
             || name.endswith("component_getFactory")
-            || name == "egiGraphicExport"
-            || name == "etiGraphicExport"
-            || name == "epsGraphicExport"
             // callback for some external code?
             || name == "ScAddInAsyncCallBack"
             // used as function pointers
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
deleted file mode 100644
index b40da250a183..000000000000
--- a/filter/Library_gie.mk
+++ /dev/null
@@ -1,56 +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/.
-#
-# 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 .
-#
-
-$(eval $(call gb_Library_Library,gie))
-
-$(eval $(call gb_Library_set_include,gie,\
-    $$(INCLUDE) \
-    -I$(SRCDIR)/filter/inc \
-))
-
-$(eval $(call gb_Library_use_external,gie,boost_headers))
-
-$(eval $(call gb_Library_use_sdk_api,gie))
-
-$(eval $(call gb_Library_use_custom_headers,gie,\
-	officecfg/registry \
-))
-
-$(eval $(call gb_Library_use_common_precompiled_header,gie))
-
-$(eval $(call gb_Library_use_libraries,gie,\
-    basegfx \
-    comphelper \
-    i18nlangtag \
-    svt \
-    vcl \
-    utl \
-    tl \
-    tk \
-    cppu \
-    sal \
-    salhelper \
-))
-
-$(eval $(call gb_Library_add_exception_objects,gie,\
-    filter/source/graphicfilter/egif/egif \
-    filter/source/graphicfilter/egif/giflzwc \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 2fb2e4c0c8e3..42a82bacf5c0 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -21,7 +21,6 @@ $(eval $(call gb_Module_Module,filter))
 $(eval $(call gb_Module_add_targets,filter,\
 	Configuration_filter \
 	CustomTarget_svg \
-    Library_gie \
 	Library_filterconfig \
     Library_icg \
 	Library_msfilter \
diff --git a/filter/source/config/fragments/internalgraphicfilters/gif_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/gif_Export.xcu
index 7f021c1b9a7f..f55d1ba55385 100644
--- a/filter/source/config/fragments/internalgraphicfilters/gif_Export.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/gif_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="gif_Export" oor:op="replace"  >
-        <prop oor:name="Type"><value>gif_Graphics_Interchange</value></prop>
-        <prop oor:name="FormatName"><value>egi</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">GIF - Graphics Interchange Format</value>
-        </prop>
-        <prop oor:name="Flags"><value>EXPORT</value></prop>
-    </node>
+
+<node oor:name="gif_Export" oor:op="replace"  >
+    <prop oor:name="Type"><value>gif_Graphics_Interchange</value></prop>
+    <prop oor:name="FormatName"><value>SVEGIF</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">GIF - Graphics Interchange Format</value>
+    </prop>
+    <prop oor:name="Flags"><value>EXPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index a116a5085619..b9de5bb85de5 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -100,6 +100,7 @@ namespace o3tl
 #define EXP_PNG                 "SVEPNG"
 #define EXP_TIFF                "SVTIFF"
 #define EXP_EPS                 "SVEEPS"
+#define EXP_GIF                 "SVEGIF"
 
 
 #define BMP_SHORTNAME           u"BMP"
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 4b3e68b22373..bb574d63a478 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3923,9 +3923,6 @@ filter/source/config/cache/typedetection.cxx
 filter/source/config/cache/typedetection.hxx
 filter/source/graphic/GraphicExportFilter.cxx
 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/icgm/actimpr.cxx
 filter/source/graphicfilter/icgm/bitmap.cxx
 filter/source/graphicfilter/icgm/bitmap.hxx
@@ -14905,6 +14902,9 @@ vcl/source/filter/FilterConfigCache.hxx
 vcl/source/filter/FilterConfigItem.cxx
 vcl/source/filter/graphicfilter.cxx
 vcl/source/filter/graphicfilter2.cxx
+vcl/source/filter/egif/egif.cxx
+vcl/source/filter/egif/giflzwc.cxx
+vcl/source/filter/egif/giflzwc.hxx
 vcl/source/filter/eps/eps.cxx
 vcl/source/filter/etiff/etiff.cxx
 vcl/source/filter/idxf/dxf2mtf.cxx
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index bea21fee0867..0c37cf54684b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -427,6 +427,8 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/components/dtranscomp \
     vcl/source/components/factory \
     vcl/source/components/fontident \
+    vcl/source/filter/egif/egif \
+    vcl/source/filter/egif/giflzwc \
     vcl/source/filter/eps/eps \
     vcl/source/filter/etiff/etiff \
     vcl/source/filter/FilterConfigCache \
diff --git a/vcl/inc/filter/GifWriter.hxx b/vcl/inc/filter/GifWriter.hxx
new file mode 100644
index 000000000000..6512c4bf6f2f
--- /dev/null
+++ b/vcl/inc/filter/GifWriter.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 ExportGifGraphic(SvStream& rStream, Graphic& rGraphic,
+                                    FilterConfigItem* pFilterConfigItem);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index d8ab4d44e0a8..411d44a5801d 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -41,10 +41,11 @@ using namespace ::com::sun::star::configuration ;
 
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalPixelFilterNameList[] =
 {
-    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, IMP_PSD,
-    IMP_PCD, IMP_PBM, IMP_DXF, nullptr
+    IMP_BMP, IMP_GIF, IMP_PNG, IMP_JPEG, IMP_TIFF,
+    IMP_XBM, IMP_XPM, IMP_TGA, IMP_PICT, IMP_MET, IMP_RAS,
+    IMP_PCX, IMP_MOV, IMP_PSD, IMP_PCD,  IMP_PBM, IMP_DXF,
+    EXP_BMP, EXP_GIF, EXP_PNG, EXP_JPEG, EXP_TIFF,
+    nullptr
 };
 
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
@@ -56,7 +57,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameL
 
 const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
 {
-    "egi", "epb", "epg", "epp", nullptr
+   nullptr
 };
 
 void FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString& rUserDataEntry )
@@ -225,7 +226,7 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
     "eps","1","SVIEPS",
     "eps","2","SVEEPS",
     "gif","1","SVIGIF",
-    "gif","2","egi",
+    "gif","2","SVEGIF",
     "jpg","1","SVIJPEG",
     "jpg","2","SVEJPEG",
     "mov","1","SVMOV",
diff --git a/filter/source/graphicfilter/egif/egif.cxx b/vcl/source/filter/egif/egif.cxx
similarity index 99%
rename from filter/source/graphicfilter/egif/egif.cxx
rename to vcl/source/filter/egif/egif.cxx
index 7a70d337e6c5..bfd41d952b4c 100644
--- a/filter/source/graphicfilter/egif/egif.cxx
+++ b/vcl/source/filter/egif/egif.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/task/XStatusIndicator.hpp>
 #include "giflzwc.hxx"
 #include <memory>
+#include <filter/GifWriter.hxx>
 
 namespace {
 
@@ -539,8 +540,7 @@ void GIFWriter::WriteTerminator()
 }
 
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-egiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem )
+bool ExportGifGraphic(SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem)
 {
     GIFWriter aWriter(rStream);
     return aWriter.WriteGIF(rGraphic, pConfigItem);
diff --git a/filter/source/graphicfilter/egif/giflzwc.cxx b/vcl/source/filter/egif/giflzwc.cxx
similarity index 100%
rename from filter/source/graphicfilter/egif/giflzwc.cxx
rename to vcl/source/filter/egif/giflzwc.cxx
diff --git a/filter/source/graphicfilter/egif/giflzwc.hxx b/vcl/source/filter/egif/giflzwc.hxx
similarity index 100%
rename from filter/source/graphicfilter/egif/giflzwc.hxx
rename to vcl/source/filter/egif/giflzwc.hxx
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 639ce7dc4ddd..64d96c6c107b 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -60,6 +60,7 @@
 #include <filter/PcdReader.hxx>
 #include <filter/PbmReader.hxx>
 #include <filter/DxfReader.hxx>
+#include <filter/GifWriter.hxx>
 #include <osl/module.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/Size.hpp>
@@ -1978,12 +1979,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObje
     return nRetValue;
 }
 
-#ifdef DISABLE_DYNLOADING
-
-extern "C" bool egiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-
-#endif
-
 ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& rPath,
     SvStream& rOStm, sal_uInt16 nFormat, const css::uno::Sequence< css::beans::PropertyValue >* pFilterData )
 {
@@ -2011,7 +2006,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
 
     FilterConfigItem aConfigItem( pFilterData );
     OUString aFilterName( pConfig->GetExportFilterName( nFormat ) );
-    OUString aExternalFilterName(pConfig->GetExternalFilterName(nFormat, true));
     ErrCode     nStatus = ERRCODE_NONE;
     GraphicType eType;
     Graphic     aGraphic = ImpGetScaledGraphic( rGraphic, aConfigItem );
@@ -2073,7 +2067,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
                 if( rOStm.GetError() )
                     nStatus = ERRCODE_GRFILTER_IOERROR;
             }
-            if (aFilterName.equalsIgnoreAsciiCase(EXP_TIFF))
+            else if (aFilterName.equalsIgnoreAsciiCase(EXP_TIFF))
             {
                 if (!ExportTiffGraphicImport(rOStm, aGraphic, &aConfigItem))
                     nStatus = ERRCODE_GRFILTER_FORMATERROR;
@@ -2081,6 +2075,14 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
                 if( rOStm.GetError() )
                     nStatus = ERRCODE_GRFILTER_IOERROR;
             }
+            else if (aFilterName.equalsIgnoreAsciiCase(EXP_GIF))
+            {
+                if (!ExportGifGraphic(rOStm, aGraphic, &aConfigItem))
+                    nStatus = ERRCODE_GRFILTER_FORMATERROR;
+
+                if( rOStm.GetError() )
+                    nStatus = ERRCODE_GRFILTER_IOERROR;
+            }
             else if( aFilterName.equalsIgnoreAsciiCase( EXP_SVMETAFILE ) )
             {
                 sal_Int32 nVersion = aConfigItem.ReadInt32( "Version", 0 ) ;
@@ -2306,35 +2308,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
             else
                 nStatus = ERRCODE_GRFILTER_FILTERERROR;
         }
-        else
-        {
-            sal_Int32 nIdx {aFilterPath.isEmpty() ? -1 : 0};
-            while (nIdx>=0)
-            {
-#ifndef DISABLE_DYNLOADING
-                OUString aPhysicalName( ImpCreateFullFilterPath( aFilterPath.getToken(0, ';', nIdx), aFilterName ) );
-                osl::Module aLibrary( aPhysicalName );
-
-                PFilterCall pFunc = nullptr;
-                if (aExternalFilterName == "egi")
-                    pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("egiGraphicExport"));
-                 // Execute dialog in DLL
- #else
-                --nIdx; // Just one iteration
-                PFilterCall pFunc = NULL;
-                if (aExternalFilterName == "egi")
-                    pFunc = egiGraphicExport;
- #endif
-                if( pFunc )
-                {
-                    if ( !(*pFunc)( rOStm, aGraphic, &aConfigItem ) )
-                        nStatus = ERRCODE_GRFILTER_FORMATERROR;
-                    break;
-                }
-                else
-                    nStatus = ERRCODE_GRFILTER_FILTERERROR;
-            }
-        }
     }
     if( nStatus != ERRCODE_NONE )
     {
commit f4dfc8aecbb6ff1565ff67e0bf34c9fbaf149409
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 11:35:38 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:06:12 2021 +0900

    Move DXF reader from filter module into VCL
    
    Change-Id: If1a933256401c1a971f581d1b389ca06fd77eaae

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 95e76de18cdb..b400c24ab55c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6276,9 +6276,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
                     InitVCL();
                 }
 
-                // pre-load all graphic libraries.
-                GraphicFilter::GetGraphicFilter().preload();
-
                 // pre-load all component libraries.
                 if (!xContext.is())
                     throw css::uno::DeploymentException("preInit: XComponentContext is not created");
diff --git a/filter/CppunitTest_filter_dxf_test.mk b/filter/CppunitTest_filter_dxf_test.mk
deleted file mode 100644
index 4a10c1845cef..000000000000
--- a/filter/CppunitTest_filter_dxf_test.mk
+++ /dev/null
@@ -1,39 +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_dxf_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_dxf_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_dxf_test, \
-    filter/qa/cppunit/filters-dxf-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_dxf_test, \
-	gie \
-	sal \
-	test \
-	tl \
-	unotest \
-	vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_dxf_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_dxf_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_dxf_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_dxf_test,\
-    configmgr/source/configmgr \
-    i18npool/util/i18npool \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_dxf_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index e04eb08fda7f..b40da250a183 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -51,14 +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/idxf/dxf2mtf \
-    filter/source/graphicfilter/idxf/dxfblkrd \
-    filter/source/graphicfilter/idxf/dxfentrd \
-    filter/source/graphicfilter/idxf/dxfgrprd \
-    filter/source/graphicfilter/idxf/dxfreprd \
-    filter/source/graphicfilter/idxf/dxftblrd \
-    filter/source/graphicfilter/idxf/dxfvec \
-    filter/source/graphicfilter/idxf/idxf \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 607a5fc46d0c..2fb2e4c0c8e3 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -55,7 +55,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_svg \
 ))
 endif
diff --git a/filter/source/config/fragments/internalgraphicfilters/dxf_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/dxf_Import.xcu
index 1ab3279bd809..d4ce34e28b1e 100644
--- a/filter/source/config/fragments/internalgraphicfilters/dxf_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/dxf_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="dxf_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>dxf_AutoCAD_Interchange</value></prop>
-        <prop oor:name="FormatName"><value>idx</value></prop>
-        <prop oor:name="RealFilterName"><value>DXF - AutoCAD Interchange</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">DXF - AutoCAD Interchange Format</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="dxf_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>dxf_AutoCAD_Interchange</value></prop>
+    <prop oor:name="FormatName"><value>SVDXF</value></prop>
+    <prop oor:name="RealFilterName"><value>DXF - AutoCAD Interchange</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">DXF - AutoCAD Interchange Format</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index f0d0511aac97..a116a5085619 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -88,6 +88,8 @@ namespace o3tl
 #define IMP_PSD                 "SVPSD"
 #define IMP_PCD                 "SVPCD"
 #define IMP_PBM                 "SVPBM"
+#define IMP_DXF                 "SVDXF"
+
 #define EXP_BMP                 "SVBMP"
 #define EXP_SVMETAFILE          "SVMETAFILE"
 #define EXP_WMF                 "SVWMF"
@@ -350,8 +352,6 @@ public:
 
     ErrCode         compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream);
 
-    void preload();
-
     static ErrCode readGIF(SvStream& rStream, Graphic& rGraphic, GfxLinkType& rLinkType);
     static ErrCode readPNG(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType,
                     std::unique_ptr<sal_uInt8[]> & rpGraphicContent, sal_Int32& rGraphicContentSize);
@@ -379,6 +379,7 @@ public:
     static ErrCode readPSD(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readPCD(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readPBM(SvStream & rStream, Graphic & rGraphic);
+    static ErrCode readDXF(SvStream & rStream, Graphic & rGraphic);
 
 private:
     OUString        aFilterPath;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 03fe8e0d3c52..4b3e68b22373 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3897,7 +3897,6 @@ external/unixODBC/inc/odbc/sqlext.h
 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/msfilter-test.cxx
 filter/qa/cppunit/priority-test.cxx
 filter/qa/cppunit/xslt-test.cxx
@@ -3948,21 +3947,6 @@ filter/source/graphicfilter/icgm/classx.cxx
 filter/source/graphicfilter/icgm/elements.cxx
 filter/source/graphicfilter/icgm/elements.hxx
 filter/source/graphicfilter/icgm/outact.hxx
-filter/source/graphicfilter/idxf/dxf2mtf.cxx
-filter/source/graphicfilter/idxf/dxf2mtf.hxx
-filter/source/graphicfilter/idxf/dxfblkrd.cxx
-filter/source/graphicfilter/idxf/dxfblkrd.hxx
-filter/source/graphicfilter/idxf/dxfentrd.cxx
-filter/source/graphicfilter/idxf/dxfentrd.hxx
-filter/source/graphicfilter/idxf/dxfgrprd.cxx
-filter/source/graphicfilter/idxf/dxfgrprd.hxx
-filter/source/graphicfilter/idxf/dxfreprd.cxx
-filter/source/graphicfilter/idxf/dxfreprd.hxx
-filter/source/graphicfilter/idxf/dxftblrd.cxx
-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/msfilter/countryid.cxx
 filter/source/msfilter/dffpropset.cxx
 filter/source/msfilter/escherex.cxx
@@ -14806,6 +14790,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-dxf-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-eps-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-met-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pcd-test.cxx
@@ -14922,6 +14907,21 @@ 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/idxf/dxf2mtf.cxx
+vcl/source/filter/idxf/dxf2mtf.hxx
+vcl/source/filter/idxf/dxfblkrd.cxx
+vcl/source/filter/idxf/dxfblkrd.hxx
+vcl/source/filter/idxf/dxfentrd.cxx
+vcl/source/filter/idxf/dxfentrd.hxx
+vcl/source/filter/idxf/dxfgrprd.cxx
+vcl/source/filter/idxf/dxfgrprd.hxx
+vcl/source/filter/idxf/dxfreprd.cxx
+vcl/source/filter/idxf/dxfreprd.hxx
+vcl/source/filter/idxf/dxftblrd.cxx
+vcl/source/filter/idxf/dxftblrd.hxx
+vcl/source/filter/idxf/dxfvec.cxx
+vcl/source/filter/idxf/dxfvec.hxx
+vcl/source/filter/idxf/idxf.cxx
 vcl/source/filter/ieps/ieps.cxx
 vcl/source/filter/igif/decode.cxx
 vcl/source/filter/igif/decode.hxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index ccb427dddd6c..ab5108f51b1c 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-dxf-test \
     vcl/qa/cppunit/graphicfilter/filters-eps-test \
     vcl/qa/cppunit/graphicfilter/filters-met-test \
     vcl/qa/cppunit/graphicfilter/filters-pcd-test \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 581e50aec36f..bea21fee0867 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -436,6 +436,14 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/GraphicNativeTransform \
     vcl/source/filter/GraphicNativeMetadata \
     vcl/source/filter/GraphicFormatDetector \
+    vcl/source/filter/idxf/dxf2mtf \
+    vcl/source/filter/idxf/dxfblkrd \
+    vcl/source/filter/idxf/dxfentrd \
+    vcl/source/filter/idxf/dxfgrprd \
+    vcl/source/filter/idxf/dxfreprd \
+    vcl/source/filter/idxf/dxftblrd \
+    vcl/source/filter/idxf/dxfvec \
+    vcl/source/filter/idxf/idxf \
     vcl/source/filter/ieps/ieps \
     vcl/source/filter/igif/decode \
     vcl/source/filter/igif/gifread \
diff --git a/vcl/inc/filter/DxfReader.hxx b/vcl/inc/filter/DxfReader.hxx
new file mode 100644
index 000000000000..f1e89bf4b115
--- /dev/null
+++ b/vcl/inc/filter/DxfReader.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 ImportDxfGraphic(SvStream& rStream, Graphic& rGraphic);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/cppunit/data/dxf/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/dxf/fail/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/dxf/fail/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/dxf/fail/.gitignore
diff --git a/filter/qa/cppunit/data/dxf/fail/CVE-2010-1681-1.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/fail/CVE-2010-1681-1.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/fail/CVE-2010-1681-1.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/fail/CVE-2010-1681-1.dxf
diff --git a/filter/qa/cppunit/data/dxf/fail/hang-1.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/fail/hang-1.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/fail/hang-1.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/fail/hang-1.dxf
diff --git a/filter/qa/cppunit/data/dxf/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/dxf/indeterminate/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/dxf/indeterminate/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/dxf/indeterminate/.gitignore
diff --git a/filter/qa/cppunit/data/dxf/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/dxf/pass/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/dxf/pass/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/dxf/pass/.gitignore
diff --git a/filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/pass/bigangle-1.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/pass/bigangle-1.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/pass/bigangle-1.dxf
diff --git a/filter/qa/cppunit/data/dxf/pass/loop-1.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/pass/loop-1.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/pass/loop-1.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/pass/loop-1.dxf
diff --git a/filter/qa/cppunit/data/dxf/pass/loop-2.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/pass/loop-2.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/pass/loop-2.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/pass/loop-2.dxf
diff --git a/filter/qa/cppunit/data/dxf/pass/pyramid.dxf b/vcl/qa/cppunit/graphicfilter/data/dxf/pass/pyramid.dxf
similarity index 100%
rename from filter/qa/cppunit/data/dxf/pass/pyramid.dxf
rename to vcl/qa/cppunit/graphicfilter/data/dxf/pass/pyramid.dxf
diff --git a/filter/qa/cppunit/filters-dxf-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-dxf-test.cxx
similarity index 80%
rename from filter/qa/cppunit/filters-dxf-test.cxx
rename to vcl/qa/cppunit/graphicfilter/filters-dxf-test.cxx
index 2dddac45d026..7a133500826a 100644
--- a/filter/qa/cppunit/filters-dxf-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-dxf-test.cxx
@@ -12,15 +12,9 @@
 #include <vcl/FilterConfigItem.hxx>
 #include <tools/stream.hxx>
 #include <vcl/graph.hxx>
+#include <filter/DxfReader.hxx>
 
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT bool SAL_CALL
-        idxGraphicImport(SvStream & rStream, Graphic & rGraphic,
-        FilterConfigItem*);
-}
-
-using namespace ::com::sun::star;
+using namespace css;
 
 /* Implementation of Filters test */
 
@@ -51,17 +45,17 @@ bool DxfFilterTest::load(const OUString &,
 {
     SvFileStream aFileStream(rURL, StreamMode::READ);
     Graphic aGraphic;
-    return idxGraphicImport(aFileStream, aGraphic, nullptr);
+    return ImportDxfGraphic(aFileStream, aGraphic);
 }
 
 void DxfFilterTest::testCVEs()
 {
+#ifndef DISABLE_CVE_TESTS
     testDir(OUString(),
-        m_directories.getURLFromSrc(u"/filter/qa/cppunit/data/dxf/"));
+        m_directories.getURLFromSrc(u"/vcl/qa/cppunit/graphicfilter/data/dxf/"));
+#endif
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(DxfFilterTest);
 
-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 0f19f717f2c8..d8ab4d44e0a8 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -44,7 +44,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, IMP_PSD,
-    IMP_PCD, IMP_PBM, nullptr
+    IMP_PCD, IMP_PBM, IMP_DXF, nullptr
 };
 
 const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
@@ -221,7 +221,7 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
 {
     "bmp","1","SVBMP",
     "bmp","2","SVBMP",
-    "dxf","1","idx",
+    "dxf","1","SVDXF",
     "eps","1","SVIEPS",
     "eps","2","SVEEPS",
     "gif","1","SVIGIF",
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 1257827f5333..639ce7dc4ddd 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -59,6 +59,7 @@
 #include <filter/PsdReader.hxx>
 #include <filter/PcdReader.hxx>
 #include <filter/PbmReader.hxx>
+#include <filter/DxfReader.hxx>
 #include <osl/module.hxx>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/awt/Size.hpp>
@@ -647,26 +648,9 @@ ImpFilterLibCacheEntry::ImpFilterLibCacheEntry( const OUString& rPathname, const
 #endif
 }
 
-#ifdef DISABLE_DYNLOADING
-
-extern "C" bool idxGraphicImport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-
-#endif
-
 PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
 {
-    if( !mpfnImport )
-    {
-#ifndef DISABLE_DYNLOADING
-        if (maFormatName == "idx")
-            mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("idxGraphicImport"));
- #else
-        if (maFormatName ==  "idx")
-            mpfnImport = idxGraphicImport;
- #endif
-    }
-
-    return mpfnImport;
+    return nullptr;
 }
 
 namespace {
@@ -1386,30 +1370,6 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
     return aGraphic;
 }
 
-void GraphicFilter::preload()
-{
-    sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, ';');
-    ImpFilterLibCache& rCache = Cache::get();
-    static const std::initializer_list<std::u16string_view> aFilterNames = {
-        u"idx", u"ipb", u"ipd"
-    };
-
-    // Load library for each filter.
-    for (const auto& rFilterName : aFilterNames)
-    {
-        ImpFilterLibCacheEntry* pFilter = nullptr;
-        // Look at the library in each element inside the filter path.
-        for (sal_Int32 i = 0; i < nTokenCount; ++i)
-        {
-            pFilter = rCache.GetFilter(aFilterPath.getToken(i, ';'), SVLIBRARY("gie"), OUString(rFilterName));
-            if (pFilter)
-            {
-                break;
-            }
-        }
-    }
-}
-
 ErrCode GraphicFilter::readGIF(SvStream & rStream, Graphic & rGraphic, GfxLinkType & rLinkType)
 {
     if (ImportGIF(rStream, rGraphic))
@@ -1760,6 +1720,14 @@ ErrCode GraphicFilter::readPBM(SvStream & rStream, Graphic & rGraphic)
         return ERRCODE_GRFILTER_FILTERERROR;
 }
 
+ErrCode GraphicFilter::readDXF(SvStream & rStream, Graphic & rGraphic)
+{
+    if (ImportDxfGraphic(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*/,
@@ -1909,6 +1877,10 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
         {
             nStatus = readPBM(rIStream, rGraphic);
         }
+        else if (aFilterName.equalsIgnoreAsciiCase(IMP_DXF))
+        {
+            nStatus = readDXF(rIStream, rGraphic);
+        }
         else
             nStatus = ERRCODE_GRFILTER_FILTERERROR;
     }
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/vcl/source/filter/idxf/dxf2mtf.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxf2mtf.cxx
rename to vcl/source/filter/idxf/dxf2mtf.cxx
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/vcl/source/filter/idxf/dxf2mtf.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxf2mtf.hxx
rename to vcl/source/filter/idxf/dxf2mtf.hxx
diff --git a/filter/source/graphicfilter/idxf/dxfblkrd.cxx b/vcl/source/filter/idxf/dxfblkrd.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfblkrd.cxx
rename to vcl/source/filter/idxf/dxfblkrd.cxx
diff --git a/filter/source/graphicfilter/idxf/dxfblkrd.hxx b/vcl/source/filter/idxf/dxfblkrd.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfblkrd.hxx
rename to vcl/source/filter/idxf/dxfblkrd.hxx
diff --git a/filter/source/graphicfilter/idxf/dxfentrd.cxx b/vcl/source/filter/idxf/dxfentrd.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfentrd.cxx
rename to vcl/source/filter/idxf/dxfentrd.cxx
diff --git a/filter/source/graphicfilter/idxf/dxfentrd.hxx b/vcl/source/filter/idxf/dxfentrd.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfentrd.hxx
rename to vcl/source/filter/idxf/dxfentrd.hxx
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/vcl/source/filter/idxf/dxfgrprd.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfgrprd.cxx
rename to vcl/source/filter/idxf/dxfgrprd.cxx
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.hxx b/vcl/source/filter/idxf/dxfgrprd.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfgrprd.hxx
rename to vcl/source/filter/idxf/dxfgrprd.hxx
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/vcl/source/filter/idxf/dxfreprd.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfreprd.cxx
rename to vcl/source/filter/idxf/dxfreprd.cxx
diff --git a/filter/source/graphicfilter/idxf/dxfreprd.hxx b/vcl/source/filter/idxf/dxfreprd.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfreprd.hxx
rename to vcl/source/filter/idxf/dxfreprd.hxx
diff --git a/filter/source/graphicfilter/idxf/dxftblrd.cxx b/vcl/source/filter/idxf/dxftblrd.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxftblrd.cxx
rename to vcl/source/filter/idxf/dxftblrd.cxx
diff --git a/filter/source/graphicfilter/idxf/dxftblrd.hxx b/vcl/source/filter/idxf/dxftblrd.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxftblrd.hxx
rename to vcl/source/filter/idxf/dxftblrd.hxx
diff --git a/filter/source/graphicfilter/idxf/dxfvec.cxx b/vcl/source/filter/idxf/dxfvec.cxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfvec.cxx
rename to vcl/source/filter/idxf/dxfvec.cxx
diff --git a/filter/source/graphicfilter/idxf/dxfvec.hxx b/vcl/source/filter/idxf/dxfvec.hxx
similarity index 100%
rename from filter/source/graphicfilter/idxf/dxfvec.hxx
rename to vcl/source/filter/idxf/dxfvec.hxx
diff --git a/filter/source/graphicfilter/idxf/idxf.cxx b/vcl/source/filter/idxf/idxf.cxx
similarity index 90%
rename from filter/source/graphicfilter/idxf/idxf.cxx
rename to vcl/source/filter/idxf/idxf.cxx
index ad75d6b5e1c3..26d42b10cbe4 100644
--- a/filter/source/graphicfilter/idxf/idxf.cxx
+++ b/vcl/source/filter/idxf/idxf.cxx
@@ -18,16 +18,14 @@
  */
 
 
+#include <filter/DxfReader.hxx>
 #include <vcl/gdimtf.hxx>
 #include <vcl/graph.hxx>
 #include "dxf2mtf.hxx"
 
-class FilterConfigItem;
-
 //================== GraphicImport - the exported function ================
 
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-idxGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
+bool ImportDxfGraphic(SvStream & rStream, Graphic & rGraphic)
 {
     DXFRepresentation aDXF;
     DXF2GDIMetaFile aConverter;
diff --git a/vcl/workben/dxffuzzer.cxx b/vcl/workben/dxffuzzer.cxx
index 6ca526a1d8cf..8768072c93fb 100644
--- a/vcl/workben/dxffuzzer.cxx
+++ b/vcl/workben/dxffuzzer.cxx
@@ -10,6 +10,7 @@
 #include <tools/stream.hxx>
 #include <vcl/FilterConfigItem.hxx>
 #include "commonfuzzer.hxx"
+#include <filter/DxfReader.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 idxGraphicImport(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)idxGraphicImport(aStream, aGraphic, nullptr);
+    (void)ImportDxfGraphic(aStream, aGraphic);
     return 0;
 }
 
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 45deeee37169..5dafd12be683 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -52,6 +52,7 @@
 #include <filter/PsdReader.hxx>
 #include <filter/PcdReader.hxx>
 #include <filter/PbmReader.hxx>
+#include <filter/DxfReader.hxx>
 #include <osl/file.hxx>
 #include <osl/module.hxx>
 #include <tools/stream.hxx>
@@ -165,7 +166,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
             SvFileStream aFileStream(out, StreamMode::READ);
             ReadGDIMetaFile(aFileStream, aGDIMetaFile);
         }
-#ifndef DISABLE_DYNLOADING
         else if (strcmp(argv[2], "pcd") == 0)
         {
             Graphic aGraphic;
@@ -174,18 +174,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         }
         else if (strcmp(argv[2], "dxf") == 0)
         {
-            static PFilterCall pfnImport(nullptr);
-            if (!pfnImport)
-            {
-                osl::Module aLibrary;
-                aLibrary.loadRelative(&thisModule, "libgielo.so");
-                pfnImport = reinterpret_cast<PFilterCall>(
-                    aLibrary.getFunctionSymbol("idxGraphicImport"));
-                aLibrary.release();
-            }
             Graphic aGraphic;
             SvFileStream aFileStream(out, StreamMode::READ);
-            ret = static_cast<int>((*pfnImport)(aFileStream, aGraphic, nullptr));
+            ret = static_cast<int>(ImportDxfGraphic(aFileStream, aGraphic));
         }
         else if (strcmp(argv[2], "met") == 0)
         {
@@ -241,6 +232,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
             SvFileStream aFileStream(out, StreamMode::READ);
             ret = static_cast<int>(ImportTiffGraphicImport(aFileStream, aGraphic));
         }
+#ifndef DISABLE_DYNLOADING
         else if ((strcmp(argv[2], "doc") == 0) || (strcmp(argv[2], "ww8") == 0))
         {
             static FFilterCall pfnImport(nullptr);
commit a4b0933b0dd6811a3b2fbfd9bbbdfe07b546d747
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Feb 15 10:47:14 2021 +0900
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Feb 17 12:06:12 2021 +0900

    Move PBM,PPM reader from filter module into VCL
    
    Change-Id: I1ce998575f8d204045fabea184e80e71308a16b8

diff --git a/filter/CppunitTest_filter_ppm_test.mk b/filter/CppunitTest_filter_ppm_test.mk
deleted file mode 100644
index 273db952300d..000000000000
--- a/filter/CppunitTest_filter_ppm_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_ppm_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_ppm_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_ppm_test, \
-    filter/qa/cppunit/filters-ppm-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_ppm_test, \
-    gie \
-	sal \
-	test \
-	tl \
-	unotest \
-	vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_ppm_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_ppm_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_ppm_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_ppm_test,\
-    configmgr/source/configmgr \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_ppm_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index d5ab8b8169a5..e04eb08fda7f 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/ipbm/ipbm \
     filter/source/graphicfilter/idxf/dxf2mtf \
     filter/source/graphicfilter/idxf/dxfblkrd \
     filter/source/graphicfilter/idxf/dxfentrd \
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 678c882dce88..607a5fc46d0c 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_ppm_test \
     CppunitTest_filter_svg \
 ))
 endif
diff --git a/filter/source/config/fragments/internalgraphicfilters/pbm_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/pbm_Import.xcu
index 49db4b3c7eb4..0e7f0b9402b5 100644
--- a/filter/source/config/fragments/internalgraphicfilters/pbm_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/pbm_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="pbm_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>pbm_Portable_Bitmap</value></prop>
-        <prop oor:name="FormatName"><value>ipb</value></prop>
-        <prop oor:name="RealFilterName"><value>PBM - Portable Bitmap</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">PBM - Portable Bitmap</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="pbm_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>pbm_Portable_Bitmap</value></prop>
+    <prop oor:name="FormatName"><value>SVPBM</value></prop>
+    <prop oor:name="RealFilterName"><value>PBM - Portable Bitmap</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">PBM - Portable Bitmap</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/filter/source/config/fragments/internalgraphicfilters/pgm_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/pgm_Import.xcu
index 2e1d4bb27f68..0356e69543f5 100644
--- a/filter/source/config/fragments/internalgraphicfilters/pgm_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/pgm_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="pgm_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>pgm_Portable_Graymap</value></prop>
-        <prop oor:name="FormatName"><value>ipb</value></prop>
-        <prop oor:name="RealFilterName"><value>PGM - Portable Graymap</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">PGM - Portable Graymap</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="pgm_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>pgm_Portable_Graymap</value></prop>
+    <prop oor:name="FormatName"><value>SVPBM</value></prop>
+    <prop oor:name="RealFilterName"><value>PGM - Portable Graymap</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">PGM - Portable Graymap</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/filter/source/config/fragments/internalgraphicfilters/ppm_Import.xcu b/filter/source/config/fragments/internalgraphicfilters/ppm_Import.xcu
index c2213e24f8bc..03134558c806 100644
--- a/filter/source/config/fragments/internalgraphicfilters/ppm_Import.xcu
+++ b/filter/source/config/fragments/internalgraphicfilters/ppm_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="ppm_Import" oor:op="replace"  >
-        <prop oor:name="Type"><value>ppm_Portable_Pixelmap</value></prop>
-        <prop oor:name="FormatName"><value>ipb</value></prop>
-        <prop oor:name="RealFilterName"><value>PPM - Portable Pixelmap</value></prop>
-        <prop oor:name="UIComponent"/>
-        <prop oor:name="UIName">
-            <value xml:lang="en-US">PPM - Portable Pixelmap</value>
-        </prop>
-        <prop oor:name="Flags"><value>IMPORT</value></prop>
-    </node>
+
+<node oor:name="ppm_Import" oor:op="replace"  >
+    <prop oor:name="Type"><value>ppm_Portable_Pixelmap</value></prop>
+    <prop oor:name="FormatName"><value>SVPBM</value></prop>
+    <prop oor:name="RealFilterName"><value>PPM - Portable Pixelmap</value></prop>
+    <prop oor:name="UIComponent"/>
+    <prop oor:name="UIName">
+        <value xml:lang="en-US">PPM - Portable Pixelmap</value>
+    </prop>
+    <prop oor:name="Flags"><value>IMPORT</value></prop>
+</node>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 992aac639729..f0d0511aac97 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -87,6 +87,7 @@ namespace o3tl
 #define IMP_EPS                 "SVIEPS"
 #define IMP_PSD                 "SVPSD"
 #define IMP_PCD                 "SVPCD"
+#define IMP_PBM                 "SVPBM"
 #define EXP_BMP                 "SVBMP"
 #define EXP_SVMETAFILE          "SVMETAFILE"
 #define EXP_WMF                 "SVWMF"
@@ -377,6 +378,7 @@ public:
     static ErrCode readEPS(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readPSD(SvStream & rStream, Graphic & rGraphic);
     static ErrCode readPCD(SvStream & rStream, Graphic & rGraphic);
+    static ErrCode readPBM(SvStream & rStream, Graphic & rGraphic);
 
 private:
     OUString        aFilterPath;
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index da73d5a5147d..03fe8e0d3c52 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3898,7 +3898,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-ppm-test.cxx
 filter/qa/cppunit/msfilter-test.cxx
 filter/qa/cppunit/priority-test.cxx
 filter/qa/cppunit/xslt-test.cxx
@@ -3964,7 +3963,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/ipbm/ipbm.cxx
 filter/source/msfilter/countryid.cxx
 filter/source/msfilter/dffpropset.cxx
 filter/source/msfilter/escherex.cxx
@@ -14813,6 +14811,7 @@ vcl/qa/cppunit/graphicfilter/filters-met-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pcd-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pcx-test.cxx
 vcl/qa/cppunit/graphicfilter/filters-pict-test.cxx
+vcl/qa/cppunit/graphicfilter/filters-ppm-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
@@ -14928,6 +14927,7 @@ vcl/source/filter/igif/decode.cxx
 vcl/source/filter/igif/decode.hxx
 vcl/source/filter/igif/gifread.cxx
 vcl/source/filter/imet/ios2met.cxx
+vcl/source/filter/ipbm/ipbm.cxx
 vcl/source/filter/ipcd/ipcd.cxx
 vcl/source/filter/ipcx/ipcx.cxx
 vcl/source/filter/ipict/ipict.cxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index 8ebc4c7c1ae0..ccb427dddd6c 100644
--- a/vcl/CppunitTest_vcl_filters_test.mk
+++ b/vcl/CppunitTest_vcl_filters_test.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,vcl_filters_test, \
     vcl/qa/cppunit/graphicfilter/filters-pcd-test \
     vcl/qa/cppunit/graphicfilter/filters-pcx-test \
     vcl/qa/cppunit/graphicfilter/filters-pict-test \
+    vcl/qa/cppunit/graphicfilter/filters-ppm-test \
     vcl/qa/cppunit/graphicfilter/filters-psd-test \
     vcl/qa/cppunit/graphicfilter/filters-ras-test \
     vcl/qa/cppunit/graphicfilter/filters-test \
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 34b7f0697436..581e50aec36f 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -440,6 +440,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/filter/igif/decode \
     vcl/source/filter/igif/gifread \
     vcl/source/filter/imet/ios2met \
+    vcl/source/filter/ipbm/ipbm \
     vcl/source/filter/ipcd/ipcd \
     vcl/source/filter/ipcx/ipcx \
     vcl/source/filter/ipict/ipict \
diff --git a/vcl/inc/filter/PbmReader.hxx b/vcl/inc/filter/PbmReader.hxx
new file mode 100644
index 000000000000..5fe4d8a295ef
--- /dev/null
+++ b/vcl/inc/filter/PbmReader.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 .
+ */
+

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list