summaryrefslogtreecommitdiff
path: root/sax
AgeCommit message (Collapse)AuthorFilesLines
2018-12-06Join the thread only if launch succeeded.Michael Meeks1-1/+0
Change-Id: Idee779cea587e11f6d0f7902182c9394e73d46eb Reviewed-on: https://gerrit.libreoffice.org/60488 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/60544 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 5f3a3de26fca5e3e37e4a08940fa4bf9da5e5ecc) (cherry picked from commit c595e7c60b7040510a9541e8fb8535db60a356d3)
2018-12-06Ensure fastparser thread is joined in case of exceptions.Michael Meeks1-0/+1
Change-Id: Ie0fb21776514a9a67e9fdff2ae856392cd711adb Reviewed-on: https://gerrit.libreoffice.org/60542 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit d06a8ce1434c1dcb45770e08395443771f57f1e9) (cherry picked from commit 8325f20088c812fedbb94d8fd421c652f6d73db9)
2018-09-17Join the thread only if launch succeeded.Michael Meeks1-1/+1
Change-Id: Idee779cea587e11f6d0f7902182c9394e73d46eb Reviewed-on: https://gerrit.libreoffice.org/60488 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/60544 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2018-09-17Ensure fastparser thread is joined in case of exceptions.Michael Meeks1-1/+17
Change-Id: Ie0fb21776514a9a67e9fdff2ae856392cd711adb Reviewed-on: https://gerrit.libreoffice.org/60542 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2018-04-12ofz#7110 ensure join is called on std::exceptions as well as uno::ExceptionCaolán McNamara1-6/+6
Change-Id: I1d17301e4d7f951b7176d5a91c0dca0ef051b2a2 Reviewed-on: https://gerrit.libreoffice.org/51831 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit cc709725803901edbb2c4c1cc4dad4114d91ef74)
2018-01-08ofz#4392 sax: guard access to Entity::maSavedException with mutexMichael Stahl1-3/+30
The problem here is presumably that the parser thread reports a low-level SAX exception and the main thread reports a high-level filter exception at the same time, so both threads modify maSavedException concurrently. Change-Id: Ic8ce9a4992208a24a111c990a67be163858ddaf8 Reviewed-on: https://gerrit.libreoffice.org/47478 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 2a88f62ac01daa72b6287a8cedccfb78579a6067) Reviewed-on: https://gerrit.libreoffice.org/47539
2018-01-07ofz: always free with xmlFreeParserCtxtCaolán McNamara1-79/+77
Change-Id: I90aed11ae0a29a0e9fc725b297e10a7ed30c9942 Reviewed-on: https://gerrit.libreoffice.org/45533 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 5591aa360874c9133d046eeaa1c315df1a441bc4) Reviewed-on: https://gerrit.libreoffice.org/47538 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22Make loplugin:unnecessaryparen warn about (x) ? ... : ... after allStephan Bergmann2-8/+8
...which had been left out because "lots of our code uses this style, which I'm loathe to bulk-fix as yet", but now in <https://gerrit.libreoffice.org/#/c/45060/1/> "use std::unique_ptr" would have caused an otherwise innocent-looking code change to trigger a loplugin:unnecessaryparen warning for pFormat = (pGrfObj) ? ... (barring a change to ignoreAllImplicit in compilerplugins/clang/unnecessaryparen.cxx similar to that in <https://gerrit.libreoffice.org/#/c/45083/2> "Make not warning about !! in loplugin:simplifybool consistent", which should also have caused the warning to disappear for the modified code, IIUC). Change-Id: I8bff0cc11bbb839ef06d07b8d9237f150804fec2 Reviewed-on: https://gerrit.libreoffice.org/45088 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: I2a10e087a776ac96b3193226610577227d2492a8 Reviewed-on: https://gerrit.libreoffice.org/44655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ia544298334364ece3b3963a4adc00c5e01189b91 Reviewed-on: https://gerrit.libreoffice.org/44654 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
2017-11-03loplugin:constparam in vcl,svtoolsNoel Grandin1-2/+2
Change-Id: I7a3eb2bfda869e9e66db919f929ead60cf8890a4 Reviewed-on: https://gerrit.libreoffice.org/44209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31loplugin:constantparam in sal,saxNoel Grandin2-15/+10
Change-Id: I7ca2fd05d1cf61f9038c529a853e72fedb1c9ed0 Reviewed-on: https://gerrit.libreoffice.org/44087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26loplugin:constmethods in unotoolsNoel Grandin1-2/+2
Change-Id: I13df4e184a826682f34a1d9e974b601397ba4a3d Reviewed-on: https://gerrit.libreoffice.org/43865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-25ofz#3752 Integer-overflowCaolán McNamara1-11/+5
Change-Id: I211327928a86f706513ebd78cff979283396e742 Reviewed-on: https://gerrit.libreoffice.org/43777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25loplugin:constmethod in tools,sax,UnoControlsNoel Grandin5-5/+5
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-25ofz#3769 Integer-overflowCaolán McNamara1-8/+5
Change-Id: Ia245c6042f8c662bab870cf166db94d1cf2db9d3 Reviewed-on: https://gerrit.libreoffice.org/43781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-23loplugin:includeform: saxStephan Bergmann6-9/+9
Change-Id: If54794f72502a11612e85f99713e553f91d4025e
2017-10-23overload std::hash for OUString and OStringNoel Grandin1-2/+1
no need to explicitly specify it anymore Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec Reviewed-on: https://gerrit.libreoffice.org/43567 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin1-1/+1
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-18allow events to accumulate past limit if an exception is pendingCaolán McNamara1-1/+8
Change-Id: Ic54c31961b887e06267aba1ceb0378508d24ded0 Reviewed-on: https://gerrit.libreoffice.org/42411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-17protect against short fileCaolán McNamara1-2/+1
Change-Id: I20c6a6fb34485f42c2a828618e8918d8a441860a Reviewed-on: https://gerrit.libreoffice.org/42389 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-17ofz: string has to be at least 5 chars longCaolán McNamara1-2/+1
Change-Id: I98c50a59c03fc886d50362b9c5dd8c84f60e0b62 Reviewed-on: https://gerrit.libreoffice.org/42379 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-16ofz: leak on fdo72541-1.fodtCaolán McNamara1-33/+33
Direct leak of 64 byte(s) in 2 object(s) allocated from: #0 0x600ca0 in operator new(unsigned long) /src/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:82 #1 0x86860c6 in (anonymous namespace)::Entity::getEventList() /src/libreoffice/sax/source/fastparser/fastparser.cxx:538:32 #2 0x8683e1d in (anonymous namespace)::Entity::getEvent((anonymous namespace)::CallbackType) /src/libreoffice/sax/source/fastparser/fastparser.cxx:552:29 #3 0x8684201 in sax_fastparser::FastSaxParserImpl::callbackStartElement(unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, unsigned char const**) /src/libreoffice/sax/source/fastparser/fastparser.cxx:1071:29 #4 0x8683cfb in (anonymous namespace)::call_callbackStartElement(void*, unsigned char const*, unsigned char const*, unsigned char const*, int, unsigned char const**, int, int, unsigned char const**) /src/libreoffice/sax/source/fastparser/fastparser.cxx:306:18 #5 0x5d178b6 in xmlParseStartTag2 (/out/fodtfuzzer+0x5d178b6) #6 0x5d1b979 in xmlParseTryOrFinish (/out/fodtfuzzer+0x5d1b979) #7 0x5d1ac9d in xmlParseChunk (/out/fodtfuzzer+0x5d1ac9d) #8 0x8682d9e in sax_fastparser::FastSaxParserImpl::parse() /src/libreoffice/sax/source/fastparser/fastparser.cxx:1040:25 #9 0x868a537 in (anonymous namespace)::ParserThread::execute() /src/libreoffice/sax/source/fastparser/fastparser.cxx:289:23 #10 0x514e7be in salhelper::Thread::run() /src/libreoffice/salhelper/source/thread.cxx:40:9 #11 0x1931a41 in threadFunc /src/libreoffice/include/osl/thread.hxx:185:15 #12 0x51d47a1 in osl_thread_start_Impl(void*) /src/libreoffice/sal/osl/unx/thread.cxx:237:9 #13 0x7fdeb7b396b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9) Change-Id: Ie0a04d4b887e3bb764e8fa80212dc5d5b3965aca Reviewed-on: https://gerrit.libreoffice.org/42355 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-13New rtl::isUnicodeScalarValue, rtl::isSurrogateStephan Bergmann1-2/+2
There are apparently various places that want to check for a Unicode scalar value rather than for a Unicode code point. Changed those uses of rtl::isUnicodeCodePoint where that was obvious. (For changing svtools/source/svrtf/svparser.cxx see 8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3 "Revert 'svtools: HTML import: don't put lone surrogates in OUString'".) Other uses of rtl::isUnicodeCodePoint might also want to use rtl::isUnicodeScalarValue instead. As a side effect, this change also introduces rtl::isSurrogate, which is useful in a few places as well. Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535
2017-09-13sax: allow some debug logging in FastParserMichael Stahl2-1/+8
Multi-threading makes this difficult; have it print synchronously where it is in the input when setting: SAL_LOG="+INFO.sax.fastparser+WARN" SAX_DISABLE_THREADS=1 Change-Id: I8c77974acb2b4d4e273fc9c0f273c345d8feb2ff
2017-09-13sax: improve READMEMichael Stahl1-1/+10
Change-Id: Ide71867ca1ad3ae43c18159585df6d0dafcbe586
2017-09-12clang-tidy modernize-use-emplace in package..saxNoel Grandin3-6/+6
Change-Id: Ibc0258fd79df987a0e295552bcc5bf89ee12007a Reviewed-on: https://gerrit.libreoffice.org/42173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-05tdf#112164 sax: handle errors on last call to XML_Parse()Michael Stahl1-5/+10
If XML_Parse() is called with isFinal=1 and there are open tags, that is an error (XML_ERROR_NO_ELEMENTS) that must be converted to an exception. This reveals that we already had an incomplete input document, which needs to be moved to "fail" now. Change-Id: I7ce3b51bd87923b5edde621508cf38d7ebbc2b14
2017-08-17remove unnecessary use of OUString::getStrNoel Grandin1-12/+12
Change-Id: I3d13e1c0bb6aa4a7aacc463198747c1368ebc9b4 Reviewed-on: https://gerrit.libreoffice.org/38114 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11sax parser: remove long-disabled codeThorsten Behrens1-135/+0
Entity ref and decl was disabled since 2014, let's remove it now. Change-Id: I35dac78b8530bab99e955bf68dfe3f8951a63f99 Reviewed-on: https://gerrit.libreoffice.org/40998 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-08-02remove unnecessary use of 'this->'Noel Grandin3-8/+8
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4 Reviewed-on: https://gerrit.libreoffice.org/40671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-20sax: Check if it starts with 5 bytes of "<?xml"Takeshi Abe1-3/+3
Change-Id: Iec5b748b188c7b1bf61e8137faf4b3f2d480d7f1 Reviewed-on: https://gerrit.libreoffice.org/40139 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17RTL_UNICODETOTEXT_INFO_{DEST|SCR}BUFFERTOSMALL should use TOO, not TOChris Sherlock1-2/+2
I have kept the old mispelled constant for backwards compatibility Change-Id: I128a2eec76d00cc5ef058cd6a0c35a7474d2411e Reviewed-on: https://gerrit.libreoffice.org/39995 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-07-17loplugin:constparams in basegfx,sax,shellNoel Grandin5-10/+10
Change-Id: I90a9d105a6db146ae64cff56983def94b9472a95 Reviewed-on: https://gerrit.libreoffice.org/40043 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-16comphelper: move base64 encode/decode helpers from saxAshod Nakashian1-156/+4
Change-Id: I02e33793736003f36976bc8b518c389a31082dbe Reviewed-on: https://gerrit.libreoffice.org/39991 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-07-05new loplugin unnecessaryparenNoel Grandin3-3/+3
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-03Translate German comments and debug strings (leftovers in dirs sal to sc)Johnny_M1-8/+8
Translates leftovers found using a custom regex and manually checking the rest of the affected file. Additionally: - A few spelling fixes Change-Id: I2b83bd11adf520b90bb29c8ea624990759dad3c6 Reviewed-on: https://gerrit.libreoffice.org/39427 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-07-02loplugin:casttovoid: saxStephan Bergmann1-1/+0
Change-Id: Id8ac78d146dc63168fe9f76c94cd1bf0d2b1b6d9
2017-06-29Added find function to FastAttributeList:Mohammed Abdul Azeem1-0/+8
It returns a FastAttributeIter, which can be used to obtain value in different formats directly. Also, avoids one unnecessary iteration. Change-Id: Ic28e0177100738bbd71a3a89634cae9f1f7ee996 Reviewed-on: https://gerrit.libreoffice.org/39380 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-06-26loplugin:oncevar in oox..saxNoel Grandin1-4/+2
Change-Id: I0fee8bcddaeea48335e3be05761d2ad2c45020e2 Reviewed-on: https://gerrit.libreoffice.org/39238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23loplugin:unusedfields in registry..saxNoel Grandin2-5/+0
Change-Id: Ie0e2ecaadb49273cb4e78bc894111523940e7c8e Reviewed-on: https://gerrit.libreoffice.org/39098 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16Literal tab character is bad XML, write '&#9;' insteadEike Rathke1-4/+2
Additionally, it *may* have caused document corruption when loading such an .xlsx file, though a small test case with an embedded literal tab character could not reproduce the behaviour. See https://ask.libreoffice.org/en/question/100615/sudden-corruption-of-xlsx-file-bug/ and note that the literal tab character is a mere assumption, but it would be possible. Change-Id: Ia9d33955f1196222d335a1a4807fba78df4e4d85
2017-06-15[API CHANGE] Add processingInstruction event to XFastDocumentHandler:Mohammed Abdul Azeem4-2/+58
Also made changes in FastParser impl. to emit this event. I've made use of existing namespace and element name strings to store target and data for this event. Change-Id: I6f00cd1172552dd9a74ec22190bef3d2289ae515 Reviewed-on: https://gerrit.libreoffice.org/38784 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-06-14use more SAL_N_ELEMENTS part 2Noel Grandin1-2/+2
Change-Id: If00e371c3cd3ae616309a172c875faed016e391b Reviewed-on: https://gerrit.libreoffice.org/38773 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-01convert SAX_ARGS_ARG macros to varargs template methodsNoel Grandin1-34/+11
Leave the macros in place for now, because there is still more of this stuff in sc/../xestream.hxx Change-Id: I633e12ee572010823e0a223b529a07b00e707b78 Reviewed-on: https://gerrit.libreoffice.org/38295 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-09cleanup osl/diagnose.h includesJochen Nitschke4-4/+0
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-05-07revert OSL_ASSERT changesChris Sherlock1-4/+4
Change-Id: I365d140446bd2a62cf8256acbfdd53fe72987380
2017-05-07tdf#43157: convert sax module away from OSL_ASSERT to assertChris Sherlock1-4/+4
Change-Id: Ie9e5a123e69269a2ea193923d4d130a947f2388d
2017-05-04Replace all OUString("") with OUString()Arnaud Versini1-2/+2
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>