43 Commits
Author SHA1 Message Date
Bogdan Buzea ed3fe52aba tdf#152299 - Remove unused define(s) from C/C++ files
Change-Id: Ib84ec9730aca0b528a61f06c1ac5a4ace7ae77fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177134
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-12-22 18:31:26 +01:00
Keldin Maldonado (KNM) 405e3f8815 tdf#143148 use pragma once instead of include guards
Change-Id: I42c39d991d243191f410ebb8f91940d5922a6fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162678
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-01-29 10:30:01 +01:00
offtkp 932257c50c Add compression support for GZ through ZCodec
ZCodec uses zlib to deflate. That file has code
to allow for compressing to GZ but it's wrapped in defines.

There's places in code where there's need for zlib headers
(ie. svx/source/gallery2/codec.cxx:71) and there will be need
for gz header compression when EMZ/WMZ/SVGZ export support
is added.

Made compression functions care about mbGzLib bool. Also added
a SetCompressionMetadata function to set metadata which are otherwise
impossible to know (such as filename, which is needed in the header)

Change-Id: Ic01050262b0b15e0632564b139c66656afac4611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135213
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-12 09:29:53 +02:00
offtkp e9c50fbbc3 tdf#103954: Z compressed graphic formats support for EMF/WMF
- Added .emz and .wmz file opening support
- Added a function to check for Z compression that
all z comp. formats can use
- Added 3 unit tests for emf/emz/wmz files
and the example files have been checked with
a different tool (File Viewer 4)
- emf/emz file detection changed from magic byte checking
to extension checking, like wmf/wmz does

Change-Id: I3e433fd23d18482648a51cd04b8f467368e97b62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132456
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-06 04:02:05 +02:00
Noel Grandin 57ed14b5c5 fix leak in ZCodec
Change-Id: Ifec23a2e83a4327d954a9978ee3885a1f0889d6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115377
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-11 12:17:11 +02:00
Noel ebe1f639cf loplugin:unusedmethods
Change-Id: I851eba4ca80eac9ee5896df53fbcd0f5ad125763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112433
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-14 08:11:55 +01:00
Noel 2646023729 add tools::Long typedef and use it in tools
first step to switching long to a 64-bit type on 64-bit windows

Change-Id: I640d807426dfe713c7a8984ef560575f8288dbeb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104516
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-19 12:56:30 +02:00
Noel Grandin c42cf09f17 Revert "loplugin:constfields in tools"
This reverts commit 833c4965fc.

Change-Id: I130a91538627f9e83d94615e2ddd48da5a075d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90517
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-15 16:28:03 +01:00
Noel Grandin 9c78b8a728 remove unused crc functionality from ZCodec
Change-Id: I3e57e815b538ad5749b4bab3d4ef8e295cbe116b
Reviewed-on: https://gerrit.libreoffice.org/79098
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-18 16:29:08 +02:00
Noel Grandin 833c4965fc loplugin:constfields in tools
Change-Id: I83499cfb49f7abdbf0629c60167d09a1352571ee
Reviewed-on: https://gerrit.libreoffice.org/60987
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-27 08:29:49 +02:00
Noel Grandin b0ebc5608e sal_uIntPtr->size_t in ZCodec
to match the underlying fields

Change-Id: I79ce52b80e2589b3194616b3d43846cdefd7adae
Reviewed-on: https://gerrit.libreoffice.org/46349
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-13 07:50:41 +01:00
Noel Grandin 83fd71e041 loplugin:constmethod in tools,sax,UnoControls
Change-Id: Ie05e44e2a4019e2549843961ebfa04fef7b7aeb4
Reviewed-on: https://gerrit.libreoffice.org/43767
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-25 10:56:03 +02:00
Noel Grandin 2670ca3fc5 a whole bunch of SAL_WARN_UNUSED
Change-Id: Iea28debc7d3abc58cca21bd3856cb65b321dc1e6
Reviewed-on: https://gerrit.libreoffice.org/33693
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31 05:32:03 +00:00
Noel Grandin c9b4e29813 loplugin:constparams in tools
Change-Id: Iea05efbb90a0a95fefd18ae9673095a31422f06c
Reviewed-on: https://gerrit.libreoffice.org/27137
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-13 06:38:12 +00:00
tymyjan 08fc0da403 tdf#75280 Cleaning up of sal_uIntPtr usage #1a
Change-Id: Ief2cc6ab03316c2530d386d662db21ca1c9ddb30
Reviewed-on: https://gerrit.libreoffice.org/25898
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-27 10:18:49 +00:00
Noel Grandin 8ca50d20c1 loplugin:constantparam in tools
Change-Id: I3774661799c074561c694515baba42a375d0a077
Reviewed-on: https://gerrit.libreoffice.org/23301
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-17 06:09:42 +00:00
Noel Grandin e15a997b15 loplugin:unusedmethods unused return value in include/tools
Change-Id: I77a6a46ca20cb41ed73050185fb2064a1bbf2009
Reviewed-on: https://gerrit.libreoffice.org/21485
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-15 12:39:46 +00:00
Dennis Francis f0edb677f0 enhancement : tdf#90225 Cannot open compressed csv files from calc
Change-Id: I5098fd25f1747b49e47e360f017ee1112a242771
Reviewed-on: https://gerrit.libreoffice.org/15108
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2015-04-27 00:33:57 +00:00
Noel Grandin 184a00b962 loplugin: inlinesimplememberfunctions
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-06-09 10:10:13 +02:00
Stephan Bergmann 8f97326bdd So ZCodec::ReadAsynchron was wrong in using a persistent mpIStm after all
The fun thing is that with the (only) call-site to ReadAsynchron in
PNGReaderImpl::ImplReadIDAT (vcl/source/gdi/pngread.cxx) passing in rIStm
references to stack-allocated SvMemoryStream instances, mpIStm could point to an
old, destroyed instance from a previous call, but which would have been located
at exactly the same stack address as the currently passed in rIStm, so the wrong
mpIStm->Read call would effectively behaved exactly the same as a correct
rIStm.Read call.

This went unnoticed "since the beginning" until AddressSanitizer's
UseAfterReturn check came along...

Change-Id: I7c75ed2d36a4c24c111d88eff647816bd2c5dbca
2014-05-21 18:29:57 +02:00
Stephan Bergmann c5a603ce24 ZCodec::mpIStm is apparently(?) effectively only used by ReadAsynchron
...(which can be called multiple times in a row).  But which actually looks
wrong...

Change-Id: I2e4914e6fed8ced383e430699dd462add9da8c08
2014-05-21 18:29:57 +02:00
Stephan Bergmann 66351a678e Split ZCodec::ImplInitBuf into InitCompress, InitDecompress
Change-Id: I2714b1f1dadc74f8501203bc8b0722c56c9c5fb9
2014-05-21 17:35:56 +02:00
Stephan Bergmann 1c92fbf4fd Replace ZCodec::mbInit with sane enum
...and document how the member functions are supposed to be called from client
code.

Change-Id: Ia4847945e4a361c43a0ed001e3e78e901c9abcad
2014-05-21 17:03:41 +02:00
Stephan Bergmann 4d2113250f ZCodec::UpdateCRC is private
Change-Id: I2103f8a323d0454bdd1c779aadb99889ae1cf6e5
2014-05-21 15:30:18 +02:00
Stephan Bergmann b928cfb512 Remove unused ZCodec::IsFinished
Change-Id: I9741daf288c11dc8e0f0ad2f64e934e814c3ef8a
2014-05-21 15:30:18 +02:00
Stephan Bergmann 47169087c1 Remove unnecessary GZCodec derivation
Change-Id: Id710a1fe4a3c1593add69bb2a7014d26f9499e87
2014-05-21 15:30:16 +02:00
Stephan Bergmann a1ec916df8 Remove unused ZCODEC_BEST_SPEED, ZCODEC_BEST_COMPRESSION macros
Change-Id: Ibdf211b858c25a4b301cbde3dcab3a51765e4050
2014-05-21 15:30:16 +02:00
Stephan Bergmann 200d530f47 Split ZCodec::BeginCompression param into its 3 independent components
Change-Id: I275abafe81c8bb617c70646244b14f6cecc33854
2014-05-21 15:30:16 +02:00
Stephan Bergmann e05a200249 Remove unnecessary ZCODEC_DEFAULT macro
Change-Id: I57a5a14a51c0441e0fed006457ac95057f188462
2014-05-21 15:30:15 +02:00
Stephan Bergmann 201d429ad0 Remove unnecessary ZCODEC_DEFAULT_STRATEGY macro
...and directly use zlib.h's Z_DEFAULT_STRATEGY

Change-Id: Ibf528cbc32afec4d442656aa2963f50c0875d6a5
2014-05-21 15:30:15 +02:00
Stephan Bergmann a34d0fb56f Remove unused ZCODEC_ZFILTERED, ZCODEC_ZHUFFMAN_ONLY macros
Change-Id: Ie02fb495beebd02d8331e547cbe6648dc70f241f
2014-05-21 15:30:14 +02:00
Stephan Bergmann b2e5b0ec14 Remove unnecessary DEFAULT_IN/OUT_BUFSIZE macros
Change-Id: Icd509f55b3f91c4ce3b21bfa3a501d99532539d9
2014-05-21 15:30:14 +02:00
Stephan Bergmann 5271e5b01b nMemUsage is always MAX_MEM_USAGE
...so just use zlib.h's MAX_MEM_LEVEL directly.

Change-Id: I76d73f665df242bfb180b76aa7054cf8ddbe9e67
2014-05-21 15:30:14 +02:00
Stephan Bergmann fe1e1d1292 A single ZCodec ctor suffices
Change-Id: Ib831b80afcdde98928a2759616810923348f65e8
2014-05-21 15:30:13 +02:00
Stephan Bergmann faac2327e9 Clean-up C-style (void) parameter lists
Change-Id: I41da8920e33dfdd0f1483ea2d7cf67111224b441
2014-05-21 15:30:13 +02:00
Stephan Bergmann 362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +02:00
Stephan Bergmann 70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Alexandre Vicenzi 409727fa65 fdo#63154 Remove unused solar.h reference in tools
Change-Id: Icd21bbc91ae3587140fe8b0982fc8223fed0903b
Reviewed-on: https://gerrit.libreoffice.org/8505
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-09 11:25:45 -05:00
Jan Hubicka 3db6d2cb99 GCC 4.9, LTO: libvcl uses GZCodec but it is not linked with the implementation
This is not valid C++ and GCC now resolves the virtual calls and inlines
destructor that leads to undefined symbols.

Change-Id: I841d25bc6f994f0e73665b174994f9471597131e
2014-02-18 19:57:31 +01:00
Norbert Thiebaud b43343b0e7 fdo#65108 inter-module includes <> include/tools
Change-Id: I5f44f041e465230d10d562e8bd6f141848465e07
2013-11-09 18:48:48 -06:00
Thomas Arnhold 4e0670b763 fixincludeguards.sh: include/{toolkit,tools}
Change-Id: I5572c320431222be2405f8c2dc8adeafe4f3828b
2013-10-23 23:22:29 +02:00
Norbert Thiebaud 710f41b7ae Clean String and sal_Bool in tools
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655
Reviewed-on: https://gerrit.libreoffice.org/4627
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-30 04:58:49 +00:00
Bjoern Michaelsen b9337e22ce execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/
and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details

Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
2013-04-23 22:20:31 +02:00