Commit Graph
150 Commits
Author SHA1 Message Date
Noel Grandin e1d980bef0 loplugin:ostr in filter
Change-Id: I9468cb2bf7b3614e5ee2e1ca6969282041699371
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167302
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-05-08 11:15:29 +02:00
RMZeroFour 6817c668cd tdf#147021 Replace SAL_N_ELEMENTS with std::size
As part of the efforts in #145538 to replace the SAL_N_ELEMENTS()
macro with std::size() and std::ssize(), this commit performs the
necessary changes for a few files in the filter/ module.

PS-2: Replace an std::size call with sizeof, and one with std::ssize

Change-Id: Icac6470cdff762f828651153d0abc5f40b8e5d7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165592
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-02 10:38:58 +02:00
Dr. David Alan Gilbert 7bec1689fc tdf#145538,tdf#147021: qa: range based loops
A bunch of range based loop changes in various qa
sections that also take out about 1% of SAL_N_ELEMENTS

Change-Id: I8ef000e9aa400cd8363b48f6175f6ab258cefbd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152422
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-02 16:58:57 +02:00
Stephan Bergmann cc264e8ee7 Just use Any ctor instead of makeAny in filter
Change-Id: I68bbbc2cc80ac5efde78e10706b488bf78c058bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133816
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-04 14:09:58 +02:00
Mike Kaganski 7233e65db1 Prepare for removal of non-const operator[] from Sequence in filter
Change-Id: I3296bf6dbacfc47a7e51afe88082c4801ea28ea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124365
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 08:02:32 +02:00
Julien Nabet e4a46880de drop 'using namespace std' in filter/qa
Change-Id: I7b5a1a773c26e8ef0fe3dcd0a1cdf5ebba75d52f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123191
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-07 14:26:46 +02:00
Stephan Bergmann 10d29c390d throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewrite
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-02 17:02:28 +02:00
Tomaž Vajngerl d3476d27ab Move DXF reader from filter module into VCL
Change-Id: If1a933256401c1a971f581d1b389ca06fd77eaae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111022
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 09:55:46 +01:00
Tomaž Vajngerl 27078ce8cb Move PBM,PPM reader from filter module into VCL
Change-Id: I1ce998575f8d204045fabea184e80e71308a16b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111019
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 05:55:07 +01:00
Tomaž Vajngerl 68012eaaab Move PCD reader from filter module into VCL
Change-Id: Icd23d1343f5231c09dd8197943ca472f4b573bfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111018
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 05:54:36 +01:00
Tomaž Vajngerl d338dc277d Move PSD reader from filter module into VCL
Change-Id: I53b11be6e9eb0013f017b2da5745ff525ca79c54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111017
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 05:53:49 +01:00
Tomaž Vajngerl 509814d936 Move EPS reader and writer from filter module into VCL
Change-Id: I1646f72d6a1db176e4520f8f64321646a26f054e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111016
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 04:02:41 +01:00
Tomaž Vajngerl 1093c21ed9 Move RAS and PCX reader from filter module into VCL
Change-Id: Id846abf257b598489a59ebf9b62b19840a950322
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111015
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 04:02:13 +01:00
Tomaž Vajngerl e916e8c181 Move MET reader from filter module into VCL
Change-Id: I478ef775bc73349094f88012ceb57b1712a27f55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111012
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 04:01:52 +01:00
Tomaž Vajngerl 4d22e3ce32 Move PICT reader from filter module into VCL
Change-Id: I6d3a28769ff3bffa3970a4ab6ab2384bb0aebbca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111011
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 02:43:45 +01:00
Tomaž Vajngerl 246af1d40e Move TGA reader from filter module into VCL
Change-Id: I0fea5d6e75c6bfd05ea91ed7b92aaacfcc5ec177
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111010
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-02-17 02:43:18 +01:00
Noel 7767ff7b52 loplugin:referencecasting in editeng..framework
Change-Id: Ia3375011ecd0a65afed0f131f477fc1542603fde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110948
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16 07:52:37 +01:00
Caolán McNamara 4e639c37b4 ofz#29691 revert throw SvStreamEOFException
reasonably sane code like
s.ReadUInt32(a).ReadUInt32(b).ReadUInt32(c).ReadUInt32(d);
if (s.good())
    // use a, b, c d;
stopped working.

FWIW on a short read we retain whatever was in the variable before the
read, rather than overwrite it with new random data, so
sal_uInt32 a(0xdead); s.ReadUInt32(a); assert(s.good() || a == 0xdead);

the msoffice ppt/escher/xls/doc filters especially speculatively parse
and rely on a variables preinit value in the case of a short read.

commit b345a2bab0
    cid#1470786 Uncaught exception

commit 71aec4726a
    ofz#29528 uncaught exception

commit bed03603f6
    ofz#29414 uncaught exception

commit 684885a99a
    ofz#29443 uncaught exception

commit 93574ac776
    ofz#29251 Abrt

commit 413db68d95
    ofz#29152 short read

commit f400e88304
    ofz#29151 short read

commit 96ea80a725
    ofz#29129 Abrt on uncaught exception

commit 646a635efe
    ofz#28931 Indirect-leak

commit b0e573f186
    ofz#29030 Abrt in xlsfuzzer

commit 95407c3916
    ofz#28902 uncaught exception

commit 45175d655a
    oss-fuzz: tgafuzzer doesn't pass sanity check

commit b82fc702ba
    oss-fuzz: psdfuzzer doesn't pass sanity check

commit e7c76d604a
    oss-fuzz: epsfuzzer doesn't pass sanity check

commit 901e5e7c91
    oss-fuzz: xlsfuzzer doesn't pass sanity check

commit 127bfab61c
    oss-fuzz: pngfuzzer doesn't pass sanity check

commit 77387ae00a
    oss-fuzz: mtpfuzzer doesn't pass sanity check

commit 974ffa79b0
    oss-fuzz: xlsxfuzzer doesn't pass sanity check

commit 6d6d104cbb
    oss-fuzz: bmpfuzzer doesn't pass sanity check

commit a7d1d107ec
    oss-fuzz: qpwfuzzer doesn't pass sanity check

commit 898993aa62
    oss-fuzz: pcxfuzzer doesn't pass sanity check

throw/catch parts of
commit 8c9a4ff511
    throw exception in SvStream when reading past end of file

Change-Id: Ic49c249768b17b64d8e868655dbc05b31906c2e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109621
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-20 16:20:25 +01:00
Noel 63a68064bb make the Color constructors explicitly specify transparency
to reduce the churn, we leave the existing constructor in place,
and add a clang plugin to detect when the value passed to the
existing constructor may contain transparency/alpha data.

i.e. we leave expressions like Color(0xffffff) alone, but
warn about any non-constant expression, and any expression
like Color(0xff000000)

Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16 10:07:07 +01:00
Tomaž Vajngerl 94d34e53ac 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
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108822
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-01-06 08:49:53 +01:00
Stephan Bergmann 042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
Xisco Fauli 4db61e4cb2 tdf#138818: libtest_filter_tiff: Add unittest
Change-Id: Ibb8566d58c23a76923d39f6f9d4dabf5a01d101a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107939
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-12-19 00:16:16 +01:00
Xisco Fauli 8cfad2357f tdf#126460: libtest_filter_tiff: Add unittest
Change-Id: I60ad27828df684d1886c21a50247dd5fa59e933c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107942
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-12-18 12:29:37 +01:00
Xisco Fauli e57665ea6f tdf#115863: libtest_filter_tiff: Add unittest
Change-Id: I4877005287181189c4210052ab57ada876ae2e90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107926
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-12-18 09:46:58 +01:00
Noel 8c9a4ff511 throw exception in SvStream when reading past end of file
to avoid chasing weird problems where we read past the end
of file, which leads to random data in the variable we read into.

I expect a couple of possible regressions from this change

(1) memory leaks caused by non-exception-safe memory handling.
Of which there should not be much because we're pretty good
about using smart pointer classes these days.

(2) Broken files which used to load, will no longer do so.
These will have to be debugged by putting a breakpoint
on the SvStreamEOFException constructor, and examining
the backtrace to see where we should be catching and ignoring
the exception to make the code continue to handle such broken
files.

Change-Id: I351be031bb083a3484a9a1b650a58892700e6fb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105936
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-18 06:54:06 +01:00
Noel Grandin ec6eaa58ad fix memory leak of xmlDoc objects
in unit tests

Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07 09:52:27 +02:00
Gabor Kelemen 5e80d0fe63 tdf#42949 Fix IWYU warnings in filter/
Also drop inc/gfxtypes.hxx and source/svg/spirit_supplements.hxx
which are unused since commit
3ca7be0983
"Replace SVGFilter using SVGIO"

Drop now unneeded pass-through header
source/graphicfilter/icgm/main.hxx too.

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I8abaf294370c98256815a226168085dd01123f3e
Reviewed-on: https://gerrit.libreoffice.org/84734
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-17 10:32:33 +01:00
Noel Grandin f13c6ad5f0 new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations

Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-15 14:33:57 +02:00
Noel Grandin bd2eed385f write out empty state explicitly in writeRectangle
this is purely an internal XML format, so we can change it

Change-Id: I9e2a4350c6c3f51031742e94823ea052dd73c8df
Reviewed-on: https://gerrit.libreoffice.org/75639
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-16 08:09:56 +02:00
Stephan Bergmann 6ad13e0e5d Demote from std::unique_lock to std::scoped_lock where applicable
Change-Id: I53a019f05978bab62ad0da3d0eb08f37f8ec1e18
Reviewed-on: https://gerrit.libreoffice.org/74414
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-20 10:19:33 +02:00
Gabor Kelemen 79e618c65f tdf#42949 Fix remaining IWYU warnings in include/vcl/*
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Some new headers were added since I begun the cleanup here
Also blacklist the header from commit 403e3c0442

Change-Id: Ie2358d5e27297f873aeb4a4dfb2778e6fb95dfa5
Reviewed-on: https://gerrit.libreoffice.org/66255
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-18 09:09:22 +01:00
Miklos Vajna 66b919c867 svm xml dumper: move this from test to vcl
This is very useful functionality, this way it can be invoked from the
debugger and/or nested into an outer xml dump (sw/sd doc model dump)
more easily.

Change-Id: If6c83b11d0f3e65fcce71e8d820c6bc354f64d68
Reviewed-on: https://gerrit.libreoffice.org/65834
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2019-01-03 15:08:06 +01:00
Noel Grandin 6f50961e69 remove more rtl::OUString and OString prefixes
which seem to have snuck back in since the great rounds of removals.

Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1
Reviewed-on: https://gerrit.libreoffice.org/62229
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24 14:43:34 +02:00
Noel Grandin ef5b895afe loplugin:staticvar in editeng..framework
Change-Id: I8e555a98f74f61e6e40122564b7ad19ca07a8a91
Reviewed-on: https://gerrit.libreoffice.org/61866
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17 12:07:46 +02:00
Gabor Kelemen bdb0775a26 Add missing sal/log.hxx headers
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it.
This is a continuation of commit 6ff2d84ade to be able to remove those unneeded includes.

This commit adds missing headers to every file found by:
grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG')
to directories from filter to jvmfwk

Change-Id: I2a73d63f2aaef5f26d7d08957daaa8a30b412ac5
Reviewed-on: https://gerrit.libreoffice.org/58204
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-30 09:28:40 +02:00
Chris Sherlock 4d94541a7b Make Color a forward declaration
Change-Id: Ib28833555661b119de8e967b05e3c8691fca826a
Reviewed-on: https://gerrit.libreoffice.org/43227
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-10-08 04:48:46 +02:00
Noel Grandin 2c05d758b2 add << operator for css::uno::Exception
Change-Id: Ia23dafd07133779144965682df3b7125a3214235
Reviewed-on: https://gerrit.libreoffice.org/43046
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-04 15:18:00 +02:00
Stephan Bergmann cd8aeed156 Fix data races during CppunitTest_filter_xslt
Change-Id: I140ac8a24326959ba341adddbbf505ff16616283
2017-09-11 17:58:13 +02:00
Caolán McNamara 206ca28bed add CVE-2017-10688 testcase
Change-Id: Icf24df4a3655775d9ce26ca1f72e130eead49c10
Reviewed-on: https://gerrit.libreoffice.org/39760
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-10 17:39:07 +02:00
Caolán McNamara 8038574923 add CVE-2017-9936 testcase
Change-Id: I0c791ef1f51c8af9f752742b8a3a3de6d626191b
Reviewed-on: https://gerrit.libreoffice.org/39759
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-10 17:38:45 +02:00
Caolán McNamara de855a731c add CVE-2017-9147 testcase
Change-Id: I82f5d4e75c888f4f988c8d6188b77550631fe258
Reviewed-on: https://gerrit.libreoffice.org/39758
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-10 16:41:02 +02:00
Caolán McNamara bb3715b628 ofz#967 optimize tiff import if line is the same as previous line
Change-Id: Ided61679a579a73481320f85c05b03e3ce3d762a
2017-03-30 21:14:48 +01:00
Caolán McNamara b018021d5a ofz: timeout on clamping big double to 0..360
Change-Id: Ica2aedc5275e5f523302f5793e3f3816b3ff65b4
2017-02-28 20:47:57 +00:00
Stephan Bergmann e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Caolán McNamara 7420e35090 guard against self-recursive GetBoundingBox
Change-Id: If33f0e5e326604bf731d6ad50644e3a0b24ccf51
2017-01-13 15:13:37 +00:00
Caolán McNamara 57779b5f3a avoid infinite loops in dxf rendering
Change-Id: Id2eb5540241f0792cde35c444fc2c0c5b7778353
2017-01-13 13:21:07 +00:00
Miklos Vajna 81ce0f3772 filter: fix loplugin:cppunitassertequals warnings
Change-Id: Ibb80377a581d70501dbd243307e883057508e67f
2016-09-16 10:55:36 +02:00
Stephan Bergmann 60b1c95cc4 Extract Directories from BootstrapFixtureBase
(as some tests derive from the latter only for the Directories part, not for the
setUp/tearDown overrides: those tests will be cleaned up next)

Change-Id: Ib6b78eea868b8bc21d4cc6e8fd9e1d025deca05f
Reviewed-on: https://gerrit.libreoffice.org/23078
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-10 08:04:40 +00:00
Noel Grandin 70f87284c6 improve defaultparams loplugin
to catch calling params with defaults like "= OUSString()"

Change-Id: Iad060e318ed492c22f8be44e326174fe6d28fff9
Reviewed-on: https://gerrit.libreoffice.org/22932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-07 05:57:17 +00:00
Michael Stahl 18b0343010 RC4 encrypt some WMF and TIFF test files
Reportedly some virus scanners warn about some of these files.

Use a new "RC4" name prefix since the files don't come from external
sources.

http://permalink.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/69200

Change-Id: I6d4cff2fdd5c0134bf2c77558ea09b3196b39be9
2016-01-05 13:33:56 +01:00