summaryrefslogtreecommitdiff
path: root/sax
AgeCommit message (Collapse)AuthorFilesLines
2015-03-04V813: Decreased performanceCaolán McNamara1-1/+1
Change-Id: I8a7528366156b288dc422b09cff0d5a32cde3c91
2015-03-02make parsing more cautious with exceptionsLionel Elie Mamane1-0/+5
also handle UNO exceptions that are not RuntimeException Change-Id: I7050de6ee4b2e4f2af2e0a0be42ba65e0bc028db
2015-02-06fdo#75757: Remove inheritance from std::vectorMatthew Pottage2-8/+8
Deprecated comphelper/sequenceasvector.hxx. Rewritten code using it. Using instead the functions containerToSequence and sequenceToContainer, found in include/comphelper/sequence.hxx. One class that inherits from it (in framework/inc/stdtypes.h), and the code using that has been left. Signed-off-by: Michael Stahl <mstahl@redhat.com> Conflicts: writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/TblStylePrHandler.hxx writerfilter/source/dmapper/WrapPolygonHandler.hxx Change-Id: Ice61c94ffb052e389281aebb7cdf185134221061
2015-02-05destructors are not allowed to throwLionel Elie Mamane1-0/+1
so move potentially throwing call to a manually called finish() additionally don't make it leak something that is not a RuntimeException, the caller does not expect it. Change-Id: I8b19585ae197f5ac8625dc85d4c4860a1c11b262
2015-01-27add assert that first element is 0Caolán McNamara1-1/+2
Change-Id: I75602b6941f291703c85c841837b432da455a7ef
2015-01-27sax: minor optimizationMichael Meeks1-3/+3
Change-Id: I4812a567e37789c71af0cc6ba8f5a5caf0e3ec93
2015-01-22WaE: warning C4101: ´e´ : unreferenced local variableCaolán McNamara1-3/+3
Change-Id: Ifa143e5a8f0e8254fbd324032951517d3a30c4c8
2015-01-22sax: fastparser: use cppu::getCaughtException() to avoid sliced exceptionsMichael Stahl1-9/+11
Change-Id: I1cd932ae520ba20eff8ef447614e91e1cc2032f8
2015-01-22sax: there is no OUStringBuffer(char) ctorMichael Stahl1-1/+1
Change-Id: I1811dead8f104a445bfee9282a60ecedeca872ed
2015-01-20Some more loplugin:cstylecast: saxStephan Bergmann6-28/+28
Change-Id: I3ded4f19f73a094dabd2d2da54917290ffe468f5
2015-01-04boost::unordered_map->std::unordered_mapCaolán McNamara1-2/+2
Change-Id: I82f668ef72e916d2ff11df5cda2a02653999f66f
2014-12-20fdo#39440 sax, sc: reduce scope of local variablesMichael Weghorn1-1/+1
This addresses some cppcheck warnings. Change-Id: I589e13ee086cffee481954215a97960db656e633 Reviewed-on: https://gerrit.libreoffice.org/13548 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-18sax: Use appropriate OUString functions on string constantsStephan Bergmann1-2/+2
Change-Id: I44cf4360c323e9f424a559db6d0f271fae7a7f28
2014-12-12sax: Use appropriate OUString functions on string constantsStephan Bergmann1-1/+1
Change-Id: Ic0750322439f15e6c9b99dac9dbb3b8c060ad8e0
2014-12-08fastparser: Redundant check after assertMatúš Kukan1-7/+4
Change-Id: Ibc56102831d4d36392bea4e4e088e207cef99429
2014-12-03Prevent hang during loading of xlsm doc.Kohei Yoshida1-10/+12
* We need to call xmlInitParser() before using it in a multi-threaded way (according to the libxml2 doc). * Better to use 'rEntity' which references the one stored in the vector rather than 'entity' whose copy gets stored in the vector. On Windows at least 'rEntity' and 'entity' hold different parser pointer values. * Free the parser before popping the entity. Popping the entity first then freeing the parser using its pointer value stored in the entity looks weird. Change-Id: I6b64a6d8ac9c1d4fea8339d8fb2d38dfffbba47b
2014-12-02fix crash-190212-093017-986Caolán McNamara1-2/+8
Change-Id: I3d2d57850dcb1fde1c004b4455591071a1fe03fa
2014-12-01We need to tell libxml2 parser to decode entities.Kohei Yoshida1-0/+3
Else we would get raw entity values such as '&#38;' in lieu of '&'. Change-Id: Ib700705fd9b68980306883aa9652579e1686040d
2014-12-01Add message to exceptionMatúš Kukan1-2/+4
Change-Id: I0e7cf850b51343e4afc1ea0a0409ad2c4e596435
2014-11-20proper error reporting from libxml2Luboš Luňák1-33/+7
Change-Id: Ia173f7f4c88c90b6d54c9a47d6ae18b933502678
2014-11-20make FastSaxParser provide the whole content in one characters() callLuboš Luňák1-1/+18
SAX interface is not required to provide the whole node content in one characters() call (e.g. if there's an entity that needs decoding). However it's easier to consumers to assume this (e.g. writerfilter's DomainMapper::lcl_utext() handles datecontrol that way), and expat apparently never used this. However this can happen with libxml2, so ensure such consumers still work. Change-Id: Ib564f372fbea8451f84553a6d49a07d091a950e9
2014-11-17sal: clean up public headers with include-what-you-useMichael Stahl2-0/+2
Sadly cannot forward declare "struct {...} TimeValue;". rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h was painful enough for now... Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-15windows blind fixMarkus Mohrhard1-1/+1
2014-11-14switch saxparser from expat to libxml2Luboš Luňák2-179/+137
Using SAX2 interface provides element/attribute names split into prefix/name, and provides namespaces/urls, so FastSaxParserImpl::callbackStartElement() does not have to figure out these on its own (and additionally libxml2 spends a noticeable portion in xmlStrdup() when not in SAX2 mode). The switch saves about 5-10% time. Change-Id: Idd424d7cc9b30c248179a5bad8ec79dbfc62e765
2014-11-12make FastAttributeList's unknown attribute value be passed as OStringLuboš Luňák1-8/+8
Since that's how it's internally stored anyway, and I have a use case where it's useful to limit the length by passing it to OString ctor. Change-Id: I5903ea4f1b2cdb48c1bbceac6b8e21eb5882d377
2014-11-12allow inserting attributes that have zero lengthLuboš Luňák1-2/+5
Otherwise the strlen() might give an incorrect length if the attribute value is just a part of a longer string. Change-Id: I67eb7baecfa928fdee26c5ea9003bd7fc9b96d59
2014-11-10remove pointless const_castLuboš Luňák1-2/+2
Change-Id: I6026ab64f0cfe1d509c8f94ce3b9c6f700c823cf
2014-11-06Revert "use the new OUString::fromUtf8 method"Stephan Bergmann1-2/+2
This reverts commit 05050cdb23de586870bf479a9df5ced06828d498, not all places that use e.g. OStringToOUString to convert potential UTF-8 are guaranteed to fulfil the prerequisites necessary to use fromUtf8 (and some places like e.g. in codemaker are happy with the best-effort effect of OStringToOUString's OSTRING_TO_OUSTRING_CVTFLAGS).
2014-11-06use the new OUString::fromUtf8 methodNoel Grandin1-2/+2
Change-Id: I771004b7ccab3344a67e827e45bc34c22ffa5f77
2014-11-05fdo#38835 strip out OUString globalsNoel Grandin1-6/+4
they are largely unnecessary these days, since our OUString infrastructure gained optimised handling for static char constants. Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
2014-10-30Fixed typos. No automatic tools (sed, and so on).Andrea Gelmini3-3/+3
Change-Id: Ia43976d84eede6f699381bc4f3daf89b95e4cb4f Reviewed-on: https://gerrit.libreoffice.org/12150 Reviewed-by: Bryan Quigley <gquigs@gmail.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-10-29remove unnecessary 'using namespace rtl' declarationsNoel Grandin5-5/+0
It turns out that almost none of them were necessary. Change-Id: I1311ed28409c682b57ea8d149bcbaf2c49133e83 Reviewed-on: https://gerrit.libreoffice.org/12133 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-25coverity#1249458 Explicit null dereferencedCaolán McNamara1-1/+1
Change-Id: I9e56aa8908ae6747d6820d8b90e85ec07e981223
2014-10-25coverity#1249457 writeFastAttributeList never takes NULLCaolán McNamara3-7/+6
and coverity#1249456 Change-Id: If1f6ef550290d3b6bb53ae87389b466c7d7a31f1
2014-10-25coverity#982640 Missing break in switchCaolán McNamara1-0/+1
Change-Id: I3479a7f219d10301108f24efc273d822c77477d2
2014-10-23WaE: implicit conversion of NULL constant to 'nullptr_t'Tor Lillqvist1-1/+1
Change-Id: I23a85ba05a596b566be35ebecc6b1804c0d0cb62
2014-10-23FastSerializer: Also use cache for writing to ForMerge if we are inside mark()Matúš Kukan3-27/+75
To ensure the correct order of calling ForMerge methods, call flush always before touching maMarkStack. This was the missing piece in optimizing write() methods, because of writeBytes() checking each time what to call. E.g. for Calc documents we don't use maMarkStack at all. So, just transfer the output to proper "ForMerge" when inside mark() and allow optimizations. This commit makes write() methods almost 1/3 as fast. Change-Id: I96c13888206c81f87e29b998839f78ea9d5570af
2014-10-23FastSerializer: Simplify OUString write a bit moreMatúš Kukan1-20/+11
Change-Id: Ifa0746d635ec43cdc37867cf94bcc128bb8e2aca
2014-10-23FastSerializer: Avoid some cycles when dealing with doublesMatúš Kukan3-3/+28
Would be easier to use OStringBuffer, but we can't get its pData member. Also its append(double) is suboptimal (or anything that uses rtl_str_valueOfDouble) - should be doing something like this commit. Change-Id: I8f3140081a574a84f0e60dc85cce1bd2de23cd34
2014-10-23FastSerializer: Use fixed sized Sequence directly as cacheMatúš Kukan1-4/+10
Well, at least the allocated space is fixed size. When passing that to XOutputStream, change the size in a hacky way. Change-Id: I24fa134286e3086beda25c9a6915549e7c69119a
2014-10-23FastSerializer: Use -1 for unknown string lengthMatúš Kukan2-5/+6
Change-Id: I3920caf9d95f20992b7961873f1668468d797e8e
2014-10-23Remove few pointless OUString::number() and one methodMatúš Kukan1-9/+6
Change-Id: I3e9a302a7513eebfeff07402f71fc3dde22e4cc2
2014-10-23FastSerializer: Faster write(OUString): add ascii checkMatúš Kukan1-1/+32
Saves about 80m pcycles for 180k calls. Change-Id: I9c9b3bf5a076df56d1b5b87f0a85ac3404abe8a4
2014-10-23FastSerializer: Simplify a bitMatúš Kukan3-23/+9
Change-Id: I7dee908f5441ad34128d688e1008fd6ffad2ab3f
2014-10-23Unused includes / using-declarationsMatúš Kukan1-9/+0
Change-Id: I8b43635ab1f77b61469f060c9a092f1494388955
2014-10-23FastSerializer: Use faster TokenValue struct when possibleMatúš Kukan3-13/+58
Saves another ~100m pcycles for 650k calls in startElementInternal() Change-Id: I190326edc7feffb900e91fa7e5c3530b5b267f59
2014-10-23FastSerializer: Simplify cache to be fixed sized bufferMatúš Kukan1-33/+13
This makes writeBytes(), which is called a lot, simpler and thus faster. E.g. for ~15m calls, this saves ~110m pcycles. Change-Id: I29d01a1a8651f668aff574e0f015cd2f018eb1cd
2014-10-23This was OString already; use it that wayMatúš Kukan1-5/+4
Change-Id: Ia2268ce8a1e2111adb609c515e5bfa824afa66ce
2014-10-23FastSerializer: Have own fast cache buffer implementation for XOutputStreamMatúš Kukan3-22/+115
Previously comphelper::OSequenceOutputStream was used. Change-Id: I4dc38c8c62422e59efa1071312497364cdf5be3c
2014-10-23FastSerializer: avoid some more OStringsMatúš Kukan4-12/+14
Change-Id: I2d5dbe9adccdd231cc16a1f83a90a4adeb965c64