summaryrefslogtreecommitdiff
path: root/hwpfilter
AgeCommit message (Collapse)Author
2022-03-28ofz: ensure unsigned indexCaolán McNamara
Change-Id: I38d6238a6eede0188f942229b2fb931614e56309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132043 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-03-17hwpfilter: why isn't that path string null terminatedMichael Stahl
Change-Id: Iaedc23bd91d0d46e34d55dcc65760b73c5772b7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131559 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 4c86ed851bc1c0a2414e254082064760c99437f1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131593 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-03-07ofz#45314 limit to valid day/month indexesCaolán McNamara
Change-Id: Ibf53fa1a0c1db3046a25367fb79da3b90f7cd924 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131021 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2022-03-02ofz: don't register style if hbox load failedCaolán McNamara
Change-Id: I4d9d5d76f0c2385871003720e933ed1926f66c70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130771 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2022-03-01ofz#44997 Use-of-uninitialized-valueCaolán McNamara
Change-Id: I3803232ddc7346967e22770ae2bdbc3378779f8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130488 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130458 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-01cid#1501377 Dereference after null checkCaolán McNamara
Change-Id: I9dceb5c33f62df16b43429ba502b0d12180fa403 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130694 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f5f3eaa63f24093453af08ad01967ae17f108af2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130674 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-01ofz#44991 keep paragraph's that failed to load until import is completeCaolán McNamara
to avoid dangling references to them Change-Id: Ic8710f63a8cf6a6a665348c7c84bf0b43f0e2c83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130643 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-28ofz#44991 keep within legal ArrowShape rangeCaolán McNamara
Change-Id: I6bf70f27a66ba9b355a3f7ae0c68a696a7284871 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130562 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-28ofz#44991 Use-of-uninitialized-valueCaolán McNamara
Change-Id: I0e3bcce489b665bac3e470e743394935a2ba3a18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130558 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-28ofz#44991 don't skip over terminatorCaolán McNamara
Change-Id: Ibc942705a788db60c104d00916a45d595596285e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130560 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-23keep paragraph's that failed to load until import is completeCaolán McNamara
LIBREOFFICE-509JU93T Change-Id: I526edb182fed4fa023cce58e78a650a7c2046ed3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130326 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-02-11use our own tempfile mechanismCaolán McNamara
Change-Id: Ie7853ea8bd083d1056872cfad4323ff6cede235f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129071 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 45c15e1112e03b8b211ed0968ed1b16d5ed4ddfe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129758
2022-02-11avoid dangling tmp files in hwp importCaolán McNamara
if there is embedded data use office-binary-data to transport it instead of a temp file https: //issues.oasis-open.org/browse/OFFICE-3933 Change-Id: Ia1cebf0770c99210df09f03dbb507451d9cf7764 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129076 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit e95d5d5666505cb05e9660f24f6c7ae039451ef8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129759
2021-06-02no need to allocate these on the heapNoel Grandin
Change-Id: Ie7b8a5ee280da5dfcb15d217a4daccaf485cfbe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-14Improve loplugin:stringviewStephan Bergmann
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for operator call arguments. (The "rather than copy, pass subView()" diagnostic is already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly for operator call arguments.) (And many call sites don't even require an explicit [u16]string_view, esp. with the recent ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator += overloads". Just some test code in sal/qa/ that explicitly tests the O[U]String functionality had to be excluded.) Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-11Fix typoAndrea Gelmini
Change-Id: Ia6fc35fa8e6c43686b84e441ea3949b7ecbb78a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113954 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-11ofz#31685 give up on large tables to avoid TimeoutCaolán McNamara
Change-Id: I99a7cdede74c4e8a661579467624f21fcf9132df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113931 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-11Related: ofz#31685 Timeout. This hunk is a simple swapCaolán McNamara
Change-Id: Ia4c0f2727c0278496c68f54eca3046a924fa21e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113930 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-07Updated README.md files to represent current code / use Markdown formatHossein
Previously, all of the README files have been renamed to README.md and now, the contents of these files were changed to use Markdown format. Other than format inconsistency, some README.md files lacked information about modules, or were out of date. By using LibreOffice / OpenOffice wiki and other documentation websites, these files were updated. Now every README.md file has a title, and some description. The top-level README.md file is changed to add links to the modules. The result of processing the Markdown format README.md files can be seen at: https://docs.libreoffice.org/ Change-Id: Ic3b0c3c064a2498d6a435253b041df010cd7797a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113424 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-03-26ofz#32499 overflowing posCaolán McNamara
Change-Id: I164537acbb4d4bcf7dee51a029ffb518a3687fda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113150 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-03-24Using .md extension/Markdown syntax for modules READMEHossein
Renaming all README files for all top level modules to README.md, applying no content change at this stage to be able to track history of the files. These files should be edited to use correct Markdown syntax later. Change-Id: I542fa3f3d32072156f16eaad2211a397cc212665 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112977 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-23loplugin:refcounting check for managing OWeakObject with raw pointerNoel
Change-Id: I7471725f1e658940b5e6993361c327be6ccf0d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111064 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16loplugin:referencecasting in hwpfilter..lotuswordproNoel
Change-Id: Ib4a1ae456c44638386425e690a089360e991b26c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-01Drop FAR/NEAR from 16-bit WinAPI timesMike Kaganski
Change-Id: Idf71c662138c281333a83cc76a9d75cbf086f362 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-24Use ContainerType().swap and avoid local variablesMike Kaganski
Change-Id: I773555180758a97aff37f9bc27de83c355d71521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109761 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-04update pchesCaolán McNamara
Change-Id: I3e22c2000da03f6f3345353846213203993aa865 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107192 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-13tdf#123936 Formatting files in module hwpfilter with clang-formatPhilipp Hofer
Change-Id: I0c2d06e03f2fbb15ddb35e3d24f1cf2f926dc4dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105676 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-11convert more long -> tools::LongNoel
found by grepping and changed by hand. Change-Id: I3c720859dba430fde3abc76c6c5cb58269efaf4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-22long->tools::Long in hwpfilter..ooxNoel
Change-Id: I9ab8876aac7b2f8b488db6dfa9c6fd0cecd2238b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104626 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-27Remove unused include list in hwpfilterJulien Nabet
Change-Id: I7cac4483173e7c75413a6b17a468659ee2790768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103508 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-07Make the OUString ctors taking raw sal_Unicode pointer/non-const array explicitStephan Bergmann
...and in turn add OUString::operator = and OUString::operator += overloads that take a std::u16string_view. Without making the ctors explicit, the operator overloads would have caused ambiguities when called with raw sal_Unicode pointers/non-const arrays, as those can convert to both OUString and to std::u16string_view. But the std::u16string_view operator overloads will generally be useful when changing OUStringLiteral similarly to 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String", at which point many existing uses of OUStringLiteral will be replaced with uses of std::u16string_view. Implementing this change turned up a need for an operator = overload for OUStringNumber, which has thus been added. No such need turned up for a corresponding operator += overload, but which can easily be added when the need arises. It also revealed that the operator == overloads between an OUString and a raw sal_Unicode pointer/non-const array were implemented rather inefficiently, creating a temporary OUString from the raw argument. Those have been improved. Preceding commits have already taken care of many dubious or simply unnecessary implicit uses of the now-explicit OUString ctors. This commit makes explicit the few remaining reasonable uses. (And in some cases needed to change variable initialization syntax from using parentheses to using curly braces, to avoid the most vexing parse issue. And needed to explicitly add OUString ctors from char16 const[2] string literal lvalues in a conditional expression in writerfilter/source/ooxml/OOXMLFastContextHandler.cxx that are only necessary because MSVC apparently still insists on doing array-to-pointer decay there.) All of this only affects LIBO_INTERNAL_ONLY. Change-Id: I7ce31162e9be1c3ff3c0bd184a34b535ec56be9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102098 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-05Improve hchar_string to OUString conversionStephan Bergmann
...assuming the way of constructing an OUString from just a hchar_string::c_str pointer, ignoring hchar_string::length, was not chosen deliberately to cut off the input string at a potential embedded NUL. (This change is a prerequisite for making the OUString ctor taking a raw pointer explicit.) Change-Id: I172a5627354c3da7105e50763edcb31cd89633e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102089 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-29Fix typo in codeAndrea Gelmini
It passed "make check" on Linux Change-Id: I2d6f6521b8862eb49de5f074fc48da956d2c8303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101592 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-19Fix typosAndrea Gelmini
Change-Id: Ideee477b0c8f0d472a607ed69ba51351d87f61bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101010 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2020-07-14hwpfilter: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation. And move the code out of a header file into a .cxx file. Change-Id: I37b88e1d5173c9064f1b733b5d38fc40a463e2a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98677 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-01Upcoming improved loplugin:staticanonymous -> redundantstatic: hwpfilterStephan Bergmann
Change-Id: I6f5a81cf83d15b9c8a21bf0581c009bdfe03f4a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97564 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-04Upcoming loplugin:elidestringvar: hwpfilterStephan Bergmann
Change-Id: I7c9a8fe33d06236f66c201267650fcbea29dc43c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95478 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-29loplugin:simplifybool in hwpfilter..lotuswordproNoel Grandin
Change-Id: Iedfd492c963eb89fe75fdd73cae630e7e1dae119 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95100 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29GCC trunk towards GCC 10 still emits a bogus -Wstringop-truncationStephan Bergmann
Change-Id: I86e7bf7615bd31ed90b067cebfbaf0126c8d8c2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84055 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-04-08loplugin:flatten in hwpfilterNoel Grandin
Change-Id: Ie3e970ec0fc761cf8a5e16ea72b7e95c28462234 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91846 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-16clang-format f*,h* with under 5-percent lines of changeMuhammet Kara
Files which could become clang-format conformant with under 5-percent lines of change relative to the total count of lines in the file are found by using bin/find-clang-format.py, and fixed with /opt/lo/bin/clang-format -i <path-of-the-file> There will be follow-up patches to fix all 'under-5-percent' files. Change-Id: I702c09bcd3a9a113b3d66c30edb6cf3b7e6a6593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88776 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-12clang-analyzer-deadcode.DeadStoresNoel Grandin
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-03loplugin:duplicatedefines (clang-cl)Stephan Bergmann
(already defined in hwpfilter/source/hwplib.h) Change-Id: Id85048817b825ad265eba20e221c0703467b66b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87890 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>
2020-01-27tdf#124176: Use pragma once instead of include guardsHakan Bakacak
Change-Id: I65639e32765ba0804aeb5b5880eca2b5d186485e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87431 Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com> Tested-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-01-24loplugin:makeshared in hwpfilter..i18npoolNoel Grandin
Change-Id: I2e757043215164df173c89e21cebe2f4c9c05de9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>