summaryrefslogtreecommitdiff
path: root/sax
AgeCommit message (Collapse)AuthorFilesLines
2017-09-18sax: Check if it starts with 5 bytes of "<?xml"Takeshi Abe1-5/+3
Reviewed-on: https://gerrit.libreoffice.org/40139 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit b64e564492220b34c14f069e8e1f42675bd9abe6) ofz: string has to be at least 5 chars long 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> this should presumably be 5, rather than 4 Change-Id: Iec5b748b188c7b1bf61e8137faf4b3f2d480d7f1 98c50a59c03fc886d50362b9c5dd8c84f60e0b62 20c6a6fb34485f42c2a828618e8918d8a441860a Reviewed-on: https://gerrit.libreoffice.org/42395 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 44815f1439bb36e9fb5f0181c541fc4d0c9422f1)
2017-09-08tdf#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. (cherry picked from commit e530a7ddb1c9423487ce936e6b23b8e36449d555) tdf#112164 add test document (cherry picked from commit aad2cdce2a2e89f35366c55878129d268cc92bef) Change-Id: I7ce3b51bd87923b5edde621508cf38d7ebbc2b14 Reviewed-on: https://gerrit.libreoffice.org/41965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 3604ca211204b9a0971a65c96a5075ba43f15693)
2017-02-17Also consider saved exceptions when mbEnableThreads is trueMike Kaganski1-0/+4
Previously, saved exceptions are only checked in FastSaxParserImpl::parse(), which is used in case mbEnableThreads is false (when data in input stream is no more than 10000). This patch also enables the same check for the other case. Change-Id: Ie718556b7c01322e30698515ecd331b7ebad4105 Reviewed-on: https://gerrit.libreoffice.org/33249 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 18ae77a065cb8ae6940d4067f6ab7e99a3f74047)
2016-10-28tdf#103544: DOCX exp.: Image loss when have a frame anchored to the same para.Tamás Zolnai1-5/+1
Regression from: 83d51e5e52688c4c9bc0ad70a511458bb06a242d Partly revert the commit causes this regression. I checked the related bugs (tdf#78590,tdf#80748) intended to be fixed by this commit and reverting this part does not bring back the corruption. I guess something changed in frames' and text boxes' import in the meantime, because this MergeMarks::IGNORE is useless now. Change-Id: If17776e8628561961c7ce2a2994e3fc609f75639 Reviewed-on: https://gerrit.libreoffice.org/30351 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2016-10-13loplugin:unnecessaryoverrideNoel Grandin2-12/+0
Change-Id: I08c55a3023ec2e8990098eeb60e91cd18556e7ae Reviewed-on: https://gerrit.libreoffice.org/29656 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-12tdf#103159 allow compiling on 12.04 systems stillJustin Luth1-9/+15
"An uncaught exception of type com.sun.star.xml.sax.SAXParseException [internal line 13]: Namespace prefix manifest on file-entry is not defined" regression from 3aa52d36824d11b8774de15708fdfcbb93cd9dc3 which states that "initialization parameter to FastParser will turn off the namespace declaration missing exception." However, although it doesn't RAISE the exception, it doesn't prevent it either. Change-Id: I26ea02444132e5370dcb4821a75181bc8c76e553 Reviewed-on: https://gerrit.libreoffice.org/29731 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2016-09-15loplugin:singlevalfields in l10ntools..saxNoel Grandin2-22/+6
and ignore URE headers in the plugin Change-Id: I939df744c1173cf0f67d515f6c3fb4ac4cb25588
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann4-4/+4
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-30loplugin:stringconstant: adapt to improved OUStringLiteral1 (sax)Stephan Bergmann1-1/+1
Change-Id: Ia39a4f4689ae0d6e2b7303a89251634bfe0eeb2f
2016-08-25cid#1371329 Misused comma operatorNoel Grandin1-2/+2
Change-Id: Iba29bce22c59b25a452b454e2b7cad3c4e95f3a3
2016-08-25cid#1371333 Misused comma operatorNoel Grandin1-2/+2
Change-Id: I5288cfb4e86bbcf07df1c74cdacdd5f0e7bf03fb
2016-08-16loplugin:stringstaticStephan Bergmann1-15/+15
Change-Id: I3812abe3b275bc1b89e340d0e8f52aa1d67905e8
2016-08-10GSoC - Making legacyfastparser to use tokens:Mohammed Abdul Azeem3-54/+206
This tokenizes some elements, de-tokenize while consuming and emits elements through legacy interface. DummyTokenHandler is just to test the correctness. Change-Id: I1ea1e4d806ed4d426215f93b3f6b66a9776f6479 Reviewed-on: https://gerrit.libreoffice.org/27849 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-08Related: tdf#99312, add specialized interaction handlerGiuseppe Castagno1-0/+1
Needed to manage https certificates and authentication whenever needed. Change-Id: If20b85a9b349b203a8c46d453afa823629d114cb Reviewed-on: https://gerrit.libreoffice.org/27927 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
2016-08-05loplugin:countusersofdefaultparams in oox..sdNoel Grandin1-2/+2
Change-Id: I4504939a3957606979c6ac36af6611e1fe072d01 Reviewed-on: https://gerrit.libreoffice.org/27902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-29GSoC - moving FastAttributeList::clear to consumer thread:Mohammed Abdul Azeem1-8/+42
this shares the load of clearing the attributes list with the consumer when producer is busy. Change-Id: I6e89858703c7af9c30b2d99fd6825dc81290b488 Reviewed-on: https://gerrit.libreoffice.org/27649 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-27GSOC - Avoid tokenizing strings for Unknown elements:Mohammed Abdul Azeem2-58/+67
Added a special case when token handler is not set, which avoids tokenizing strings. Change-Id: I749a7af22e45180cc8bfc55843832b7ccb529ac6 Reviewed-on: https://gerrit.libreoffice.org/27593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-19GSOC - Handling namespace declaration missing case:Mohammed Abdul Azeem5-5/+82
initialization parameter to FastParser will turn off the namespace declaration missing exception. Test cases have also been given to verify the same. Change-Id: I4c3e02c7ad92d50e279f895ced53c78fc8f49b91 Reviewed-on: https://gerrit.libreoffice.org/27278 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-17loplugin:passstuffbyrefStephan Bergmann1-1/+1
Change-Id: I7c8cd99210d1048b73e074831080e9c7121292fc
2016-07-16GSoC - Sync namespace handler calls with elements:Mohammed Abdul Azeem3-5/+31
This syncs the namespace declaration calls with element's events. A test case is also added which enables threads of fastparser. Change-Id: Ic40a380c8523688ee6b2ec76bb3d36a0452923bd Reviewed-on: https://gerrit.libreoffice.org/27222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-15new loplugin unnecessary overrideNoel Grandin1-0/+1
Change-Id: I88d3e33823d68745b98625050a8a274f9ef04bcb Reviewed-on: https://gerrit.libreoffice.org/27135 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-07-10loplugin:unreffunStephan Bergmann1-1/+0
Change-Id: I8649e6bbe3b5c1189ef3c07bcbc1c2155d265b59
2016-07-09GSOC: Adapt XLegacyFastParser to function like XParser.Mohammed Abdul Azeem3-175/+121
Made XFastParser to pass namespace prefix instead of URI for Unknown attributes and elements, Namespace handler is provided to resolve those. Test for XFastParser unknown elements is removed, since testing XLegacyFastParser indirectly tests that also. Change-Id: Ia41ff5d3d4c07cef0ca23ba858bfb2a94b91b1f5 Reviewed-on: https://gerrit.libreoffice.org/26982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-08loplugin:staticmethodsStephan Bergmann1-27/+22
Change-Id: Ia9a3b93df2c885a56705b35b88fe0a8f50a10b74
2016-07-08GSOC: Added test case for mishandle of namespaces.Mohammed Abdul Azeem1-0/+78
Added a test case for misuse of namespace declaration and resolving an element name. Change-Id: Iadda81a82353de45418fff6315c2d9b94626126a Reviewed-on: https://gerrit.libreoffice.org/26661 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-07-08loplugin:redundantcast: redundant static_casts in saxStephan Bergmann1-1/+1
Change-Id: I8f9398a0d6e362c8f786e17e63ec48e4c4f77866
2016-07-07loplugin:passstuffbyref also for {css::uno,rtl}::ReferenceStephan Bergmann2-2/+2
Change-Id: If18f0a749c1e474c302fd797c2a2abc2b33a0730
2016-07-04use SAL_DEPRECATED in uno::ReferenceNoel Grandin1-1/+1
and fix a couple of usages that have crept in Change-Id: Ia3e7fcc05dac6e0d205e69c0e0372c74653e7c5e Reviewed-on: https://gerrit.libreoffice.org/26851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-17loplugin:refcountingStephan Bergmann1-6/+6
Change-Id: I39fbc89cffe25e85b8cd1f2e36f0a20c07e33497
2016-06-17loplugin:passstuffbyrefStephan Bergmann1-1/+1
Change-Id: I2fb13854a6da3f114dba386169e5aef7f741b922
2016-06-17GSoC: Mapping legacy sax parser and XFastParserMohammed Abdul Azeem4-8/+325
This implements legacy parser interface using XFastParser, and unit test is also added. Change-Id: Ia2eb7d517d80a3f7ec0cf26ffa2e5747ad22b186 Reviewed-on: https://gerrit.libreoffice.org/26229 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-06-16loplugin:refcountingStephan Bergmann1-4/+4
Change-Id: Iafc3987df4357098aab816fb7fd4619f9a6ee173
2016-06-15GSoC: sax2/ unit tests:Mohammed Abdul Azeem3-41/+190
Parsed the same test files using XFastParser and built string, we asssert that both the strings built from XParser and XFastParser are identical. Change-Id: Ie1e0dc6b676ca32dd10d75c3cb272b5c8b795ab7
2016-06-09tdf#94698 cleanup Makefiles. Get rid of udkapi and offapiGleb Mishchenko1-4/+1
This patch changes occurences in makefiles from $(eval $(call gb_CppunitTest_use_api,comphelper_test_config, \ udkapi \ offapi \ )) to $(eval $(call gb_CppunitTest_use_sdk_api,comphelper_test_config)) (corrected instead of abandon, jani) Change-Id: Ic96ec65d82d7452e288f05a8b6d576ef543b068e Reviewed-on: https://gerrit.libreoffice.org/23426 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-06-08Let loplugin:passstuffbyref also look at fn defn not preceded by any declStephan Bergmann2-2/+2
Change-Id: I752bc96d2d521d790e919283cabb14b6526626f4
2016-05-31teach refcounting clang plugin about uno::ReferenceNoel Grandin3-5/+6
uno::Reference is only allowed to used with classes that have a ::static_type member. So convert all those places to rtl::Reference. Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and uno::Reference to make this a little smoother? Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3 Reviewed-on: https://gerrit.libreoffice.org/25516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-29loplugin:unreffunStephan Bergmann1-1/+0
Change-Id: I31e62926ddfddc8bbdab681a55cdc381d3275794
2016-05-28sax2/ unit tests.Mohammed Abdul Azeem10-33/+197
Test xml files are added, string is built for each file and namespaces are handled. Change-Id: I0ab799ca5c9de7311ccca2a6033a96e02598064f Reviewed-on: https://gerrit.libreoffice.org/25468 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-05-22-Werror,-Wunused-private-fieldStephan Bergmann1-1/+1
Change-Id: I286afa5f5f849217c282c8408822522d9ce5a10b
2016-05-19loplugin:unreffun and loplugin:nullptrNoel Grandin1-2/+2
Change-Id: I0b8e094d5f5db4b9add46894c4a606256c2d6904 Reviewed-on: https://gerrit.libreoffice.org/25159 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19First cut at adding sax2/ unit tests.Mohammed Abdul Azeem5-0/+243
This is a first-step towards implementing the legacy parser using the XFastParser. Change-Id: I37fc0419dbef1d6f067e45e0b1f2fd6051fb158d Reviewed-on: https://gerrit.libreoffice.org/24883 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann1-2/+2
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-05clang-tidy modernize-loop-convert in oox to saxNoel Grandin2-5/+5
Change-Id: If0d87b6679765fc6d1f9300c6972845cf3742b9c Reviewed-on: https://gerrit.libreoffice.org/24674 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-04tdf#94260 Convert pixel to 1/100 mmRosemary Sebastian1-9/+15
The scaling factor 0.28 is chosen as per https://www.w3.org/TR/2001/REC-xsl-20011015/slice5.html#pixels Change-Id: I8dc7846699fbb2aa6e2a181a041b66d3cc33b8e5 Reviewed-on: https://gerrit.libreoffice.org/24547 Reviewed-by: Oliver Specht <oliver.specht@cib.de> Tested-by: Oliver Specht <oliver.specht@cib.de>
2016-04-21loplugin:salbool: sal_Bool[] -> bool[]Stephan Bergmann1-6/+6
Change-Id: I3c5bf7a53c9ae173f8fce885ecf022f092aa43a9
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann2-3/+3
Change-Id: I923b1b92f07c2db6d88c7682f1733fd8fd765f90
2016-04-18clean-up: unused using declarations and includesJochen Nitschke1-1/+0
Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-13loplugin:passstuffbyref in saxNoel Grandin1-1/+1
Change-Id: I95f0a17b9b8bab592a60f6b5223b4668c5355275
2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke1-1/+0
Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-11clang-tidy performance-unnecessary-value-param in saxNoel Grandin1-2/+2
Change-Id: I46aad7b0a96210e5f3f278c3f6f3a945825b7cae