Commit Graph

132 Commits

Author SHA1 Message Date
0f6888a25b FastSaxSerializer: update documentation
Change-Id: I5e374c426a4741a88d43848392fc83e2368dbf92
2014-07-03 15:47:29 +02:00
83d51e5e52 fdo#80748: Fix for file corruption due to framePr
-For framePr Unit test is there in ooxmlexport.cxx
    -http://opengrok.libreoffice.org/xref/core/sw/qa/extras/ooxmlexport/ooxmlexport.cxx#3578

Change-Id: Ic1fd4c7a863d8ab57c6495e20bff6863eb941688
Reviewed-on: https://gerrit.libreoffice.org/10045
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2014-07-03 13:36:26 +00:00
92b447876d css already means ::com::sun::star
Change-Id: I48d7b746d7cc49246743c62480b0d225d2519342
2014-05-27 14:00:28 +02:00
5b2aaefb89 coverity#982640 Missing break in switch
Change-Id: If2a14edafb72844061dcdd1ee3507d7a215220f1
2014-05-26 10:18:27 +01:00
2bd7767d01 Resolves fdo#70681: fixincludeguards.pl: all that's left
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5
Reviewed-on: https://gerrit.libreoffice.org/9360
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-15 12:50:46 +00:00
248145f99e Find places where uno::Sequence is passed by value.
Implement a clang plugin to find them, and clean up existing code
to pass them by reference.

Change-Id: If642d87407c73346d9c0164b9fc77c5c3c4354b8
Reviewed-on: https://gerrit.libreoffice.org/9351
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-14 08:10:22 +00:00
6ed14fd8f8 sax: sal_Bool->bool
Change-Id: I8d9dd585c509fd4c1f09ee817d828f3e600e31d5
2014-04-07 13:53:49 +02:00
70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
693f1dee0b sax: FastAttributeList - add attribute in a specific namespace
This change is inspired by startElementNS & singleElementNS which
have namespace as first parameter to define the namespace of an
element. Some attributes of a element can be in different namespace
but until now FastAttributeList "add" method did not have a namespace
parameter. This commit adds "addNS" which accepts namespace as a
first parameter.

Change-Id: Iebf8b5e890c17f00a56923efc3506580eed070a9
2014-03-05 20:24:01 +01:00
5e21a413c7 cppuhelper: retrofit std::exception into overriding exception specs
Change-Id: I56e32131b7991ee9948ce46765632eb823d463b3
2014-02-26 18:22:20 +01:00
7efa467ef3 remove unused code sax_fastparser::FastSerializerHelper::copyTopMarkPop()
Change-Id: If1dd0e99d83f8211c58fa3b5d1ba56a74bc2157f
2014-02-25 15:16:56 +02:00
333fdb95a3 remove unused code sax_fastparser::FastSerializerHelper::copyTopMarkPush()
Change-Id: I4569e53f0423783bc5c9ee95b07d0de51b75b466
2014-02-25 15:16:56 +02:00
414fa67bf2 sax: my suggestion was not as good as i thought...
... as indicated by the failing unit test.

Change-Id: I1a8a8b933b10673e71261726dc8887dfe1d3e2ee
2014-02-11 12:52:21 +01:00
785c4f10b8 fdo#72468 avoid out of bounds array access
Change-Id: I2bccdf1aaeb290a3cb8f76cd831a419e1776e92f
Reviewed-on: https://gerrit.libreoffice.org/7775
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-11 10:38:53 +00:00
82625bb98e remove unnecessary sal_Unicode casts in OUStringBuffer::append calls
Convert code like:
    buf.append( static_cast<sal_Unicode>('!') );
to:
    buf.append( '!' );

Change-Id: Iacb03a61de65a895540940953b49620677b3d051
2014-01-07 09:43:37 +02:00
64575a5b91 sax: avoid usage of double for parsing nanoseconds here too
Change-Id: Iddf93a116cb333db6465a915dae692c33a60241a
2013-12-17 18:32:43 +01:00
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
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
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
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
1afc1c033b Urgh - add embarassingly missing ~
Change-Id: I6ffcb1561920eba2cbc3fa019431d84f07386570
2013-11-27 10:06:37 +00:00
bc90fb9e30 fastparser: Outline virtual destructor to please MSVC++.
Change-Id: I8368698e80e5ebe339b822a9e0e767e8ba867e07
2013-11-27 09:48:06 +00:00
d7280af974 fastparser: Avoid copying all tokens into a sequence. 2013-11-26 17:33:44 +00:00
87cce82dbc cppcheck: fix same expression on both sides
Change-Id: I3de69e2ae186ea1ae8f792588c04b4e799ce1331
2013-11-24 15:07:37 +01:00
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
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
9491ca3f64 fastparser: avoid excessive alloc/frees for int / bool / double parsing
Change-Id: I596bbc723558f04588d9e767d64732164524e57a
2013-11-20 12:12:50 +00:00
9cb0fc7801 fix spelling in comment
Change-Id: Icae96e2b64709b2a9aaf6a5576c29d9d5c8a9868
2013-11-20 13:56:09 +02:00
ada73e588f sax: -Werror=sign-compare
Change-Id: I2e7d482b29fc5859c32fa1731a5f1fd551509e88
2013-11-20 07:49:00 +01:00
fc25afaa04 fastparser: accelerate value tokenisation as well.
Change-Id: I99a39e91c684adb1fc92cdb466477cfa90104961
2013-11-19 20:52:50 +00:00
d366c9b20e remove unnecessary sal_Unicode casts in various places
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-14 08:17:32 +02:00
e52779d2f8 remove unnecessary use of OUString constructor
Change-Id: Ifb220af71857ddacd64e8204fb6d3e4aad8eef71
2013-11-11 11:21:26 +02:00
b13c8de265 FastTokenHandler service should apparently have a default constructor
Change-Id: Iad5c4e05832128b5f41860cc4ae96f0472c37491
2013-10-21 22:57:10 +02:00
c293e73e8f FastAttributeList: avoid OStrings in attribute list; just use char buffer
Change-Id: I4879563fae3b85c68bbd1c4b260f9833848f4bda
2013-10-17 21:38:37 +02:00
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
64b993e046 finish deprecation of O(U)String::valueOf()
Compiler plugin to replace with matching number(), boolean() or OUString ctor,
ran it, few manual tweaks, mark as really deprecated.

Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-08-21 15:10:35 +02:00
7ef72aefc6 Mark as const
Change-Id: Ic7ee570935b5d827dc01a483877ea5021da5abea
2013-08-15 22:09:58 +09:00
392c5b2a70 Mark as const
Change-Id: Idd1d0641d5b7d8594f354c7d2e2a9093ecc6b2f7
2013-08-01 04:33:23 +09:00
958556ff3c Remove unused convertDateTimeTZ and convertDateTZ
Change-Id: I177584f6988cf3cb31c5508262d3907ef6be23d7
2013-07-21 13:03:54 +02:00
4ce40c0b06 sax: more s/TimeZone/Timezone/
Change-Id: I9b50e53b131fc835e792c52de6560d77ac454be9
2013-07-15 17:58:09 +02:00
20cbf5bd30 i#108348: support DateTimeWithTimezone in user defined Document Properties
- fix interface of sax::Converter to allow passing time zones
  (rename the parsing methods while at it to reduce pointless overloading)
- SfxDocumentMetaData supports DateWithTimezone and DateTimeWithTimezone
  in user-defined properties
- add some ugly hacks to SfxCustomPropertiesPage to preserve existing
  time zones (which are not displayed in UI currently)

Change-Id: Ice94112b9d79c285f80b5beda15f0ace91db97f3
2013-07-15 15:23:25 +02:00
652ccbdf31 i#108348 API CHANGE: add IsUTC to css.util.DateTime etc.
Add IsUTC member to:

com.sun.star.util.DateTime
com.sun.star.util.DateTimeRange
com.sun.star.util.Time

Add new stucts with explicit time zones:

com.sun.star.util.DateTimeWithTimezone
com.sun.star.util.DateWithTimezone
com.sun.star.util.TimeWithTimezone

Adapt the sax::Converter to read/write timezones, and fix the unit test.

Everything else just uses default (no time zone), this commit is just
to fix the API.

STRUCT: /UCR/com/sun/star/util/DateTime
    nFields1 = 7  !=  nFields2 = 8
    Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/DateTimeRange
    nFields1 = 14  !=  nFields2 = 15
    Registry2 contains 1 more fields
STRUCT: /UCR/com/sun/star/util/Time
    nFields1 = 4  !=  nFields2 = 5
    Registry2 contains 1 more fields

Conflicts:
	sc/source/filter/oox/unitconverter.cxx

Change-Id: I01f7a6d082a6b090c8efe71d2de137474c495c18
Reviewed-on: https://gerrit.libreoffice.org/4833
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2013-07-15 11:46:41 +00:00
ba0a57702c remove OUString wrap for string literals
For some functions and all kinds of Exceptions.

CannotConvertException
CloseVetoException
DisposedException
EmptyUndoStackException
ErrorCodeIOException
Exception
GridInvalidDataException
GridInvalidModelException
IOException
IllegalAccessException
IllegalArgumentException
IllegalTypeException
IndexOutOfBoundsException
NoMasterException
NoSuchElementException
NoSupportException
PropertyVetoException
RuntimeException
SAXException
ScannerException
StorageWrappedTargetException
UnsupportedFlavorException
VetoException
WrappedTargetException
ZipIOException
throwGenericSQLException
throwIllegallArgumentException

createInstance
createInstanceWithContext
forName
getByName
getPackageManager
getPropertyValue
getUnpackedValueOrDefault
getValueByName
hasPropertyByName
openKey
setName
setPropertyValue
supportsService

bash command:

for i in `cat list`; do git grep "$i\s*(\s*OUString(\s*\"" -- '*.[hc]xx'
	| cut -d ':' -f1 | sort -u
	| xargs sed -i
		-e "s/\(\<$i\s*(\)\s*OUString(\s*\(\"[^\")\\]*\"\)\s*)\s*/\1\2/g"
		-e "s/\($i.*\)\"+ /\1\" + /g";
done

Change-Id: Iaf8e641b0abf28c082906014f87a183517630535
Reviewed-on: https://gerrit.libreoffice.org/4624
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-06-29 21:52:54 +00:00
56dc79822d i#108348 sax::Converter: support negative date and dateTime
Change-Id: Ie2726c7ec941a5690e053d39212d7f516e2c27ba
2013-06-29 18:31:25 +02:00
830cc95abb sax: FastSaxSerializer: add well-formedness assertions
In an --enable-dbgutil build, assert on the following XML
well-formedness violations:

* Element Type Match (-> start/end tag mismatch)
* Unique Att Spec (-> duplicate attributes)

Change-Id: I1d5c405b4316ba941be1db7df6cacf00b5837261
2013-06-05 16:55:51 +02:00
cb6d67c21f Spelling "separate" (etc) correctly is hard 2013-05-15 11:14:28 +03:00
9830fd36db date/time IDL datatypes incompatible change
- nanosecond precision
 - signed (allowed negative) year

Also: assorted improvements / bugfixes in date/time handling code.
Some factorisation of copy/pasted code.

Change-Id: I761a1b0b8731c82f19a0c37acbcf43d3c06d6cd6
2013-04-18 21:34:46 +02:00
1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
f32677968a Remove RTL_CONSTASCII_(U)STRINGPARAM in scaddins/sax
Change-Id: Ic4f9bef02cc4bdc74b9a6d81e3317e10b9c79bd4
2013-04-01 22:12:22 +02:00
aa753f01ba -Wunused-macros
Change-Id: Ifaa1637122d6f9cae1e29b77ac36ca5d1f220aed
2013-03-27 09:36:53 +01:00