351 Commits

Author SHA1 Message Date
Michael Meeks
59003de73e fastparser: fix load regression
Remove erroneous assert: maSavedException is indeed empty for
XML parser reported exceptions. Clean cut/paste code, and comment.

Change-Id: Ia538bcc87a7efcd079d3021e00ac4d2eb62f3e8d
2013-12-20 16:21:43 +00:00
Stephan Bergmann
ae3a0c8da5 Add .component <implementation constructor="..." feature
...to directly call constructor functions of ComponentContext-based C++
implementations of (non-single-instance) UNO services.  The case where these
calls would need to be bridged across different environments (e.g., from gcc3
to gcc3:affine) is not yet implemented.

bootstrap.component and expwrap.component are adapted accordingly as a proof-of-
concept (which had previously been adapted to use the prefix="direct" feature,
which may become unnecessary again in the end, depending on how to handle
single-instance services/singletons).  More to follow.

Change-Id: I18682d75bcd29d3d427e31331b4ce8161dbb846d
2013-12-19 08:48:56 +01:00
Stephan Bergmann
71f33636da Change from ServiceManager- to ComponentContext-based implementations
Change-Id: Iba701c520ad27925bb5e67697e22132b53160ab2
2013-12-18 11:13:58 +01:00
Matúš Kukan
291e846db9 sax: various clean up. Move _getFactory next to the implementation.
Use more anonymous namespaces, de-duplicate code, bin some comments.
Makes the library smaller.

Change-Id: Id0cefdcaa72a74741303fc27e36038488ef8b059
2013-12-18 07:15:48 +01:00
Matúš Kukan
b6cebf4a3e Allow UNO component libraries to have each implementation in its own function.
Demonstrating on expwrap library.

There is hope, this will bring code size savings for mobile
platforms, where we don't need every implementation.

Change-Id: I3519fb6148fd7a47ed9df092c73779ea6add552f
2013-12-18 07:15:46 +01:00
Michael Stahl
64575a5b91 sax: avoid usage of double for parsing nanoseconds here too
Change-Id: Iddf93a116cb333db6465a915dae692c33a60241a
2013-12-17 18:32:43 +01:00
Stephan Bergmann
b9bcc9c5c1 ...and nDigits > 9 is harmless in following for loop and need not be capped
Change-Id: I30c4005e5983f5007edfed692b74f07b31899755
2013-12-17 17:29:58 +01:00
Stephan Bergmann
71448690d7 readUnsignedNumberMaxDigits can read more than maxDigits chars
...so that is what the std::min was good for that the previous commit erroneously removed.

Change-Id: I0cb08ab79f85ce4b919232845994c9b8bae35646
2013-12-17 17:20:42 +01:00
Stephan Bergmann
695671eb18 Avoid inaccurate floating-point computations
...otherwise at least my --disable-dbgutil --disable-debug Linux x86_64 build
failed the CppunitTest_sax_cpputest with 8999999 vs. 9000000 nanoseconds.

Change-Id: I05e0febf413f9f9e01227a0cc4e0f46a5243fe61
2013-12-17 16:56:35 +01:00
Stephan Bergmann
9ed364774c Adapt all (non-extension, SharedLibrary) .components to environment="..."
Change-Id: I56f38bd786f3a026cb2908f28540dc9c4003af83
2013-12-17 11:06:00 +01:00
Marcos Paulo de Souza
eebc1e9a8a fdo#60698: Merge fastsax and sax_shared into expwrap
Change-Id: I6f8c6827c00db50184a46f39968f882b944d18d4
Reviewed-on: https://gerrit.libreoffice.org/6967
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2013-12-11 20:45:30 +00:00
Michael Stahl
cc407e50e8 sax, xmloff: fix ODF import/export of text:time/text:time-value
The value written for an Impress time field is something like
text:time-value="0000-00-00T23:28:07" (in LO 3.5+) or
text:time-value="0-00-00T23:28:07" (in OOo 3.3) which contains an
invalid all-zero date.  Such values are actually rejected by the
ODF import since commit ae3e2f170045a1525f67e9f3e9b7e03d94f2b56b.

Actually there was no real support to read the RelaxNG type
timeOrDateTime before.

So fix that by:
- adding convertTimeOrDateTime/parseTimeOrDateTime functions to
  sax::Converter
- recognizing and ignoring the 2 invalid all-zero values written by
  LO 3.5 and historic OOo respectively
- writing a bare "time" in text:time-value if the DateTime struct
  contains zero Date members
  (Older OOo versions and AOO cannot actually read that, but everything
  they _can_ read is invalid ODF...)

Change-Id: I754076caee74a5163ed3f972af0f23796aa14f9f
2013-12-10 15:28:53 +01:00
Michael Stahl
b6785eb595 sax: stop using SAX_DLLIMPLEMENTATION for both sax and fastsax
Change-Id: I243ec20015beec6b98ee0af55eb7c387008f32f1
2013-12-03 13:29:35 +01:00
Markus Mohrhard
223fb84c0b no inheritance so no virtual needed
Change-Id: Ia6c481bbf5353db4c2801a53ae1455534c6978bd
2013-12-03 05:56:24 +01:00
Kohei Yoshida
4afa538b7b Hide the implementation.
Change-Id: Ibfd9bf626a40c3ec4eb18d09944e8943163595c8
2013-12-02 23:04:39 -05:00
Kohei Yoshida
532b2f4818 Add a means to check if a namespace exists.
Useful when we just need to check if the stream has a certain namespace
defined. Calling getNamespaceURL() may throw SAXException in such case.

Change-Id: Ib2b7b202492390158270d87bab95d1793c9d8a70
2013-12-02 19:32:28 -05:00
Kohei Yoshida
2130fd9d61 Move this header out into a public place.
Change-Id: I356b26947d1018276d8a9ff6012fdad3ca2c0fd8
2013-12-02 19:32:28 -05:00
Kohei Yoshida
8ef9d65177 Remove inline methods from the header.
Change-Id: Ie2cff194c1db5eaa992c4bcaaa06ec9a419d85a7
2013-12-02 19:32:28 -05:00
Kohei Yoshida
4ba42fc8df Move this out of the namespace scope.
Change-Id: I4aec1d45edb47ea16adaa8d2ac23340b8f421bae
2013-12-02 19:32:27 -05:00
Michael Meeks
1afc1c033b Urgh - add embarassingly missing ~
Change-Id: I6ffcb1561920eba2cbc3fa019431d84f07386570
2013-11-27 10:06:37 +00:00
Michael Meeks
bc90fb9e30 fastparser: Outline virtual destructor to please MSVC++.
Change-Id: I8368698e80e5ebe339b822a9e0e767e8ba867e07
2013-11-27 09:48:06 +00:00
Michael Meeks
d8db8ea918 fastparser: strncmp needs a length. 2013-11-26 17:39:26 +00:00
Stephan Bergmann
9eaf15563a Presumably wants to use strcmp
Change-Id: I978a692fbf464b476811b445b16c7e1b0eec9e25
2013-11-26 17:31:29 +01:00
Michael Meeks
30a8fbbf1b fastparser: special case xmlns more sensibly. 2013-11-26 17:33:44 +00:00
Michael Meeks
d7280af974 fastparser: Avoid copying all tokens into a sequence. 2013-11-26 17:33:44 +00:00
Michael Meeks
2d681ad020 fastparser: don't waste cycles churning reference counts. 2013-11-26 17:33:44 +00:00
Julien Nabet
87cce82dbc cppcheck: fix same expression on both sides
Change-Id: I3de69e2ae186ea1ae8f792588c04b4e799ce1331
2013-11-24 15:07:37 +01:00
Michael Meeks
b7a8fc5585 fastparser: avoid allocation and conversion of elementnames we don't need.
Change-Id: I4c09aaa12b53181e50662de2721d170c195c7c86
2013-11-23 10:03:05 +00:00
Kohei Yoshida
6087da0dd4 getChar() to return a null-terminated char array.
No need to fetch string size with this change.

Change-Id: Iae5f6c60430fc57985a0fec5bfec59727e5a8f0f
2013-11-22 09:03:33 -05:00
Kohei Yoshida
22ea573b74 Expose raw char array and use it to avoid OUString allocations.
In SheetDataContext::importCell().

Change-Id: I52db64219f672ea5fbbda17686bf1173ceac5926
2013-11-20 22:15:29 -05:00
Michael Meeks
9491ca3f64 fastparser: avoid excessive alloc/frees for int / bool / double parsing
Change-Id: I596bbc723558f04588d9e767d64732164524e57a
2013-11-20 12:12:50 +00:00
Noel Grandin
9cb0fc7801 fix spelling in comment
Change-Id: Icae96e2b64709b2a9aaf6a5576c29d9d5c8a9868
2013-11-20 13:56:09 +02:00
Miklos Vajna
ada73e588f sax: -Werror=sign-compare
Change-Id: I2e7d482b29fc5859c32fa1731a5f1fd551509e88
2013-11-20 07:49:00 +01:00
Michael Meeks
fc25afaa04 fastparser: accelerate value tokenisation as well.
Change-Id: I99a39e91c684adb1fc92cdb466477cfa90104961
2013-11-19 20:52:50 +00:00
Noel Grandin
610b2b94b3 remove unnecessary use of OUString constructor when assigning
change code like
   aStr = OUString("xxxx");
to
   aStr = "xxxx";

Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
2013-11-19 10:29:31 +02:00
Noel Grandin
d366c9b20e remove unnecessary sal_Unicode casts in various places
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-14 08:17:32 +02:00
Noel Grandin
e52779d2f8 remove unnecessary use of OUString constructor
Change-Id: Ifb220af71857ddacd64e8204fb6d3e4aad8eef71
2013-11-11 11:21:26 +02:00
Marcos Paulo de Souza
da5449da0c fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d
Reviewed-on: https://gerrit.libreoffice.org/6423
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2013-10-25 08:07:04 +00:00
Stephan Bergmann
b13c8de265 FastTokenHandler service should apparently have a default constructor
Change-Id: Iad5c4e05832128b5f41860cc4ae96f0472c37491
2013-10-21 22:57:10 +02:00
Tor Lillqvist
e2d061fe93 WaE: unreferenced local variable
Change-Id: I9783f03e656049b4f3b7f0a26a7ae626db5a13f6
2013-10-21 09:13:43 +03:00
Matúš Kukan
94f99a6bae sax: build fix: don't prefix enum values
Change-Id: I6f4eac6103821227bc72de8c3bb0fb89a7a8bc9d
2013-10-17 22:56:58 +02:00
Matúš Kukan
aeca826f34 fastparser: don't use multithreading for small documents
Determined by XInputStream::available().

Change-Id: I450f4796d9c072b395393582bfc3e1e7768e243b
2013-10-17 21:38:40 +02:00
Matúš Kukan
7aa35dcb43 fastparser: don't create temporary Events; use references to event list
Change-Id: I1e12fbeeb90d6020d0566d05fc0318082e1da5fc
2013-10-17 21:38:39 +02:00
Matúš Kukan
6f1a110a37 fastparser: reuse event lists if possible
Instead of allocating and freeing the memory all the time.

Change-Id: I53800abaca51d42d7d44a98fb271de7df7f90f58
2013-10-17 21:38:38 +02:00
Michael Meeks
902748b6ff fastparser: re-work locking, add high & low watermarks, change sizes etc.
Change-Id: I7fe1435addc6dce5a74a8411f7825cea331a5b3f
2013-10-17 21:38:38 +02:00
Matúš Kukan
9612bdbfa9 fastparser: implementation using two threads
Instead of calling methods directly, generate EventList - vector of
Events, where arguments for the callee are stored.

Change-Id: I227a0ef3038566664ac8f294770152c8b445997b
2013-10-17 21:38:38 +02:00
Michael Meeks
2df047bfd1 fastparser: cache default namespace token for ooxml.
Change-Id: Iee98ec92380d6d0404ab236e062ddbc2378cda43
2013-10-17 21:38:37 +02:00
Matúš Kukan
c293e73e8f FastAttributeList: avoid OStrings in attribute list; just use char buffer
Change-Id: I4879563fae3b85c68bbd1c4b260f9833848f4bda
2013-10-17 21:38:37 +02:00
Matúš Kukan
9ae701509a FastAttributeList: use vectors instead of map; the size is small
This is also preparation to avoid OString internal usage.

Change-Id: If0ea36155d8ab3f5c91c2aafd6932fabeadadd41
2013-10-17 21:38:37 +02:00
Matúš Kukan
bc2d6ef106 fastparser: remove duplicated OString version methods
Also remove AttributeData and make the two for-cycles faster.

Change-Id: If0343992173bb333eee39c33bcb86acaa5a3d288
2013-10-17 21:38:36 +02:00