Commit graph

1103 commits

Author SHA1 Message Date
Luboš Luňák
8aa60b51a9 (const) char[] (i.e. size unknown) cannot be used with O(U)String
msvc can't handle the necessary template overload (and maybe it's
right, I'm not sure)
2012-03-29 11:12:22 +02:00
Luboš Luňák
bb070c05b6 CPPUNIT_ASSERT_EQUAL() takes expected as the first argument 2012-03-28 23:48:55 +02:00
Luboš Luňák
c9167bac18 gcc-4.0.1 SFINAE workarounds 2012-03-28 23:40:10 +02:00
Luboš Luňák
ef87e804ec string literal overloads for OStringBuffer 2012-03-28 23:00:55 +02:00
Luboš Luňák
b741f7fb1e make unittest check also for invalid conversions with OUStringBuffer 2012-03-28 23:00:55 +02:00
Luboš Luňák
bd577aa7f8 string literal overload for OUStringBuffer::insert() 2012-03-28 23:00:54 +02:00
Luboš Luňák
8a654fe9a5 use SFINAE to remove non-const char[N] OUString overloads 2012-03-28 23:00:54 +02:00
Luboš Luňák
86a1e6de4f SFINAE workarounds for gcc-4.0.1 2012-03-28 17:51:58 +02:00
Luboš Luňák
2ebda60bfe more SFINAE to distinguish between const char* and const char[] 2012-03-28 09:07:17 +02:00
Luboš Luňák
3ba10632a3 string literal overloads for rest of OString methods 2012-03-28 09:07:17 +02:00
Luboš Luňák
533eadeb46 CPPUNIT_ASSERT_MESSAGE -> CPPUNIT_ASSERT_EQUAL_MESSAGE 2012-03-28 06:30:27 +02:00
Luboš Luňák
205ee3062e finish work-in-progress test 2012-03-26 19:11:45 +02:00
Luboš Luňák
09517a98fe string literal overload for OString::operator=() 2012-03-26 18:57:04 +02:00
Luboš Luňák
62983d5ae6 CPPUNIT_ASSERT( == ) -> CPPUNIT_ASSERT_EQUAL() 2012-03-26 18:57:04 +02:00
Luboš Luňák
92fec304fb string literal overloads for OUStringBuffer 2012-03-26 18:57:04 +02:00
Takeshi Abe
ac68443c80 removed duplicate includes in sal 2012-03-23 22:53:56 +09:00
Tor Lillqvist
2a1171929e chmod -x 2012-03-21 13:00:45 +02:00
Luboš Luňák
01baa9e0c8 checked that we do not use OString ctor with literals with \0's
Except in some unittests, which are sometimes rather silly and
broken about it, which might explain why they're disabled.
2012-03-13 16:21:05 +01:00
Luboš Luňák
3d9f5c856a make OString work even with old gcc that has SFINAE broken
Since OString already has a ctor accepting const char*, I cannot
find out a way to distinguish string literals other than using
a template, otherwise const char* somehow takes precedence
(all of gcc, clang, msvc). But the template requires
the Substitution Is Not A Failure Idiom to actually create
only wanted instances. And the compiler can try evaluate
the OString ctor as a possibility when comparing an int to
an anonymous enum, and anonymous enum as a type without linkage
cannot be a template argument before C++11. SFINAE should still
work, but not with gcc older than 4.0.2 (which we right now
use only on macs). So for that case disable the string literal
ctors, which means macs will have one extra strlen call,
and also that embedded \0's in string literals will be
inconsistent. The tiny performance problem shouldn't matter that
much and will eventually go away, the \0 problem should not
matter, since before string literal ctors were introduced
\0's had not been included anyway unless RTL_CONSTASCII_STRINGPARAM
was used. So we should be safe and when removing the CONSTASCII
macros \0 cases should be handled by explicitly mentioning
the length.
2012-03-13 16:21:04 +01:00
Luboš Luňák
9fabd6c078 handle msvc not even compiling a test that should fail
but that is fine, because outside the unittest it should fail
everywhere
2012-03-12 16:36:59 +01:00
Luboš Luňák
814cb6a3d6 implement OUString::endsWithIgnoreAsciiCase()
match() has matchIgnoreAsciiCase(), so it makes sense that endsWith()
also has the IgnoreAsciiCase variant, especially given there already is
endsWithIgnoreAsciiCaseAsciiL()
2012-03-12 13:35:58 +01:00
Luboš Luňák
91752ecd4e also check that string literals do not actually trigger OUString ctors 2012-03-12 13:35:58 +01:00
Luboš Luňák
06a6b0ad1e unittest checking basic string literals OUString functions functionality 2012-03-12 13:35:58 +01:00
Luboš Luňák
8bdc0e9c23 unittests for some possible OUString string literal handling problems 2012-03-12 13:35:57 +01:00
Luboš Luňák
3f765e5bb2 replace usage of OUString::replace*AsciiL() with string literal overloads 2012-03-12 13:35:57 +01:00
Luboš Luňák
8c5e68b0f6 make the OUString unittest ctor contain garbage
this will make it easier to detect errors, rather than making it empty
2012-03-12 13:35:56 +01:00
Luboš Luňák
53fb5f774e OString ctor for string literals without RTL_CONSTASCII stuff 2012-03-12 13:35:56 +01:00
Luboš Luňák
2f5f802bcf rtl_uString_newFromLiteral() for string literals
Drop the recently introduced rtl_uString_newFromAscii_WithLength()
and replace it with this one. The name fits better and it'll be also
a distinct function that specifically includes embedded \0's
(because that's what OUString supports and if a string literal
explicitly includes it, it makes sense to copy it as such).
2012-03-12 13:35:56 +01:00
Luboš Luňák
5420d7092f use the new license header, this file has been written by me 2012-03-07 15:20:37 +01:00
David Tardon
2b945f8ee4 WaE: deleting 'PSID {aka void*}' is undefined 2012-03-07 14:01:26 +01:00
David Tardon
31fdb7f464 WaE: missing braces around initializer 2012-03-07 14:01:26 +01:00
David Tardon
8c986d3eb3 WaE: "NOMINMAX" redefined 2012-03-07 14:01:25 +01:00
David Tardon
1f370333c5 remove useless include guards 2012-03-07 14:01:25 +01:00
David Tardon
8fc3fc5642 WaE: ignoring #pragma warning 2012-03-07 14:01:24 +01:00
Luboš Luňák
f150ed241f OUString ctor for string literals without RTL_CONSTASCII stuff
http://lists.freedesktop.org/archives/libreoffice/2012-February/025662.html
2012-02-22 16:21:37 +01:00
Stephan Bergmann
9ab0b38e95 Various string function clean up
Added:
* rtl::OString::matchL
* rtl::OString::endsWith
* rtl::OString::endsWithL
* rtl::OString::indexOfL
* rtl::OString::replaceFirst
* rtl::OString::replaceAll
* rtl::OString::getToken
* rtl::OUString::endsWith
* rtl::OUString::replaceFirst
* rtl::OUString::replaceFirstAsciiL
* rtl::OUString::replaceFirstAsciiLAsciiL
* rtl::OUString::replaceAll
* rtl::OUString::replaceAllAsciiL
* rtl::OUString::replaceAllAsciiLAsciiL
* rtl::OUString::getToken
plus underlying C functions where necessary

Deprecated:
* comphelper::string::remove
* comphelper::string::getToken

Removed:
* comphelper::string::searchAndReplaceAsciiL
* comphelper::string::searchAndReplaceAllAsciiWithAscii
* comphelper::string::searchAndReplaceAsciiI
* comphelper::string::replace
* comphelper::string::matchL
* comphelper::string::matchIgnoreAsciiCaseL
* comphelper::string::indexOfL

Also fixed some apparent misuses of RTL_CONSTASCII_USTRINGPARAM ->
RTL_CONSTASCII_STRINGPARAM.
2012-02-15 15:41:09 +01:00
François Tigeot
32009128e4 Remove unused VolumeDevice functions and related code 2012-02-05 21:42:34 +01:00
Thomas Arnhold
83a5267651 dead code in qa 2012-01-24 15:37:36 +01:00
Thomas Arnhold
04b8bac4a9 finalize gcc 4.7 string literal operators 2012-01-24 10:21:13 +01:00
Michael Meeks
e981b42710 sal: re-disable file based unit tests that don't pass 2012-01-21 20:53:41 +00:00
Matúš Kukan
67cf29bb36 sal: make more tests running 2012-01-21 19:33:13 +01:00
Michael Meeks
85f33f177a sal: enable osl::File unit tests, and add a new readLine unit test 2012-01-21 17:11:06 +00:00
Michael Meeks
59cefd339d cleanup: remove annoying ( ) empty parameter pattern 2012-01-21 17:02:40 +00:00
Stephan Bergmann
d92ac0dfbf Remove obsolete suppressOslDebugMessage. 2012-01-20 12:14:46 +01:00
Stephan Bergmann
5eea018d80 Clang -Wdangling-else, -Wuninitialized. 2012-01-15 22:42:25 +01:00
Caolán McNamara
ab706f997d remove duplicate createHex 2012-01-09 13:28:38 +00:00
Matúš Kukan
8f823b7d39 gcc-trunk: fix: unable to find string literal operator 'operator FOO' 2012-01-05 17:32:21 +01:00
Olivier Hallot
85d1ce27ad Fix for fdo43460 Part XXVII getLength() to isEmpty()
Please find attached a partial fix for Easy Hack FDO43460

Part XXVII
Modules
padmin, pyuno, rdbmaker, regexp, registry, rsc, sal
2012-01-02 19:17:17 +01:00
Caolán McNamara
b40f2b9b08 get osl_File qa test to build under windows 2011-12-21 15:50:12 +00:00
Matúš Kukan
91609fe9d8 sal: add more unit tests 2011-12-19 10:14:54 +01:00