Commit graph

915 commits

Author SHA1 Message Date
Stephan Bergmann
6e67c03dc0 Enable -Wnon-virtual-dtor for GCC 4.6
...which has the necessary features to support it.

Change a lot of classes to either contain a protected non-virtual dtor
(which is backwards compatible, so even works for cppumaker-generated
UNO headers) or a public virtual one.

cppuhelper/propertysetmixin.hxx still needs to disable the warning, as
the relevant class has a non-virtual dtor but friends, which would still
cause GCC to warn.

Includes a patch for libcmis, intended to be upstreamed.
2012-03-14 13:32:02 +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
Josh Heidenreich
bde32dc95d Removed FileStatus::isFile. Use ::isRegular instead.
See:
https://bugs.freedesktop.org/show_bug.cgi?id=44982#c6
https://bugs.freedesktop.org/show_bug.cgi?id=44982#c7

for why.
2012-03-13 16:03:32 +10:30
Luboš Luňák
36627af621 SAL_DLLPUBLIC_TEMPLATE
On Linux, public templates should not be hidden at the linker level.
But on Windows, dllimport causes trouble. So create a new macro
to be used specifically with templates that does the right thing
on both platforms.
(http://lists.freedesktop.org/archives/libreoffice/2012-March/028041.html
and followups)
2012-03-12 19:12:49 +01:00
Luboš Luňák
4f5bc49954 @since 3.6 -> @since LibreOffice 3.6
To help distinguish between OOo derivatives.
2012-03-12 13:35: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
61327c9948 forgot to disable mixed char and const char overloads
the comment was wrong, char gets converted to const char, not the
other way around
2012-03-12 13:35:58 +01:00
Luboš Luňák
56e4153e2c replace replace*AsciiL() OUString methods with string literal ones
The AsciiL variants are new for 3.6 anyway, so there's no need to keep
new functions that'd be obsolete before their first release.
2012-03-12 13:35:57 +01:00
Luboš Luňák
46ddefe25d string literal overloads for some OUString methods 2012-03-12 13:35:57 +01:00
Luboš Luňák
a1de256637 some fixes for OUString docs 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
715bdfdd8f prevent using RTL_CONSTASCII_* macros with string literal functions
This is to prevent things like by mistake doing match( RTL_CONSTASCII_STRINGPARAM("foo")),
which will call match(const char(&)[N], int=0), where the second argument is the fromIndex
argument.
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
Stephan Bergmann
73c9b3c59e osl_loadModuleRelativeAscii was erroneously not exported 2012-03-12 12:18:00 +01:00
Luboš Luňák
820c23d397 sal_Bool to bool in SAL_LOG if possible
otherwise clang warns about things like 1 && 1
2012-03-11 09:57:05 +01:00
Luboš Luňák
a680eba9a0 SAL_DLLPUBLIC_IMPORT with gcc should not be empty
Otherwise when using a template from another module, an instance
of it may end up being non-exported even though it's used by
something exported.
2012-03-10 16:39:22 +01:00
Stephan Bergmann
608fe962cc Let osl::FileStatus getters assert programming errors
...instead of arbitrarily returning certain values when the requested
information is not available.

This reveals a problem in strmunx.cxx that is apparently a regression introduced
with 4a086fca7b "fix SvStream to not require a
custom open or lstat method."
2012-03-09 11:56:10 +01:00
Stephan Bergmann
8840765e29 Fixed @since tags 2012-03-09 09:23:08 +01:00
Josh Heidenreich
af5cc38cac sal file.hxx documentation 2012-03-09 08:49:55 +10:30
Josh Heidenreich
b64352905f Added FileStatus methods isFile, isDirectory, isRegular, isLink 2012-03-09 08:49:54 +10:30
Stephan Bergmann
d5cb0636dc In osl::Thread::create, do not access members after starting the thread
...as the Thread may already have been destroyed by that time.
Also, no need to programmatically check fro programming errors when they
have already been addressed by assert.
2012-03-08 14:11:56 +01:00
Luboš Luňák
9db31fc566 rtl_uString_newFromAscii_WithLength() and use it in OUString 2012-03-05 13:11:51 +01:00
Luboš Luňák
40212a207c optimized OUString operators =,==,!= for string literals 2012-03-05 13:11:51 +01:00
Luboš Luňák
a59f658312 add @since to new OUString ctors 2012-03-05 13:11:50 +01:00
Luboš Luňák
8025d89840 assume string literals to be ASCII-only, rather than UTF-8
ASCII-only handling is much more efficient, and some functionality
like comparison has optimized variants for ASCII
2012-03-05 13:11:50 +01:00
Korrawit Pruegsanusak
0f6d1ff621 some doxygen warnings cleanup 2012-02-27 21:25:02 +07:00
Jan Holesovsky
6cd8586f23 MinGW: snprintf might be present. 2012-02-24 18:54:37 +01:00
Stephan Bergmann
a342b3e3b0 Moved dp_gui::Thread to salhelper::Thread, so that all code can use it
...also improved the code somewhat.
2012-02-23 10:47:35 +01:00
Stephan Bergmann
5b98bb4713 log-areas clean up 2012-02-23 10:47:35 +01:00
Tor Lillqvist
59dfa55180 cppunittester hacks for iOS, intermediate commit
For iOS cppunit plugins aren't really "plugins" (shared libraries),
but just static archives. In the real main program of a cppunit app
(such are not yet written), which calls the lo_main() (the
SAL_IMPLEMENT_MAIN() in cppunittester.cxx) we specifically will call
the initialize methods of the CppUnitTestPlugIns that we statically
link to the app executable. Hopefully that will work out as expected.
2012-02-22 22:35:55 +02: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
Thomas Arnhold
22e96521da WaE: silence some documentation errors 2012-02-22 00:52:32 +01:00
Tor Lillqvist
a1fe0a772f Use the same simple lo_main() on iOS as on Android
Let's do the iOS specific stuff in separate main() source
file(s). Don't attempt to build complete iOS programs using normal
LibreOffice mechanisms, it will work for only the very lowest level
unit tests anyway, because of static linking and the circularish
UNO/URE/bootstrap/whatnot (run-time) dependencies between different
parts of the code.

We thus can't build the various iOS-specific *_cppunittester_all unit
test executables any more. Corresponding unit tests (and more complex
ones) for iOS will have to be done in a different way.
2012-02-16 15:25:37 +02:00
Stephan Bergmann
e2de115700 -Wundef 2012-02-16 13:10:58 +01:00
Stephan Bergmann
acc9fb5ca0 Prevent misuses of RTL_CONSTASCII_USTRINGPARAM
works only on 64 bit platforms, though.
2012-02-16 08:31:45 +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
Tor Lillqvist
c301199804 Merge branch 'feature/android' 2012-02-15 12:00:46 +02:00
Michael Meeks
3e41d0bf6a cleanup: remove remenants of gcc version checking 2012-02-14 14:15:52 +00:00
Stephan Bergmann
3073b539d2 Make code exploiting -fthreadsafe-statics properly conditional
Looks like 979e2c8f8b missed these.
2012-02-14 12:32:54 +01:00
Alexander Bergmann
8963cc01f5 EasyHack: Removed gcc conditionals 2012-02-13 17:33:15 +00:00
Luboš Luňák
31e236c5ef consistent constness for getFunctionSymbol() overloads
This is an inline function, so there should be no problems with binary
compatibility.
2012-02-10 13:34:05 +01:00
Caolán McNamara
5154135e36 fix ppt embedded graphic dumper 2012-02-09 11:40:59 +00:00
François Tigeot
32009128e4 Remove unused VolumeDevice functions and related code 2012-02-05 21:42:34 +01:00
David Tardon
064990eb88 add sc.ui log area 2012-02-03 10:01:35 +01:00
David Tardon
767098b0ca add vcl.gdi log area 2012-02-01 06:07:20 +01:00
Tor Lillqvist
2c11a8fed6 Add lo_dlclose() 2012-01-31 16:19:17 +02:00
David Tardon
bfd9753b92 add vcl log area 2012-01-31 07:18:49 +01:00
Miklos Vajna
f7aac5d4a5 sal: add sw.rtf log area 2012-01-30 14:21:10 +01:00