[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 2 commits - filter/CppunitTest_filter_tiff_test.mk filter/Library_gie.mk filter/Module_filter.mk filter/qa filter/source include/vcl solenv/clang-format vcl/CppunitTest_vcl_filters_test.mk vcl/inc vcl/Library_vcl.mk vcl/qa vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 29 13:35:08 UTC 2020
filter/CppunitTest_filter_tiff_test.mk | 38 -------------------
filter/Library_gie.mk | 4 --
filter/Module_filter.mk | 1
include/vcl/BinaryDataContainer.hxx | 2 -
include/vcl/graphicfilter.hxx | 3 +
solenv/clang-format/excludelist | 11 ++---
vcl/CppunitTest_vcl_filters_test.mk | 6 +++
vcl/Library_vcl.mk | 4 ++
vcl/inc/filter/TiffReader.hxx | 26 +++++++++++++
vcl/inc/filter/TiffWriter.hxx | 28 ++++++++++++++
vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx | 40 ++++++---------------
vcl/source/filter/FilterConfigCache.cxx | 8 ++--
vcl/source/filter/etiff/etiff.cxx | 4 --
vcl/source/filter/graphicfilter.cxx | 36 ++++++++++++------
vcl/source/filter/itiff/itiff.cxx | 8 +---
15 files changed, 117 insertions(+), 102 deletions(-)
New commits:
commit 45c7296abbf3c84a70e510aed5f7d06570defe7e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Dec 29 22:32:01 2020 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Dec 29 22:32:39 2020 +0900
Move TIFF reader and writer from filter module into VCL
Moving graphicfilter one by one into VCL to get rid of filter_gio
module and all the nonsense of dynamic/static library loading in
"GraphicFilter".
Change-Id: I21ebc0334ee07d36553a88557d33e01d9caec9ee
diff --git a/filter/CppunitTest_filter_tiff_test.mk b/filter/CppunitTest_filter_tiff_test.mk
deleted file mode 100644
index 23a7bbf9ccac..000000000000
--- a/filter/CppunitTest_filter_tiff_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_tiff_test))
-
-$(eval $(call gb_CppunitTest_use_external,filter_tiff_test,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,filter_tiff_test, \
- filter/qa/cppunit/filters-tiff-test \
-))
-
-$(eval $(call gb_CppunitTest_use_libraries,filter_tiff_test, \
- gie \
- sal \
- test \
- tl \
- unotest \
- vcl \
-))
-
-$(eval $(call gb_CppunitTest_use_sdk_api,filter_tiff_test))
-
-$(eval $(call gb_CppunitTest_use_ure,filter_tiff_test))
-$(eval $(call gb_CppunitTest_use_vcl,filter_tiff_test))
-
-$(eval $(call gb_CppunitTest_use_components,filter_tiff_test,\
- configmgr/source/configmgr \
-))
-
-$(eval $(call gb_CppunitTest_use_configuration,filter_tiff_test))
-
-# vim: set noet sw=4 ts=4:
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index 2dcab32717b6..8c0cbd46b9b9 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -50,12 +50,8 @@ $(eval $(call gb_Library_use_libraries,gie,\
$(eval $(call gb_Library_add_exception_objects,gie,\
filter/source/graphicfilter/egif/egif \
- filter/source/graphicfilter/etiff/etiff \
filter/source/graphicfilter/eps/eps \
filter/source/graphicfilter/egif/giflzwc \
- filter/source/graphicfilter/itiff/ccidecom \
- filter/source/graphicfilter/itiff/itiff \
- filter/source/graphicfilter/itiff/lzwdecom \
filter/source/graphicfilter/ipict/ipict \
filter/source/graphicfilter/ipict/shape \
filter/source/graphicfilter/ipcx/ipcx \
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 6ac173e45859..898ac710db8a 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -64,7 +64,6 @@ $(eval $(call gb_Module_add_check_targets,filter,\
CppunitTest_filter_ppm_test \
CppunitTest_filter_psd_test \
CppunitTest_filter_ras_test \
- CppunitTest_filter_tiff_test \
CppunitTest_filter_tga_test \
CppunitTest_filter_svg \
))
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index 35728237dc7a..5b18654cb81b 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -77,6 +77,7 @@ namespace o3tl
#define IMP_XPM "SVIXPM"
#define IMP_SVG "SVISVG"
#define IMP_PDF "SVIPDF"
+#define IMP_TIFF "SVTIFF"
#define EXP_BMP "SVBMP"
#define EXP_SVMETAFILE "SVMETAFILE"
#define EXP_WMF "SVWMF"
@@ -85,6 +86,8 @@ namespace o3tl
#define EXP_SVG "SVESVG"
#define EXP_PDF "SVEPDF"
#define EXP_PNG "SVEPNG"
+#define EXP_TIFF "SVTIFF"
+
#define BMP_SHORTNAME u"BMP"
#define GIF_SHORTNAME u"GIF"
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 6d9404c26b93..45e0a06c300a 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3900,7 +3900,6 @@ filter/qa/cppunit/filters-ppm-test.cxx
filter/qa/cppunit/filters-psd-test.cxx
filter/qa/cppunit/filters-ras-test.cxx
filter/qa/cppunit/filters-tga-test.cxx
-filter/qa/cppunit/filters-tiff-test.cxx
filter/qa/cppunit/msfilter-test.cxx
filter/qa/cppunit/priority-test.cxx
filter/qa/cppunit/xslt-test.cxx
@@ -3931,7 +3930,6 @@ filter/source/graphicfilter/egif/egif.cxx
filter/source/graphicfilter/egif/giflzwc.cxx
filter/source/graphicfilter/egif/giflzwc.hxx
filter/source/graphicfilter/eps/eps.cxx
-filter/source/graphicfilter/etiff/etiff.cxx
filter/source/graphicfilter/icgm/actimpr.cxx
filter/source/graphicfilter/icgm/bitmap.cxx
filter/source/graphicfilter/icgm/bitmap.hxx
@@ -3979,10 +3977,6 @@ filter/source/graphicfilter/ipict/shape.hxx
filter/source/graphicfilter/ipsd/ipsd.cxx
filter/source/graphicfilter/iras/iras.cxx
filter/source/graphicfilter/itga/itga.cxx
-filter/source/graphicfilter/itiff/ccidecom.cxx
-filter/source/graphicfilter/itiff/ccidecom.hxx
-filter/source/graphicfilter/itiff/itiff.cxx
-filter/source/graphicfilter/itiff/lzwdecom.cxx
filter/source/msfilter/countryid.cxx
filter/source/msfilter/dffpropset.cxx
filter/source/msfilter/escherex.cxx
@@ -14939,12 +14933,17 @@ vcl/source/filter/FilterConfigCache.hxx
vcl/source/filter/FilterConfigItem.cxx
vcl/source/filter/graphicfilter.cxx
vcl/source/filter/graphicfilter2.cxx
+vcl/source/filter/etiff/etiff.cxx
vcl/source/filter/igif/decode.cxx
vcl/source/filter/igif/decode.hxx
vcl/source/filter/igif/gifread.cxx
vcl/source/filter/ixbm/xbmread.cxx
vcl/source/filter/ixpm/rgbtable.hxx
vcl/source/filter/ixpm/xpmread.cxx
+vcl/source/filter/itiff/ccidecom.cxx
+vcl/source/filter/itiff/ccidecom.hxx
+vcl/source/filter/itiff/itiff.cxx
+vcl/source/filter/itiff/lzwdecom.cxx
vcl/source/filter/jpeg/Exif.cxx
vcl/source/filter/jpeg/Exif.hxx
vcl/source/filter/jpeg/JpegReader.cxx
diff --git a/vcl/CppunitTest_vcl_filters_test.mk b/vcl/CppunitTest_vcl_filters_test.mk
index 03a423233c9e..70667a04417b 100644
--- a/vcl/CppunitTest_vcl_filters_test.mk
+++ b/vcl/CppunitTest_vcl_filters_test.mk
@@ -11,6 +11,12 @@ $(eval $(call gb_CppunitTest_CppunitTest,vcl_filters_test))
$(eval $(call gb_CppunitTest_add_exception_objects,vcl_filters_test, \
vcl/qa/cppunit/graphicfilter/filters-test \
+ vcl/qa/cppunit/graphicfilter/filters-tiff-test \
+))
+
+$(eval $(call gb_CppunitTest_set_include,vcl_filters_test,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/vcl/inc \
))
ifeq ($(DISABLE_CVE_TESTS),TRUE)
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 2989193c0b90..b7b47ac463ec 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -424,6 +424,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/components/dtranscomp \
vcl/source/components/factory \
vcl/source/components/fontident \
+ vcl/source/filter/etiff/etiff \
vcl/source/filter/FilterConfigCache \
vcl/source/filter/FilterConfigItem \
vcl/source/filter/graphicfilter \
@@ -435,6 +436,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/filter/igif/gifread \
vcl/source/filter/ipdf/pdfread \
vcl/source/filter/ipdf/pdfdocument \
+ vcl/source/filter/itiff/ccidecom \
+ vcl/source/filter/itiff/itiff \
+ vcl/source/filter/itiff/lzwdecom \
vcl/source/filter/ixbm/xbmread \
vcl/source/filter/ixpm/xpmread \
vcl/source/filter/jpeg/Exif \
diff --git a/vcl/inc/filter/TiffReader.hxx b/vcl/inc/filter/TiffReader.hxx
new file mode 100644
index 000000000000..3c9922895a4f
--- /dev/null
+++ b/vcl/inc/filter/TiffReader.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 ImportTiffGraphicImport(SvStream& rStream, Graphic& rGraphic);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/filter/TiffWriter.hxx b/vcl/inc/filter/TiffWriter.hxx
new file mode 100644
index 000000000000..a2219a687915
--- /dev/null
+++ b/vcl/inc/filter/TiffWriter.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 ExportTiffGraphicImport(SvStream& rStream, Graphic& rGraphic,
+ FilterConfigItem* pFilterConfigItem);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/qa/cppunit/data/tiff/fail/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/.gitignore
diff --git a/filter/qa/cppunit/data/tiff/fail/BID-51132-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/BID-51132-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/BID-51132-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/BID-51132-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2006-3459-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2006-3459-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2006-3459-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2006-3459-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2009-2285-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2009-2285-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2009-2285-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2009-2285-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2010-2482-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2010-2482-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2010-2482-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2010-2482-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2012-0276-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-0276-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2012-0276-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-0276-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2012-0276-2.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-0276-2.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2012-0276-2.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-0276-2.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2012-2027-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-2027-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2012-2027-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2012-2027-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2013-3906-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2013-3906-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2013-3906-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2013-3906-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2017-10688-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-10688-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2017-10688-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-10688-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2017-9147-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-9147-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2017-9147-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-9147-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/CVE-2017-9936-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-9936-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/CVE-2017-9936-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/CVE-2017-9936-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/EBD-22681-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/EBD-22681-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/EBD-22681-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/EBD-22681-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/EDB-24743-5.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/EDB-24743-5.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/EDB-24743-5.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/EDB-24743-5.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-2.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-2.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-2.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-2.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-3.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-3.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-3.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-3.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-4.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-4.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-4.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-4.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-5.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-5.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-5.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-5.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-6.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-6.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-6.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-6.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-crash-7.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-7.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-crash-7.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-crash-7.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-10.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-10.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-10.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-10.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-2.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-2.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-2.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-2.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-3.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-3.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-3.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-3.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-4.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-4.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-4.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-4.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-5.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-5.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-5.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-5.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-6.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-6.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-6.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-6.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-7.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-7.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-7.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-7.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-8.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-8.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-8.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-8.tiff
diff --git a/filter/qa/cppunit/data/tiff/fail/RC4-hang-9.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-9.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/fail/RC4-hang-9.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/fail/RC4-hang-9.tiff
diff --git a/filter/qa/cppunit/data/tiff/indeterminate/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tiff/indeterminate/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tiff/indeterminate/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tiff/indeterminate/.gitignore
diff --git a/filter/qa/cppunit/data/tiff/pass/.gitignore b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/.gitignore
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/.gitignore
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/.gitignore
diff --git a/filter/qa/cppunit/data/tiff/pass/CVE-2005-1544-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2005-1544-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/CVE-2005-1544-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2005-1544-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/pass/CVE-2006-2656-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2006-2656-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/CVE-2006-2656-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2006-2656-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/pass/CVE-2007-2217-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2007-2217-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/CVE-2007-2217-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2007-2217-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/pass/CVE-2013-5575-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2013-5575-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/CVE-2013-5575-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/CVE-2013-5575-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/pass/multi-page-1.tiff b/vcl/qa/cppunit/graphicfilter/data/tiff/pass/multi-page-1.tiff
similarity index 100%
rename from filter/qa/cppunit/data/tiff/pass/multi-page-1.tiff
rename to vcl/qa/cppunit/graphicfilter/data/tiff/pass/multi-page-1.tiff
diff --git a/filter/qa/cppunit/data/tiff/tdf115863.tif b/vcl/qa/cppunit/graphicfilter/data/tiff/tdf115863.tif
similarity index 100%
rename from filter/qa/cppunit/data/tiff/tdf115863.tif
rename to vcl/qa/cppunit/graphicfilter/data/tiff/tdf115863.tif
diff --git a/filter/qa/cppunit/data/tiff/tdf126460.tif b/vcl/qa/cppunit/graphicfilter/data/tiff/tdf126460.tif
similarity index 100%
rename from filter/qa/cppunit/data/tiff/tdf126460.tif
rename to vcl/qa/cppunit/graphicfilter/data/tiff/tdf126460.tif
diff --git a/filter/qa/cppunit/data/tiff/tdf138818.tif b/vcl/qa/cppunit/graphicfilter/data/tiff/tdf138818.tif
similarity index 100%
rename from filter/qa/cppunit/data/tiff/tdf138818.tif
rename to vcl/qa/cppunit/graphicfilter/data/tiff/tdf138818.tif
diff --git a/filter/qa/cppunit/filters-tiff-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
similarity index 78%
rename from filter/qa/cppunit/filters-tiff-test.cxx
rename to vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
index 93968e9be9b7..cc45e77467b5 100644
--- a/filter/qa/cppunit/filters-tiff-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
@@ -14,31 +14,26 @@
#include <vcl/graph.hxx>
#include <vcl/graphicfilter.hxx>
-extern "C"
-{
- SAL_DLLPUBLIC_EXPORT bool SAL_CALL
- itiGraphicImport(SvStream & rStream, Graphic & rGraphic,
- FilterConfigItem*);
-}
+#include <filter/TiffReader.hxx>
using namespace ::com::sun::star;
/* Implementation of Filters test */
-class TiffFilterTest
- : public test::FiltersTest
- , public test::BootstrapFixture
+class TiffFilterTest : public test::FiltersTest, public test::BootstrapFixture
{
public:
- TiffFilterTest() : BootstrapFixture(true, false) {}
+ TiffFilterTest()
+ : BootstrapFixture(true, false)
+ {
+ }
- virtual bool load(const OUString &,
- const OUString &rURL, const OUString &,
- SfxFilterFlags, SotClipboardFormatId, unsigned int) override;
+ virtual bool load(const OUString&, const OUString& rURL, const OUString&, SfxFilterFlags,
+ SotClipboardFormatId, unsigned int) override;
OUString getUrl()
{
- return m_directories.getURLFromSrc("/filter/qa/cppunit/data/tiff/");
+ return m_directories.getURLFromSrc("/vcl/qa/cppunit/graphicfilter/data/tiff/");
}
/**
@@ -57,20 +52,15 @@ public:
CPPUNIT_TEST_SUITE_END();
};
-bool TiffFilterTest::load(const OUString &,
- const OUString &rURL, const OUString &,
- SfxFilterFlags, SotClipboardFormatId, unsigned int)
+bool TiffFilterTest::load(const OUString&, const OUString& rURL, const OUString&, SfxFilterFlags,
+ SotClipboardFormatId, unsigned int)
{
SvFileStream aFileStream(rURL, StreamMode::READ);
Graphic aGraphic;
- return itiGraphicImport(aFileStream, aGraphic, nullptr);
+ return ImportTiffGraphicImport(aFileStream, aGraphic);
}
-void TiffFilterTest::testCVEs()
-{
- testDir(OUString(),
- getUrl());
-}
+void TiffFilterTest::testCVEs() { testDir(OUString(), getUrl()); }
void TiffFilterTest::testTdf126460()
{
@@ -106,7 +96,6 @@ void TiffFilterTest::testTdf115863()
Size aSize = aBitmap.GetSizePixel();
CPPUNIT_ASSERT_EQUAL(tools::Long(528), aSize.Width());
CPPUNIT_ASSERT_EQUAL(tools::Long(618), aSize.Height());
-
}
void TiffFilterTest::testTdf138818()
@@ -124,11 +113,8 @@ void TiffFilterTest::testTdf138818()
// - Expected: 46428
// - Actual : 45951
CPPUNIT_ASSERT_EQUAL(sal_uInt32(46428), aGraphic.GetGfxLink().GetDataSize());
-
}
CPPUNIT_TEST_SUITE_REGISTRATION(TiffFilterTest);
-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 a315c0279b69..69126cf216fb 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -42,7 +42,7 @@ 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, nullptr
+ EXP_BMP, EXP_JPEG, EXP_PNG, IMP_MOV, IMP_TIFF, EXP_TIFF, nullptr
};
const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameList[] =
@@ -54,7 +54,7 @@ const char* FilterConfigCache::FilterConfigCacheEntry::InternalVectorFilterNameL
const char* FilterConfigCache::FilterConfigCacheEntry::ExternalPixelFilterNameList[] =
{
"egi", "icd", "ipd", "ipx", "ipb", "epb", "epg",
- "epp", "ira", "era", "itg", "iti", "eti", "exp", nullptr
+ "epp", "ira", "era", "itg", "exp", nullptr
};
void FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString& rUserDataEntry )
@@ -244,8 +244,8 @@ const char* FilterConfigCache::InternalFilterListForSvxLight[] =
"svm","1","SVMETAFILE",
"svm","2","SVMETAFILE",
"tga","1","itg",
- "tif","1","iti",
- "tif","2","eti",
+ "tif","1","SVTIFF",
+ "tif","2","SVTIFF",
"emf","1","SVEMF",
"emf","2","SVEMF",
"wmf","1","SVWMF",
diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/vcl/source/filter/etiff/etiff.cxx
similarity index 99%
rename from filter/source/graphicfilter/etiff/etiff.cxx
rename to vcl/source/filter/etiff/etiff.cxx
index 80c185e1ea5b..fbac404563e7 100644
--- a/filter/source/graphicfilter/etiff/etiff.cxx
+++ b/vcl/source/filter/etiff/etiff.cxx
@@ -576,9 +576,7 @@ void TIFFWriter::EndCompression()
pTable.reset();
}
-
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-etiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
+bool ExportTiffGraphicImport(SvStream & rStream, Graphic & rGraphic, FilterConfigItem* pFilterConfigItem)
{
TIFFWriter aWriter(rStream);
return aWriter.WriteTIFF( rGraphic, pFilterConfigItem );
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 6173288e6d20..418563fcb604 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -47,6 +47,8 @@
#include "jpeg/jpeg.hxx"
#include "ixbm/xbmread.hxx"
#include "ixpm/xpmread.hxx"
+#include <filter/TiffReader.hxx>
+#include <filter/TiffWriter.hxx>
#include <osl/module.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/awt/Size.hpp>
@@ -676,8 +678,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("iraGraphicImport"));
else if (maFormatName == "itg")
mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("itgGraphicImport"));
- else if (maFormatName == "iti")
- mpfnImport = reinterpret_cast<PFilterCall>(maLibrary.getFunctionSymbol("itiGraphicImport"));
#else
if (maFormatName == "icd")
mpfnImport = icdGraphicImport;
@@ -699,8 +699,6 @@ PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
mpfnImport = iraGraphicImport;
else if (maFormatName == "itg")
mpfnImport = itgGraphicImport;
- else if (maFormatName == "iti")
- mpfnImport = itiGraphicImport;
#endif
}
@@ -1333,6 +1331,10 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
{
eLinkType = GfxLinkType::NativePdf;
}
+ else if (aFilterName == IMP_TIFF)
+ {
+ eLinkType = GfxLinkType::NativeTif;
+ }
else
{
nStatus = ERRCODE_GRFILTER_FILTERERROR;
@@ -1366,9 +1368,7 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size
if (nFormat != GRFILTER_FORMAT_DONTKNOW)
aShortName = GetImportFormatShortName(nFormat).toAsciiUpperCase();
- if (aShortName.startsWith(TIF_SHORTNAME))
- eLinkType = GfxLinkType::NativeTif;
- else if( aShortName.startsWith(MET_SHORTNAME))
+ if( aShortName.startsWith(MET_SHORTNAME))
eLinkType = GfxLinkType::NativeMet;
else if( aShortName.startsWith(PCT_SHORTNAME))
eLinkType = GfxLinkType::NativePct;
@@ -1433,7 +1433,7 @@ void GraphicFilter::preload()
sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFilterPath, ';');
ImpFilterLibCache& rCache = Cache::get();
static const std::initializer_list<std::u16string_view> aFilterNames = {
- u"icd", u"idx", u"ime", u"ipb", u"ipd", u"ips", u"ipt", u"ipx", u"ira", u"itg", u"iti",
+ u"icd", u"idx", u"ime", u"ipb", u"ipd", u"ips", u"ipt", u"ipx", u"ira", u"itg",
};
// Load library for each filter.
@@ -1740,6 +1740,13 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
else
nStatus = ERRCODE_GRFILTER_FILTERERROR;
}
+ else if (aFilterName.equalsIgnoreAsciiCase(IMP_TIFF) )
+ {
+ if (!ImportTiffGraphicImport(rIStream, rGraphic))
+ nStatus = ERRCODE_GRFILTER_FILTERERROR;
+ else
+ eLinkType = GfxLinkType::NativeTif;
+ }
else
nStatus = ERRCODE_GRFILTER_FILTERERROR;
}
@@ -1865,7 +1872,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObje
extern "C" bool egiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
extern "C" bool epsGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
-extern "C" bool etiGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pConfigItem );
#endif
@@ -1958,6 +1964,14 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
if( rOStm.GetError() )
nStatus = ERRCODE_GRFILTER_IOERROR;
}
+ if (aFilterName.equalsIgnoreAsciiCase(EXP_TIFF))
+ {
+ if (!ExportTiffGraphicImport(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 ) ;
@@ -2189,8 +2203,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("egiGraphicExport"));
else if (aExternalFilterName == "eps")
pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("epsGraphicExport"));
- else if (aExternalFilterName == "eti")
- pFunc = reinterpret_cast<PFilterCall>(aLibrary.getFunctionSymbol("etiGraphicExport"));
// Execute dialog in DLL
#else
--nIdx; // Just one iteration
@@ -2199,8 +2211,6 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
pFunc = egiGraphicExport;
else if (aExternalFilterName == "eps")
pFunc = epsGraphicExport;
- else if (aExternalFilterName == "eti")
- pFunc = etiGraphicExport;
#endif
if( pFunc )
{
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/vcl/source/filter/itiff/ccidecom.cxx
similarity index 100%
rename from filter/source/graphicfilter/itiff/ccidecom.cxx
rename to vcl/source/filter/itiff/ccidecom.cxx
diff --git a/filter/source/graphicfilter/itiff/ccidecom.hxx b/vcl/source/filter/itiff/ccidecom.hxx
similarity index 100%
rename from filter/source/graphicfilter/itiff/ccidecom.hxx
rename to vcl/source/filter/itiff/ccidecom.hxx
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx
similarity index 99%
rename from filter/source/graphicfilter/itiff/itiff.cxx
rename to vcl/source/filter/itiff/itiff.cxx
index f07e496bc347..674b5f3656dd 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -30,6 +30,8 @@
#include "lzwdecom.hxx"
#include "ccidecom.hxx"
+#include <filter/TiffReader.hxx>
+
namespace {
template< typename T > T BYTESWAP(T nByte) {
@@ -1710,11 +1712,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
return false;
}
-
-//================== GraphicImport - the exported function ================
-
-extern "C" SAL_DLLPUBLIC_EXPORT bool
-itiGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
+bool ImportTiffGraphicImport(SvStream & rStream, Graphic & rGraphic)
{
TIFFReader aTIFFReader;
try
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/vcl/source/filter/itiff/lzwdecom.cxx
similarity index 100%
rename from filter/source/graphicfilter/itiff/lzwdecom.cxx
rename to vcl/source/filter/itiff/lzwdecom.cxx
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.hxx b/vcl/source/filter/itiff/lzwdecom.hxx
similarity index 100%
rename from filter/source/graphicfilter/itiff/lzwdecom.hxx
rename to vcl/source/filter/itiff/lzwdecom.hxx
commit 44bfa576e2899b7e293a023b9cd8e3646c832629
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Dec 29 18:54:21 2020 +0900
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Tue Dec 29 21:42:02 2020 +0900
vcl: Fix isEmpty method in BinaryDataContainer
Change-Id: I638473841be92d46f4a6ab2bac1b6f63ef7982ae
diff --git a/include/vcl/BinaryDataContainer.hxx b/include/vcl/BinaryDataContainer.hxx
index d8a20a94aa3f..a7dc963ddb71 100644
--- a/include/vcl/BinaryDataContainer.hxx
+++ b/include/vcl/BinaryDataContainer.hxx
@@ -53,7 +53,7 @@ public:
}
size_t getSize() const { return mpData ? mpData->size() : 0; }
- bool isEmpty() const { return mpData && mpData->empty(); }
+ bool isEmpty() const { return !mpData || mpData->empty(); }
const sal_uInt8* getData() const { return mpData ? mpData->data() : nullptr; }
size_t calculateHash() const;
More information about the Libreoffice-commits
mailing list