summaryrefslogtreecommitdiff
path: root/sax
AgeCommit message (Collapse)Author
2019-09-01Fix '..'Andrea Gelmini
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for lines ending with ".." instead of "..." It passed "make check" on Linux. Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe Reviewed-on: https://gerrit.libreoffice.org/78356 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-08-24loplugin:returnconstval in sal..scNoel Grandin
Change-Id: I300d14d580d450ec338129918955651b9d40d5d2 Reviewed-on: https://gerrit.libreoffice.org/78059 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23loplugin:returnconstval in saxNoel Grandin
Change-Id: Icf5c337164b71aab10dd960815eee516822c276c Reviewed-on: https://gerrit.libreoffice.org/77990 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-22loplugin:constmethod in saxNoel Grandin
Change-Id: I73e8322107d4c3f8890f6c1d059e4853de489d6e Reviewed-on: https://gerrit.libreoffice.org/77932 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in package..scNoel Grandin
Change-Id: Ibaa9ebd6440d9229ba313f4c130f5752d432b338 Reviewed-on: https://gerrit.libreoffice.org/77792 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20Fix typosAndrea Gelmini
Change-Id: Ib61f500f7f9199e524d6ba4de419eda7fb30abcf Reviewed-on: https://gerrit.libreoffice.org/77761 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-17Simplify Sequence iterations in postprocess..saxArkadiy Illarionov
Use range-based loops, STL and comphelper functions Change-Id: If738d8f4e792c4686870183b0c0fdfbb61fd3351 Reviewed-on: https://gerrit.libreoffice.org/77245 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-12Fix typosAndrea Gelmini
Change-Id: Ia40e7a9031ae5a8385a84f177a9444f4d4f348b4 Reviewed-on: https://gerrit.libreoffice.org/77302 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): saxStephan Bergmann
Change-Id: I2b8122f9633a0c4450e7a453abdb15f14c16d178 Reviewed-on: https://gerrit.libreoffice.org/76655 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-26cid#1448394 try silence unsafe_xml_parse_configCaolán McNamara
Change-Id: I7dd015a497ffe8b953652f22aa8bbb35e0788efd Reviewed-on: https://gerrit.libreoffice.org/76356 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-24cid#1448394 can't change xml_parse_config settingCaolán McNamara
Change-Id: I8c45c9d5e0a6bc7439aa4d0827e4752ec364d12c Reviewed-on: https://gerrit.libreoffice.org/76247 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-23close some more holes in structuresNoel Grandin
and improve the pahole script so I can just run it once over the whole codebase Change-Id: I7e1775974a3a61f8c0e40646158f01163ace60cc Reviewed-on: https://gerrit.libreoffice.org/76122 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-30Resolves: tdf#125279 do not double _x005F_ escapementEike Rathke
Reading OOXML _x005F_ escaped content may not get unescaped, so when writing back to OOXML do not attempt to escape it again, i.e. write _x005F_xHHHH_ as is and not as _x005F_x005F_xHHHH_. This is more a workaround, the proper fix would be to unescape _x005F_ content upon read. But then the entire "invalid XML character" escapement and handling control characters rat tail would come into play. Change-Id: I3d31dc84a362753c23a8c89f7a5d7bfd06e4367b Reviewed-on: https://gerrit.libreoffice.org/73187 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-05-30Reintroduce mbXescape that got overaggressively removedEike Rathke
with commit d4d37662b090cb237585156a47cd8e1f1cbe2656 CommitDate: Fri Oct 12 12:46:45 2018 +0200 loplugin:constfields in reportdesign,sal,sax which killed also the bGood checking and later because that wasn't used anymore also the SAL_WARN_IF() was eliminated with commit 41eeaace84b45c803fff3ebd5ab981f0ad09393b CommitDate: Mon Oct 29 15:12:26 2018 +0100 loplugin:oncevar The mbXescape variable will be used, as the TODO said.. Change-Id: I11091379c27cf0222677595eb723b61ad3ebe4e8 Reviewed-on: https://gerrit.libreoffice.org/72302 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-05-12Use hasElements to check Sequence emptiness in sax..sdextArkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: If6a567708d3c59355d54933fad23c85195846624 Reviewed-on: https://gerrit.libreoffice.org/71763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-10an uno -> a unoCaolán McNamara
Change-Id: I538db88f8477dd2d2ad25c372928fec6c11d979d Reviewed-on: https://gerrit.libreoffice.org/72105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-19Further cleanup of FastSerializerHelper's startElement/singleElement[NS]Mike Kaganski
Drop FSEND_t: C-style varargs code was replaced since version 6.0 in commit d43fc40718217d89cc95cc3c0bc0b8e7926abcc0, so it's time to remove the last bits. Drop int-to-string macros that are simple wrappers over OString::number. Avoid unnecessary string type conversions. Change-Id: I86478577b8e469f99b5a90619e5f78a61f4f23fb Reviewed-on: https://gerrit.libreoffice.org/70964 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-17loplugin:sequentialassign in scNoel Grandin
Change-Id: I9287d266cd5267e194f2539f95a7efff3824e9b1 Reviewed-on: https://gerrit.libreoffice.org/70715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-14tdf#120703 PVS: V581 ifs with identical conditionsMike Kaganski
V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Change-Id: I18562d60e33c7ecff14807976dde4cbcae3f665b Reviewed-on: https://gerrit.libreoffice.org/70731 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-07Don't use resettable/clearable guard where plain guard is enoughMike Kaganski
Also use scope where possible. This allows to limit guard scope at language level; visualises the scope clearly; and helps avoiding errors like fixed in commit 61e4437c857854b331fa01da6f39b2b3b58a800b. Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41 Reviewed-on: https://gerrit.libreoffice.org/70376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-07log nice exception messages whereever possibleNoel Grandin
Change-Id: Idd125c18bee1a39b9ea8cc4f8c55cddfd37c33e1 Reviewed-on: https://gerrit.libreoffice.org/68579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-23loplugin:unusedfields in l10ntools..saxNoel Grandin
Change-Id: I6e4ff4853c3995072b020af54549dc81303a4fde Reviewed-on: https://gerrit.libreoffice.org/68225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-12Simplify containers iterations in reportdesign, sal, saxArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09loplugin:indentation in registry..saxNoel Grandin
Change-Id: I4b877751818febaec8e64018335dca691a476a43 Reviewed-on: https://gerrit.libreoffice.org/67561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-28o3tl::make_unique -> std::make_unique in sax...svtools (except sc)Gabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: I6eea0877eaa1886b64c0cce06a43b8088cbccd8e Reviewed-on: https://gerrit.libreoffice.org/66751 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-11Replace OUStringBuffer::appendCopy with append(std::u16string_view)Stephan Bergmann
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice2eb8c5994bf2ccb88972332ca4a1d3ed41752a Reviewed-on: https://gerrit.libreoffice.org/63826 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-23convert CallbackType to scoped enumNoel Grandin
and drop unused INVALID constant Change-Id: Ifbfaeb209ed75af99f8e531105b9f23541034648 Reviewed-on: https://gerrit.libreoffice.org/63890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-10clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2Tamás Zolnai
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d Reviewed-on: https://gerrit.libreoffice.org/63241 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2018-10-30tdf#42949 Fix IWYU warnings in include/sax/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I8061ef6a7a8c04baf350844fae1f97836ac03554 Reviewed-on: https://gerrit.libreoffice.org/62399 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-29loplugin:oncevarNoel Grandin
Change-Id: Iba892694acb378887a1d15ab59104c55f591f0bd Reviewed-on: https://gerrit.libreoffice.org/62498 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
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-21tdf#120703 (PVS): handle failed reallocMike Kaganski
V701 realloc() possible leak: when realloc() fails in allocating memory, original pointer 'mpChunk' is lost. Consider assigning realloc() to a temporary pointer. Change-Id: If85475cf22ea10e4db35532724d947e4e9005e91 Reviewed-on: https://gerrit.libreoffice.org/62091 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-17ofz: thread shenanigansCaolán McNamara
Change-Id: I638b4e670f88aee78b6bd9ec638014795e103971 Reviewed-on: https://gerrit.libreoffice.org/61851 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12loplugin:constfields in reportdesign,sal,saxNoel Grandin
and improve the rewriter so I spend less time fixing formatting Change-Id: Ic2a6e5e31a5a202d2d02a47d77c484a57a5ec514 Reviewed-on: https://gerrit.libreoffice.org/61676 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-12clang-tidy misc-throw-by-value-catch-by-referenceNoel Grandin
Change-Id: I04750771b63551fd3df522753a4ed21b8d5c42f3 Reviewed-on: https://gerrit.libreoffice.org/61680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-03no need to call empty() before clear()Noel Grandin
found with git grep -A2 -nP '!.*\.empty()' | grep -B1 -w clear Change-Id: I87013eab9c6988048b891d20577e1f7efbce1b6c Reviewed-on: https://gerrit.libreoffice.org/61295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-14Join the thread only if launch succeeded.Michael Meeks
Change-Id: Idee779cea587e11f6d0f7902182c9394e73d46eb Reviewed-on: https://gerrit.libreoffice.org/60488 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-09-12Ensure fastparser thread is joined in case of exceptions.Michael Meeks
Change-Id: Ie0fb21776514a9a67e9fdff2ae856392cd711adb Reviewed-on: https://gerrit.libreoffice.org/60361 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-09-10loplugin:simplifyconstruct in reportdesign..saxNoel Grandin
Change-Id: I7d2a754cdc5576b5a5b35db2fbffd19ea17c16ff Reviewed-on: https://gerrit.libreoffice.org/60224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-31tdf#42949 Fix IWYU warnings: boost/optional in include/Gabor Kelemen
Found with bin/find-unneeded-includes a few low hanging boost/optional headers. This gets us about 75M includebloat reduction; still much to go Change-Id: I5c737631767970f9145609aad298a5d11e3fed65 Reviewed-on: https://gerrit.libreoffice.org/59840 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-14create appendCopy method in OUStringBufferNoel Grandin
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-13ofz#9591 Indirect-leakCaolán McNamara
==18428== 12,809 (176 direct, 12,633 indirect) bytes in 1 blocks are definitely lost in loss record 2,664 of 2,683 ==18428== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==18428== by 0x8D1CBC8: xmlNewDoc (tree.c:1171) ==18428== by 0x8D0C43D: xmlParseEntityDecl (parser.c:5521) ==18428== by 0x8D0F017: xmlParseMarkupDecl (parser.c:6802) ==18428== by 0x8D11588: xmlParseInternalSubset (parser.c:8305) ==18428== by 0x8D1733A: xmlParseTryOrFinish (parser.c:11977) ==18428== by 0x8D17DDA: xmlParseChunk (parser.c:12263) ==18428== by 0x3060C380: sax_fastparser::FastSaxParserImpl::parse() (fastparser.cxx:1041) ==18428== by 0x3060B6DC: sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) (fastparser.cxx:850) ==18428== by 0x3060E675: sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) (fastparser.cxx:1357) ==18428== by 0x2F4B2ABE: SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) (xmlimp.cxx:485) ==18428== by 0x34E2C12C: filter::odfflatxml::OdfFlatXml::importer(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler> const&, com::sun::star::uno::Sequence<rtl::OUString> const&) (OdfFlatXml.cxx:150) Change-Id: I63885b837e7311330255457da3a368bd3f4f8921 Reviewed-on: https://gerrit.libreoffice.org/58933 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>