summaryrefslogtreecommitdiff
path: root/hwpfilter/source/hwpfile.cxx
AgeCommit message (Collapse)Author
2021-12-22loplugin:flatten in filter..includeNoel Grandin
Change-Id: I74c1ea8b9b490eaa9508a885758224063e39051b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127235 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-13ditch problematic HWPFile::Read4b variantCaolán McNamara
Change-Id: Ied3603d8f96e15013f657fc5d8150969ae3b808d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123534 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-19Fix typoAndrea Gelmini
Change-Id: I8babf7975eb3b8f3e43f72572e75cbf46f510b20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119147 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-07-01Related: ofz#33724 detect earlier if comparison shape has no cshapeCaolán McNamara
Change-Id: I23e2c464ffda5de892ae78a188b4c25b81b61fd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118213 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-01can flatten this a levelCaolán McNamara
Change-Id: I71742038c2a2ac8e335a404e99f5412430c0ff8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118212 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-01ofz#33724 compareParaShape will return 0 if input shape has no cshapeCaolán McNamara
so return early in that case and avoid the expensive loop Change-Id: Ibdde814322c6e9c094c3652c28e0d79887d1f5bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118211 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-01fix indentCaolán McNamara
Change-Id: I8ee2ac371be458b08993f1e197a2f78986e03545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118201 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-01getParaShape() adds bounds checking we don't need in this caseCaolán McNamara
Change-Id: I02f917169fcae0dc5bdfc55653cd21fe67eac9c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118200 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-28loplugin:indentation improve checks for brace alignmentNoel Grandin
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15loplugin:buriedassign in f,h,i*Noel Grandin
Change-Id: Iac753e528e13cb2565832a484e87f88061bbc91e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-11ofz#18116 TimeoutCaolán McNamara
Change-Id: If0bf63bacf9b5f7502287b1e465a34806d18b874 Reviewed-on: https://gerrit.libreoffice.org/80641 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-09loplugin:indentation in helpcompiler..ioNoel Grandin
Change-Id: Ia3f05662cc9542feeac3096d29e9dec6d1858620 Reviewed-on: https://gerrit.libreoffice.org/67558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-19clang-tidy readability-misleading-indentationNoel Grandin
Change-Id: I4673fc7c694924b41d048a1918ddb8b0e0af1f79 Reviewed-on: https://gerrit.libreoffice.org/61935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18clang-tidy readability-simplify-boolean-exprNoel Grandin
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64 Reviewed-on: https://gerrit.libreoffice.org/61902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-09loplugin:simplifyconstruct in helpcompiler..ioNoel Grandin
Change-Id: Ibdc1933b5d8d6be1fe42a7df93bd7e1c903bb39b Reviewed-on: https://gerrit.libreoffice.org/60202 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-07loplugin:useuniqueptr in HWPFileNoel Grandin
Change-Id: I0eb3f09b5ca82ce4810aafbb7d5d53f1faa00e3f Reviewed-on: https://gerrit.libreoffice.org/60111 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21loplugin:useuniqueptr in HStreamIODevNoel Grandin
Change-Id: I81ab91bce2a83603b25922593c1fd764b5c0b003 Reviewed-on: https://gerrit.libreoffice.org/59358 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-13loplugin:returnconstant in hwpfilter,testNoel Grandin
Change-Id: I7c7c450f1da4ac3205148d2de8b344f0735f92ba Reviewed-on: https://gerrit.libreoffice.org/58881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-25forcepoint #8 ensure ColumnDef lifetimeCaolán McNamara
Change-Id: Idb0c7b1530dc57f4d7c14751f1b76caecc3b03a6 Reviewed-on: https://gerrit.libreoffice.org/50288 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-26drop the slow pathCaolán McNamara
Change-Id: Ibf9721d852c1b57593e34272214d9f11c0188016 Reviewed-on: https://gerrit.libreoffice.org/48611 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-24loplugin:unused-returns in drawinglayer..svxNoel Grandin
Change-Id: I033a78cc7fe7d8e5086f1c855c4aa371cc98dc7c Reviewed-on: https://gerrit.libreoffice.org/48400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19loplugin:useuniqueptr in hwpfilterNoel Grandin
Change-Id: Id276015425ea7de3cf55b9ef21b4e7ce54c2ce47
2017-11-16ofz: limit depth of hwp parsingCaolán McNamara
Change-Id: Iba38cdea1fa9f3df4340988184adb1e8058ae931 Reviewed-on: https://gerrit.libreoffice.org/44816 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-16loplugin:useuniqueptr in hwpfilterNoel Grandin
Change-Id: If6e8dfcec2842a329229e5c57417ca3f00ef74b3 Reviewed-on: https://gerrit.libreoffice.org/44763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31loplugin:constantparam in f*Noel Grandin
Change-Id: I87145db3af6c3eb180cea6b4244f98b00205a306 Reviewed-on: https://gerrit.libreoffice.org/44095 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-19use std::unique_ptr in hwpfilterNoel Grandin
Change-Id: I3aa6e1342f975420b19e9e21058a0331ed2d71e0 Reviewed-on: https://gerrit.libreoffice.org/43525 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-18Replace some lists by vectors in hwpfilterJulien Nabet
+ simplify some parts Change-Id: I340d6b6d17f591a58c405965367c15be674103d0 Reviewed-on: https://gerrit.libreoffice.org/43439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-29ofz#3201: avoid oomCaolán McNamara
Change-Id: Ia8e171a003f24c73c7f53ca7240e03c6f2492ad3 Reviewed-on: https://gerrit.libreoffice.org/41670 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-18loplugin:constparams in scaddins,hwpfilterNoel Grandin
Change-Id: I91b3559b9c3f5d8837d182cf9406fad9aeee78b3 Reviewed-on: https://gerrit.libreoffice.org/40049 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17ofz#2668 fix oomCaolán McNamara
Change-Id: Ie30b24a0ad6395d59afa2f2c96b48f98a33f18a8 Reviewed-on: https://gerrit.libreoffice.org/40064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-01ofz#1193 we only set these values, never read themCaolán McNamara
Change-Id: Ia2f54b536a4262e19abe260e8e19c9b15cc2d0ec Reviewed-on: https://gerrit.libreoffice.org/36779 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke
with command > git grep -l osl/diagnose.h *.cxx | xargs grep -L -w 'OSL_\w*' | xargs sed -i '/#include *\(<\|\"\)osl\/diagnose.h\(>\|\"\).*/d' headers need more work Change-Id: I906519ebbd47a04703b4fa5943b2f7abea7a97ab Reviewed-on: https://gerrit.libreoffice.org/37350 Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-21treat ParaShape like CharShapeCaolán McNamara
Change-Id: I7870fdeee6bd097c94d7ae58b67506c4ab2a6fb5
2017-04-13ofz#1062 ensure cshape lifecycle matches expectationsCaolán McNamara
Change-Id: I586e9b3546516a0f05d86b2f7dd93e7c292a6795 Reviewed-on: https://gerrit.libreoffice.org/36298 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-06loplugin:useuniqueptr extend to catch more localvar casesNoel Grandin
i.e. where the code looks like { foo * p = new foo; ... delete p; return ...; } Change-Id: Id5f2e55d0363fc62c72535a23faeaaf1f0ac6aee Reviewed-on: https://gerrit.libreoffice.org/36190 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14ofz#860 clear old data before reading new dataCaolán McNamara
Change-Id: I3bf5c2072a328052004c4c0551c2b125cb8ab19b Reviewed-on: https://gerrit.libreoffice.org/35165 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-02Missing includeStephan Bergmann
Change-Id: I2fb82e3c5a9b26b1016cf99e943cf0cc30225495
2017-03-02ofz: oom in reading hwp dataCaolán McNamara
Change-Id: I1e4dc5f474b229d4d68d3fc34bc23c88767e5e50
2017-03-01ofz: ReadBlock has to be HWPIDLen to be usefulCaolán McNamara
Change-Id: Iaa349921972bb19b40bf68c6a3b0c7128cff4b8d
2017-03-01ofz#711: direct leakCaolán McNamara
Change-Id: I65ec47b4290d845f1803b20b93f149d35d9a60ea
2017-02-28hwp: avoid low hanging invalid inputCaolán McNamara
Change-Id: I06133d6db14edb9d915c38e4c120a9d0905495dd
2017-02-26ofz#691 leak of emblist dataCaolán McNamara
Change-Id: Ic4231b93fafe73bf87995f226def64f7c9e131c3
2017-02-25ofz: epic slow use of std::listCaolán McNamara
Change-Id: I790a3098272101fd33f83f21bdcef1bb061efd76 Reviewed-on: https://gerrit.libreoffice.org/34635 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-11-08loplugin:expandablemethods in hwpfilter..linguisticNoel Grandin
Change-Id: I62ae20ab4a47b3b7e2b0d503cedcad3319cc9c85 Reviewed-on: https://gerrit.libreoffice.org/30683 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-02-09Formatting changes across all modulesChris Sherlock
+ Removed comment cruft + Tab formatting in number of files + Some commented out code removed + Tab characters replaced with spaces + Newline cleanup in quite a few files + Tweak header guard #endifs Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc Reviewed-on: https://gerrit.libreoffice.org/22221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-11loplugin:unusedmethods unused return value in hwpfilterNoel Grandin
Change-Id: Ib225db89e60708f6b55b3cb86f8e881386fab86f
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Idec97093ca48c14b825c7b87ec050cc99aadc526
2015-07-16tdf#91067: Translate Korean commentsJihui Choi
Change-Id: Idbee9cb5a1745bb2cc3c4cb1238773da7ff2a0a3 Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>