Commit graph

1113 commits

Author SHA1 Message Date
Szabolcs Dezsi
e4fb171d3a Replaced a few equal calls with == 2012-04-08 19:24:00 +02:00
Caolán McNamara
63de3197af WaE: msvc, unreachable code 2012-04-07 20:06:38 +01:00
Szabolcs Dezsi
d6bc02f8c4 Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator 2012-04-06 20:03:42 +02:00
Luboš Luňák
2dde3c3ebb reset the flag before checking it it will be set again 2012-04-06 16:15:09 +02:00
Szabolcs Dezsi
743f22045c Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Pattern used:

find . -name "*.cxx" -exec sed -i 's/\( *\)\(else if\|if\) *( *\([^!()|&]*\)\.equalsAsciiL( *RTL_CONSTASCII_STRINGPARAM *( *\([^)]*\)) *) *)$/\1\2 ( \3 == \4 )/' \{\} \;
2012-04-06 15:07:41 +02:00
Luboš Luňák
066dbfd197 string literal O(U)StringBuffer ctors too, after all 2012-04-06 13:46:21 +02:00
Mark Wolf
8307fe9f65 Translated German comments to English in folder 'sal'.
sal/qa/rtl_strings/rtl_old_testostring.cxx contains some German comments still
but the code itself uses test strings in German. When the test strings appear
in the comments, they were left unchanged to maintain consistency.

Mark Wolf
2012-04-05 12:33:59 +02:00
Luboš Luňák
c813c00947 don't skip first cmdline argument
It looks like this one is also meant to be called manually or something,
and the original version didn't skip the first argument either.
2012-04-03 14:06:12 +02:00
Luboš Luňák
a7eb227cfc fix crude command line arguments handling 2012-04-02 19:06:47 +02:00
Luboš Luňák
174a1d3c3d fix very ... uhm ... inventive and confusing use of empty string 2012-04-02 19:06:46 +02:00
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