Commit Graph

511 Commits

Author SHA1 Message Date
2358ccec7e WaE: Unreferenced function definition
Change-Id: I1b5d3f881e82cea90fcc4e97c837251e340abffe
2014-08-13 11:48:07 +03:00
60fddc8731 textenc: disable failing tests on Windows for now
They were never working, at least since
65f82ca62922e2c487ba72b6d67ea7e3a03f8ebc

Which changed some mappings, for example:

-check( RTL_TEXTENCODING_IBM_437, RTL_TEXTENCODING_IBM_437 );
+check( RTL_TEXTENCODING_IBM_437, RTL_TEXTENCODING_MS_1252 );

But I don't know if that's the root of the problem.

Change-Id: I09f640a6c92a782f99d79405aab5f5dd2b992c6d
2014-08-13 10:10:55 +02:00
57fd10220a warning C4706: assignment within conditional expression
quite useful in this case

Change-Id: I2f9a5ef8ea9faf7a1ce62bd9b4925b3f36b19d1a
2014-08-13 10:10:55 +02:00
e50ef195bc New loplugin:stringconcat
Change-Id: Id7c517fb37bc28797c45fc0dde83e866f2aa4aac
2014-07-01 15:45:52 +02:00
9a741fcad4 loplugin:unreffun: also warn about unused function templates
Change-Id: I4a6280f47ca3c4a77b4e42fe05d79ded7fc30ef1
2014-06-27 07:51:51 +02:00
b5cb4935c2 Work around undef conversion of large double to float
...as flagged by -fsanitize=undefined.  But is it really undefined?
[conv.double] "If the source value is between two adjacent destination values,
the result of the conversion is an implementation-defined choice of either of
those values."  So if the double is between std::numeric_limits<float>::max()
and std::numeric_limits<float>::infinity()...

Change-Id: I6389c8ac4a922991e240638d231dd2a39e173882
2014-05-22 18:31:07 +02:00
fe39041f98 Remove unnecessary casts
Change-Id: Iafc7727a22d657dfb6bc97ed767907cce3679364
2014-05-20 10:03:18 +02:00
cd11bc699a C string usage improvment
Change-Id: I5c59f0d2d1b911ffa1ee251e0f1355d137616493
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-05-20 09:47:54 +02: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
25d88d2b8e More hacking on --with-locales
Propagate the restriction of locales into <config_locales.h>. Note that in the
normal case, with no locale restrictions, all the WITH_LOCALE_xx macros are
zero anyway, but WITH_LOCALE_ALL is one.

Restrict which character encodings are handled in
sal/textencsal/textenc/tables.cxx based on the WITH_LOCALE_ macros. (Don't
simply always do it for iOS.)

Massage the affected unit tests to not crash when only partial character
encoding information is present.

Change-Id: Ie2c882c262ebd0d2b37dde66b8fe3c3e2570da14
2014-04-24 19:44:10 +03:00
81076cb3c0 Get rid of the "failure #23" style messages in CppunitTest_sal_rtl_textenc
While at it, print the character values in assertion messages in hex, not
decimal.

Change-Id: I61a5efca0a800ea295afc81e2b2f234844428b1c
2014-04-24 11:32:41 +03:00
70c773d30c Add missing right paren in assertion log messages
Change-Id: Ia6f3f0f74b6de127d8989935e10c15a6cf52e5d7
2014-04-24 10:43:56 +03:00
63ccf3fb11 Make assertion failures in CppunitTest_sal_rtl_textenc more informative
I have plans to change the sal textenc stuff to use ICU so better assertion
messages is essential.

Change-Id: I764a317435b6bd7c88d6e42fcfbefb1ec9c308fd
2014-04-23 21:37:52 +03:00
883844f21a Remove dead test code
Change-Id: Id03246fa9eefce718c36d73f84875f26d58caeba
2014-04-04 10:05:57 +02:00
335cd830b0 Kill superfluous vertical whitespace
Change-Id: I8c37b9ec45836f9c0e2dc0cf232f96f23c7c36d3
2014-04-03 10:00:55 +03:00
362d4f0cd4 Explicitly mark overriding destructors as "virtual"
It appears that the C++ standard allows overriding destructors to be marked
"override," but at least some MSVC versions complain about it, so at least make
sure such destructors are explicitly marked "virtual."

Change-Id: I0e1cafa7584fd16ebdce61f569eae2373a71b0a1
2014-04-01 19:22:54 +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
346a5e85bb WaE: unused variables
Change-Id: Ieac3cd6bf9ef883cbc3b295e25867a76ac68b88f
2014-03-23 19:25:55 +02:00
8d2da0b94a sal: Add rtl_digest_SHA1 which shows wrong sha1 calculation
This test shows wrong sha1 calculation after 52 bytes of input
data. For now this test is commented.

Change-Id: Id6df40ecc4059d4a4f9e1646a2c1bb7242f4cf69
2014-03-23 13:11:59 +01:00
7d3e8c5217 sal: Rewrite digest tests to be simpler, enable them in check
Change-Id: I610e615be498237e5cd9dd963bca60c7f8f62aac
2014-03-23 13:11:59 +01:00
d739b01b9f Adapt rtl_uriConvertRelToAbs to RFC 3986
...which updates RFC 2396, removes the requirement that the base URI's path
starts with a slash, and clarifies how to treat excess "." and ".." segments.

This nicely allows handling of those odd vnd.sun.star.Package URLs as intended
now, so that making <foo> absolute relative to base URL
<vnd.sun.star.Package:Pictures/bar> yields <vnd.sun.star.Package:Pictures/foo>
instead of provoking a MalformedUriException.

Change-Id: Ice84303a57698a2c05d3a45541fe78b67450fa3c
2014-03-01 19:28:15 +01:00
58f033569a Fix construction of non-ASCII test string
Change-Id: I495ba4e2394bf0fd09b4d0f0111f9b8531674733
2014-03-01 19:28:14 +01:00
4133c3e6ff Remove visual noise from sal
Change-Id: Idf07c7d31c0a523f929aded9ff3183a3f01b16b9
Reviewed-on: https://gerrit.libreoffice.org/8297
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-03-01 05:35:12 -06:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
d84cf2de01 sal: sal_Bool -> bool
Change-Id: I071a931660dafc1ee5950da527b042fb175255b8
2014-02-17 17:55:16 +01:00
ac6e8ac7e4 typo fixes in comments
Change-Id: Idd49478d59cd062118fbf8e99d1c8bc5250013fc
2014-02-06 23:22:30 +01:00
e3133ae237 Let C++ inline functions return bool instead of sal_Bool
...to improve diagnosing misuses of boolean expressions in client code (cf.
compilerplugins/clang/implicitboolconversion.cxx).  This change should be
transparent to client code.

Missing overloads of insert() for bool have been added to OStringBuffer and
OUStringBuffer (which required dropping one !VALID_CONVERSION check that would
now pick that overload, but would be flagged by
compilerplugins/clang/pointertobool.cxx).

Change-Id: I2d64cd923b8f47bfaa31e753def6515c29a3f8c9
2014-01-23 18:43:53 +01: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
249107f62c Typos
Change-Id: I27ada8b5154968e521d9e67f21473aa85776e70e
2013-12-23 07:59:24 +01:00
3b2f956ba6 Drop duplicate #include
Change-Id: Ife8ebbb5e46704c5d2ff46cc345b4ed926e7dc12
2013-12-02 01:02:06 +09:00
52bbd9cc00 remove unnecessary RTL_CONSTASCII_STRINGPARAM in appendAscii calls
Convert code like:
    aStrBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( "ln(x)" ));
to:
    aStrBuf.append( "ln(x)" );
which compiles down to the same code.

Change-Id: I24c7cb45ceb32fd7cd6ec7ed203c2a5d746f1c5c
2013-11-20 10:07:32 +02:00
3702a9b197 -Werror,-Wunused-member-function
Change-Id: I6197f2f9c3359ebe6c3c639f15c3e19d66434f3e
2013-11-14 10:14:56 +01:00
d366c9b20e remove unnecessary sal_Unicode casts in various places
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-14 08:17:32 +02:00
fcd1637d51 convert OUString compareToAscii == 0 to equalsAscii
Convert code like
   aStr.compareToAscii("XXX") == 0
to
  aStr.equalsAscii("XXX")
which is both easier to read and faster.

Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
2013-11-11 12:58:13 +02:00
a7724966ab Bin comments that claim to say why some header is included
They are practically always useless, often misleading or obsolete.

Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-22 16:56:28 +03:00
7bbd58eafc fdo#70319 "exponent followed by at least on digit" also for special case 0.0
Change-Id: I07e7917417b8a22cf6d64f2b7a447f9084b9fa2d
2013-10-17 18:01:59 +02:00
f20feba4c4 resolved fdo#70319 exponent must be followed by at least one digit
Change-Id: Icdd22fa0f1efcdd18cfea7cb48e1cbf2cf8d3533
2013-10-14 14:57:38 +02:00
0992fbe72b WaE: unused variable suToken, aEmpty, aEmpty2.
Change-Id: I2eaa32e0ec09b239e03d3efa776f5b47c2fb5c6d
2013-09-12 20:10:17 +01:00
f34fe6ed9f -Werror,-Wformat
Change-Id: I24a060d1d5592a23f9a991ef3b39f31818ea0d84
2013-09-11 18:20:19 +02:00
550b275e63 fdo#39625 Make existing cppunittests work
Change-Id: Ia3a59456fe82926141ccb2921aa47df4183ead86
Reviewed-on: https://gerrit.libreoffice.org/5905
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-09-11 15:50:41 +00:00
fadd7e8aa6 -Werror,-Wformat
Change-Id: Iae7da0146c670d77a4bdc2431a55c901318eef8d
2013-09-11 14:08:48 +02:00
6e066e4abe sal: fdo#39625 Make existing cppunittests work
Change-Id: I6bd34f0deaf246bc5898532377d996fcefc88cbc
Reviewed-on: https://gerrit.libreoffice.org/5906
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-09-11 11:41:02 +00:00
c2ba881c00 fix hex escape sequence
Change-Id: I8bc9d3812977589e96f5440afa8d46bfe4d3b88e
2013-08-23 09:53:34 +01:00
08452f1208 Rename SOLAR_JAVA to ENABLE_JAVA and HAVE_FEATURE_JAVA
Change-Id: Ib451bdb3c1c2ca42347abfde44651d5cf5eef4f3
2013-08-19 10:29:04 +03:00
3af0114a29 Introduce O[U]String::toUInt32
...which has become necessary since bd60d41176da540b01d7583cfe00637431967f39
"Handle oveflow in O(U)String::toInt() functions" reduces values in the range
(SAL_MAX_INT32 .. SAL_MAX_UINT32] to zero, but some calls of toInt32(16) relied
on getting a correct (unsigned) value for the whole input range ["0" ..
"FFFFFFFF"] (see libreoffice-4-1 commit 9bf6c83367cedb7be81bf67f30d2147d26c7a8c3
"Revert overflow checks in O[U]String::toInt{32,64} again").

Audited all uses of toInt32/64 with non-decimal radix.  (There is still a TODO
comment in oox/source/helper/attributelist.cxx, and
stoc/source/typeconv/convert.cxx will still need some love and test code.)

Change-Id: Iadaca1c0e41dab553687d0ce41c20c10cd657a95
2013-06-13 17:08:36 +02:00
2c7b6aa7a3 rewrite OUString test to not trigger literalalternative plugin warnings
Change-Id: Ic359209c44171ab42fa21cd300b433facd3c5ea6
2013-05-31 20:00:55 +02:00
e2e2cc6114 remove usage of RTL_CONSTASCII_USTRINGPARAM
Mechanical removal of usage together with OUString ctor, done
by compiler plugin.

Change-Id: I554227f76df0dac620b1b46fca32516f78b462c5
2013-05-06 16:51:45 +02:00
62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
598d3228cd remove HAVE_SFINAE_ANONYMOUS_BROKEN
Since we no longer support the old Apple SDK using gcc-4.0.1, we can
remove the cruft to work around its problems. Woohoo.

Change-Id: Idf275e76449443f1f0314e75dab993f213a77eb7
2013-04-04 13:44:30 +02:00
40dcf2d713 Add test case for toInt overflow detection
Change-Id: I1c5b66888baac8aa1bc99c06579e0ef3638a4877
2013-03-25 17:33:29 +01:00